Re:A Path to Enlightenment in Programming Language Theory
by jules on Monday June 22, 2015 @05:52PM
(#9761467)
You can also implement an interpreter in Haskell/ML without using closures to implement closures. It would still be a lot less painful than C.
[ Parent
| on HN ]
Re:A Path to Enlightenment in Programming Language Theory
by Silhouette on Monday June 22, 2015 @06:07PM
(#9761524)
Of course. But it's still reasonable to ask how you'd write a compiler that implements such features in a free-standing way, without depending on either the built-in tools of the language you're writing an interpreter in or a black box run-time environment/VM that does all the tricky stuff for you by magic. With a relatively low-level language like C, you don't have any choice but to confront such issues head-on, while many tutorials manage to side-step them using higher-level languages. Of course it's easier to write almost anything in a suitable higher-level language, but for educational purposes that isn't really the point IMHO.