
Reflections on Stacking Stacks - foldU
http://justinjaffray.com/blog/posts/2018-03-13-stacks/
======
triska
Very nice reflection on an important and enjoyable topic! Regarding the
question at the end about "a more general term for this kind of 'passing
through' of functionality":

At least in the context of Prolog meta-interpreters, implicitly using features
of the host language is called _absorption_ , and reimplementing Prolog
features _within_ Prolog is called _reification_.

The term _reification_ is also used (in the same sense) in other languages.
For example, you can think of your first example as _reifying_ the call stack
that the second version builds implicitly.

In fact, reifying the call stack is a well-known technique in compiler design
and garbage collection, because you need less space to store, say, N _target
addresses_ than N _stack frames_. Andrew Appel's compiler book mentions this
technique, for example.

For absorption to be applicable, you need first and foremost a host language
that provides some useful implicit features. In Prolog, unification and
backtracking are notable examples that are also especially easy to "pass
through" to the object level. A different example would be the _operand stack_
in stack-based languages like PostScript. If your language has no or only very
few implicit features, then there is only little to pass through in the first
place.

~~~
foldU
Thank you for the nice comment, and for the lovely post on Prolog meta-
interpreters that I linked here :) It seems I missed the part where you
explicitly called out absorption and reification there! One of my reviewers
actually suggested "elision" as well as reification after I had published the
post, which seems quite similar.

And thanks for the info! I would love to learn more about compiler design and
garbage collection in the future. Still working my way through some other
reading materials but certainly something I would like to get to more!

