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.
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.
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.
> 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.
So it was deprecated, just never removed.And if you want an alternative Erlang, see Elixir (http://elixir-lang.org/), Joxa (http://joxa.org/) and LFE (https://github.com/rvirding/lfe).
CoffeeScript for C would probably use semantic whitespace, like normal CoffeeScript. Maybe it would make writing types easier – it would support a syntax for types that doesn’t require the use of http://www.cdecl.org/. It would still try to be “just C”, so it wouldn’t support much higher-level features like function closures.
The three syntactic sugars I’m including are these: allow indents instead of {}; automatically add semicolons; remove parentheses from if/while/for conditionals. I’m trying to make my compiler robust enough to not cause problems like JavaScript’s automatic semicolon insertion does.
This project is just CoffeeScript for C for now, but I’m aiming in the future to make a generic “CoffeeScript for C-like languages”, that can be adapted to work with languages like with ActionScript and Java with only minor tweaking.