Inspired by this, I've started writing a compiler for a subset of Matlab. I'm sick of Matlab being an interpreted language year after year, and while I don't hope to <i>change</i> that, I can at least do a proof-of-concept to lend weight to my derision.<p>I've got the lexer and parser done, thanks to Parsec, and some basic C code generation as a sanity check. Now for the runtime LLVM code generation, to make it feel like an interpreter! Thanks, HN!
He mentioned that llvm-py documentation was lacking... I was going through it, seems pretty darn good to me (relatively). <a href="http://mdevan.nfshost.com/llvm-py/userguide.html" rel="nofollow">http://mdevan.nfshost.com/llvm-py/userguide.html</a>
Impractical:
1) The compiler is gonna be very slow;
2) If you make compiler for low-level language, such as C
you need precise correspondence between data types used in cpu, datatypes used in compiler's implementation language and datatypes in the target language.