[Haskell-cafe] Which Haskell DSL for writing C? (Was ANN: Copilot 0.22 -- A stream DSL for writing embedded C.)

Lee Pike leepike at gmail.com
Tue Sep 21 16:32:13 EDT 2010

Oh, one thing I should mention is that there are a few Haskell DSLs for generating embedded C now:

 * Atom http://hackage.haskell.org/package/atom
 * Feldspar http://hackage.haskell.org/package/feldspar-language
 * cmonad http://hackage.haskell.org/package/cmonad
 * Copilot http://hackage.haskell.org/package/copilot
 * Others?

Which to use for what?

Most of my experience is with Atom and Copilot.  Copilot is a minimalist stream (data-flow) language, as it is focused on monitoring properties rather than more "stateful" tasks.  Still, for some data-processing, it's quick and simple, pretty much like writing Haskell lists.  The best reference for Copilot's constraints is this paper: <http://www.cs.indiana.edu/~lepike/pub_pages/rv2010.html>.

In our flight-test of a pitot (air-pressure) sensor <http://picasaweb.google.com/105722675808588603973>, we wrote some of the fault-tolerance and sensor computation in Atom + C, and monitors for properties in Copilot.  As mentioned, Copilot actually uses Atom as a "backend" for generating C code.  

Of course, it's perfectly fine to mix-and-match Atom & Copilot.

I know less about Feldspar, but I think the language has higher-level data-structures (e.g., vectors and matrices) and is focused more on DSP than periodic, constant-time/constant-space C code generation.

Thoughts from others?


More information about the Haskell-Cafe mailing list