Hacker News new | ask | show | jobs
by jmaa 2876 days ago
> Excited to see that finally someone has written an imperative language in a functional runtime. Normally it's the other way around - countless Lisp implementations running in C, because those are trivial to write.

This is not as hard as one might imagine; the first assignment for a compiler course I took, was to write a interpreter for a simple imperative language, running in SML, a mostly functional language. The rest of the course was to write a compiler for another imperative language, again in SML. As soon as you know the "tricks" (some might call them patterns, if we were talking OOP), writing imperative code in functional languages is relatively easy.

The course followed "Modern Compiler Implementation in ML", if anyone is interested.