Geoffrey Mainland

Flask

Flask is a programming language for sensor networks geared towards streaming data applications. It is realized as a domain-specific language embedded in Haskell. Its design is inspired by prior work on Functional Reactive Programming (FRP), but motivated by the constraints of sensor network platforms. Flask runs on real hardware, including both MicaZ and TelosB motes.

The key observation behind Flask is that in programs written in the FRP style, it is the point-wise manipulation of values that must be executed dynamically; the data flow configuration of these programs is typically static. Flask exploits this observation by explicitly staging the static and dynamic behavior of dataflow programs. Haskell serves as Flask's meta language, and its full power is available for expressing how data flow graphs can be constructed using FRP-style combinators. Flask also requires that point-wise manipulation of signal values is always done in a restricted object-language. Because the dynamic behavior of the program is expressed only through a restricted object language, Flask programs can run on even highly resource-constrained devices.

Flask consists of a staging mechanism that cleanly separates node-level code from the meta-language used to generate node-level code fragments; syntactic support for embedding standard sensor network code; a restricted subset of Haskell that runs on sensor networks and constrains program space and time consumption; a higher-level "data stream" combinator library for quickly constructing sensor network programs; and an extensible runtime that provides commonly-used services. The current incarnation of Flask is described in our ICFP '08 paper. An earlier, Caml-based implementation is described in a tech report.

Please also see Matt Welsh's macroprogramming page for more details on the macroprogramming project at Harvard.

Flask Publications

Flask: Staged Functional Programming for Sensor Networks. Geoffrey Mainland, Greg Morrisett, and Matt Welsh. Proceedings of the Thirteenth ACM SIGPLAN International Conference on Functional Programming (ICFP '08), September 2008.
[doi] [pdf] [bib]

@inproceedings{mainland08flask,
  address = {Victoria, {BC}, Canada},
  title = {Flask: Staged Functional Programming for Sensor Networks},
  booktitle = {Proceeding of the 13th {ACM} {SIGPLAN} International Conference on Functional Programming ({ICFP} '08)},
  author = {Mainland, Geoffrey and Morrisett, Greg and Welsh, Matt},
  year = {2008},
  pages = {335--346},
}

Flask: A Language for Data-driven Sensor Network Programs. Geoffrey Mainland, Matt Welsh, and Greg Morrisett. Harvard Tech Report TR-13-06, May 2006.
[pdf] [bib]

@techreport{mainland06flask-tr,
 author = {Geoffrey Mainland and Matt Welsh and Greg Morrisett},
 title = {Flask: A Language for Data-driven Sensor Network Programs},
 institution = {Harvard University},
 year = 2006,
 number = {TR-13-06}
}

Flask Distribution

The Flask 0.1 release is available here.