Sensor networks present a number of novel programming challenges for application developers. Their inherent limitations of computational power, communication band-width, and energy demand new approaches to programming that shield the developer from low-level details of resource management, concurrency, and in-network processing.

Regiment is a functional macroprogramming language that allows programming the sensor network as a whole, rather than writing low-level software to drive individual nodes. Regiment programs are purely functional, but the values manipulated by the program can be time-varying streams of data (e.g. sensor readings), or even spatially distributed, time-varying collections of state, called regions.

The programmer uses regions to define and manipulate sets of sensor nodes, selecting nodes with some geographic, logical, or topological relationship; for example, all nodes within k estimated radio transmissions of some anchor node. Regions are general purpose container types. They can be nested; they can be constructed globally for querying the network, or constructed locally for querying a neighborhood. Regiment provides a small and orthogonal set of operations on regions (including map, filter, and fold). These operators -- composed arbitrarily -- form an expressive language for data manipulation and querying.


Applications currently using Regiment/WaveScript:



Implementation: Regiment 1.0

The Regiment team has constructed a first Regiment compiler which targets a lightweight intermediate representation called the Token Machine Language (TML). Because TML is very simple, the run-time need not involve a complex, monolithic query processor, and therefore Regiment is easily retargetable. The programmer prototypes and debugs their programs using a high-speed TML simulator. Then, using a prototype TML back-end they generate TinyOS C code from the the TML intermediate form.

Regiment 2.0 aka WaveScript

Regiment 2.0 is connected to the WaveScope stream processing engine and also goes by the name WaveScript. It incorporates a library of signal processing functions as well as a special datatype for managing segments of signal data It generates high-performance C-code capable of running on any Linux-based embedded device.


This manual gets you started writing and running WaveScript code. It's also available in PDF form.

Nightly Regression Testing

If you're using Regiment/WaveScript from its SVN repository, please check the log of the nightly regressions tests to get the latest good version.

Code Documentation

The javadoc-style documentation for the source itself (currently out of date) is here.


See the main WaveScript/WaveScope page for download information.