If you're interested in something similar but a little more theoretical, take a look at "Simply Easy"[1], a little paper on implementing a couple of variations on the lambda calculus. The main idea is to demonstrate how to evaluate a dependently typed language.<p>It starts by looking at how to evaluate the simply typed lambda calculus and then going from that to a dependently typed lambda calculus. Surprisingly, the transformation is not all that complicated!<p>The actual code is in Haskell.<p>[1]: <a href="http://strictlypositive.org/Easy.pdf" rel="nofollow">http://strictlypositive.org/Easy.pdf</a>
Hehe, I love this. I have been doing something similar, writing a compiler of Scheme-like language to x86 in Haskell.<p><a href="https://bitbucket.org/quiark/hsc" rel="nofollow">https://bitbucket.org/quiark/hsc</a><p>The whole purpose of that mental gymnastics was to learn x86 assembly while practicing my Haskell ;)