Friday, March 6, 2009

Preview of Pioneer Connectivity Framework

Pioneer DebuggerThere have been rumors of what I was working on while in China. Since the first days of the Network I’ve imagined that we would have an agent that could be deployed to environments and be able to perform relatively simply operations.

The Pioneer Agent Connectivity Framework is the realization of this. To the right you see an example of the debugger running a script.

OK, but what is the Pioneer Connectivity Framework and what can we do with it? The Framework consists of the following components: a runtime with its own DSL (tokenizer, parser and interpreter that runs inside of the .NET 3.5), a Windows Service with installer to allow the runtime to be deployed on other computers, an interactive debugger to enable development, testing and diagnosing issues with the framework, connectivity to the CIQ Network, connectivity to any ADO.NET based database, a timer subsystem to allow for timed operations, and finally a file watching subsystem to watch folders for changed files. Phew! That was a mouthful.

OK, but why a new language on top of all the rest of this? Well, I’ve seen so many instances where we’ve deployed applications only to have to quickly act on an escalation to solve problems at customer sites. We’ve worked around a lot of deployment issues by isolating query files, but we’ve not extended this to the other aspects of our programming. With a small, light-weight language --  a domain specific language --  it will be possible to stitch together applications using a minimal amount of code.

Another possibility will be to deploy the agent without any of its application specific knowledge, this can be downloaded later by sending an event via the Network to obtain the latest code based on the environment and appropriate version.

Keywords

  • if, then, else – conditional statement
  • event – a way to access the event properties inside of a subscribe, timer and watch event definition. An example of this is event(‘FullPath’) in a watch definition will return the path to the file that was changed/deleted/created.
  • true/false – boolean constants
  • func – a function definition. There are no signatures to the functions similar to JavaScript. A function and a procedure are defined by whether they return a value.
  • include – inclusion of other pioneer script files
  • invoke – a way to call into the .NET BCL
  • namespace – able to mark function and variable definitions in different namespaces
  • null – the null constant
  • return – the ability to return from a function and/or return a value from a function.
  • start/stop – mechanism to start and stop previously defined timers
  • subscribe – define a subscription to a received network event/network document
  • timer – define a new timer that expires at a definite time, a relative time or is recurring
  • using – a way to define a namespace that should be searched when calling functions or referencing variables
  • watch – define a folder watcher
  • while, do, break – a looping statement
  • end – the end of a block (if, while, func and namespace)
  • var – the definition of a variable

The language is loosely typed similar to JavaScript. It is not an object language so it is not possible to create new types, however, it is possible to obtain references to .NET types and pass those to invoke() calls.

The implicit types are integers,  strings and lists.

Extensibility

Currently there are several ‘libraries’ that can be included. By creating an include file containing one or more invoke() statements and dropping a DLL into the Library folder, brand new functionality can be added without having to recompile and redistribute the framework.

What’s with the name?

I choose the name pioneer after the NASA Pioneer Program. The most famous of the spacecraft launched with this name were the Outer Solar System Missions, Pioneer 10 and 11, launched in March ‘72 and April ‘73 respectively. Pioneer 10 was the first probe to transit to Jupiter and its sister craft visited Jupiter and Saturn.

That’s great! But what does this name have to do with our work? The intent of the Connectivity Framework is to work out in “remote” regions away from the home planet and return data back to other services. The Pioneer program had launches that spanned over 20 years and the last successful telemetry with Pioneer 10 was April 2002, or 30 years after it was launched!

My hopes are that we’ll be able to apply the Pioneer Agent Framework to many of the fast moving connectivity projects that are the “bread and butter” of what we do here.

Last Words

All of this rides on top of the CIQ Network Foundation Libraries that provide ease of access to the Connect IQ Network as well as provide a stable platform for hosting Windows Services.

As more or less of a bonus, the editor/debugger recognizes the syntax and provides coloring.

 

1 comment:

  1. Check out Ruby, Rack and Sinatra. Great for rapid Network app development.

    ReplyDelete