C as a Portable Intermediate Language
cybertiggyr.com
cybertiggyr.com
One of the reasons this approach isn't more popular is that it limits what you can do at runtime in ways a virtual machine doesn't; C (and the basic blocks emitted by a C compiler) are very hard† to work with, whereas VM instructions almost by definition aren't.
† But not impossible; see, for instance, Dynamo/RIO.
For quite a long time, GHC's main codegen backend was via C.
For a better, somewhat Scheme-specific intro, check out http://matt.might.net/articles/compiling-scheme-to-c/ .
For an ML-flavored one, "No Assembly Required: Compiling Standard ML to C" by Tarditi et al (http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.43.7...), and its bibliography.
This is how Squeak is portable across so many different platforms. (Altered to suit a dynamic language.) The VM is implemented in a statically-compiled Smalltalk subset which is emitted as C. I understand that Rubinius uses this trick as well.
I believe there's more recently an option involving LLVM, though I'm not sure if this replaces the C-- step or is an alternative to GCC.
I believe that it has been deprecated now that the LLVM backend is more mature. I'm not 100% sure, though.
EDIT: found it! http://www.haskell.org/ghc/docs/7.0.1/html/users_guide/relea... (in the 1.5.6 section)
> The registerised via-C backend, and the -fvia-C flag, have been deprecated. The poor floating-point performance in the x86 native code generator has now been fixed, so we don't believe there is still any reason to use the via-C backend.
Doesn't HIPHOP use this approach though?