Yeah, I would also love a "CoffeeScript for C". Honestly, I think C is a rather overrated language--it's liked not because it's good but because it's the best at what it does. And best is only a relative measure!
The most promising thing I've seen is CIL[1][2]. This is not a language per se, but it follows the same idea as CoffeeScript: simplify and get rid of stupid edge cases and odd syntax. The difference is that CIL is designed as an intermediate language (hence the name); it's a target for a DSL, compiler or code generator more than a language proper.
For embedded programming, I think a DSL embedded in Haskell or OCaml outputting C through CIL can give you all the benefits of C without many of the problems. More importantly, it gives you a power to abstract that C sorely lacks, as well as a nice type system.
There are some existing DSLs in this vein (that is, generating C rather than using CIL necessarily). One example I came across recently is atom[3], but I haven't used it (or any other language like that). It's certainly something to keep in mind.
Many languages — Haskell included — can compile to C. Compiling down to C and then piggybacking off the system C compiler is a fairly common way of getting a sophisticated native codegen without needing to implement one yourself. But simply compiling down to C doesn't necessarily put the language in the same relationship with C that CoffeeScript is with JavaScript.
To be honest, I could imagine a slightly nicer skin over C, but C is already a pretty good C. Any "CoffeeScript for C" would probably work out to a poor reimplementation of an early C++ compiler with the semicolons removed.
This isn't compiling Haskell down to C. It's using a DSL to generate C. The DSL just happens to be embedded in Haskell.
Haskell is just an environment, a language factory. Haskell is used for creating the abstractions and meta-programming. You can also piggy back on Haskell's type system to enforce certain invariants.
But ultimately the semantics of the DSL--what actually gets turned into C--are not necessarily related to Haskell at all. Instead, the semantics are tailored for your particular application. In the particular case of atom, this application is hard real-time programming.
Another example is something one of my friends worked on in OCaml. He essentially created a little algebraic system which provided all the operations for a field (with maybe a couple other ones). This is enough to implement a bunch of variations on a Kalman filter. He could then iterate quickly and test the code locally; when he was content, he could use the same code to output abstraction-free C which he could then compile and deploy on ARM.
The point being that the host language is not related to C; it's the embedded DSL that plays the role of CoffeeScript. (Although any reasonable DSL would be quite a larger departure from C than CoffeeScript is from JavaScript.) You just use Haskell/OCaml/Scala/whatever to save having to implement a parser, type system and so on.
AFAIK it isn't removed, but it is no longer developed and requires GHC to be in unregistered mode, which most people's won't be. But I could simply be behind the times.
> This is the oldest code generator in GHC and is generally not included any
> more having been deprecated around GHC 7.0. Select it with the -fvia-C flag.
The most promising thing I've seen is CIL[1][2]. This is not a language per se, but it follows the same idea as CoffeeScript: simplify and get rid of stupid edge cases and odd syntax. The difference is that CIL is designed as an intermediate language (hence the name); it's a target for a DSL, compiler or code generator more than a language proper.
[1]: http://www.cs.berkeley.edu/~necula/cil/index.html [2]: http://kerneis.github.com/cil/
For embedded programming, I think a DSL embedded in Haskell or OCaml outputting C through CIL can give you all the benefits of C without many of the problems. More importantly, it gives you a power to abstract that C sorely lacks, as well as a nice type system.
There are some existing DSLs in this vein (that is, generating C rather than using CIL necessarily). One example I came across recently is atom[3], but I haven't used it (or any other language like that). It's certainly something to keep in mind.
[3]: http://hackage.haskell.org/package/atom/
Of course, all these DSL-based approaches are a larger departure from C than CoffeeScript is from JavaScript, but I think that a good thing.