Interesting find...
I just ran across Dybvig’s PhD Thesis ( http://agl.cs.unm.edu/~williams/cs491/three-imp.pdf ). In the appendix he shows some interesting comparisons between heap-based and stack-based implementations for a Lisp-like language (Scheme).I have constructed many different versions of machines and architectures in the past. But over the past decade or so I have increasingly forced myself to live within the confines of Common Lisp. And in doing so, I have repeatedly run into barriers when trying to implement faithful Lisp versions of things like Reppy’s CML Channels, and Continuation Passing Style (CSP) compilers, and even the Butterfly (Erlang in Lisp) system. Invariably, these all have to resort to one major THROW to achieve similar (not identical) behavior in stack-based Common Lisp.
This has been a source of frustration, to some small degree, and I have often toyed with the idea of implementing another compiler targeting heap-based (spaghetti stacks) architecture using Common Lisp - something more akin to the description of the Smalltalk-80 implementation.
The Dybvig thesis shows just how costly that pining for perfection becomes…
- DM