Re:Show HN: PlanckForth – Bootstrapping an interpreter from ...
by pmarreck on Monday December 06, 2021 @09:04AM
(#29459831)
Does the "metacircular" part just mean that the compiler can use definitions it's already compiled in the current pass?
[ Parent
| on HN ]
Re:Show HN: PlanckForth – Bootstrapping an interpreter from ...
by vanderZwan on Monday December 06, 2021 @11:02AM
(#29461352)
No, it more or less means that a language is described in (part of) the language itself. And before you ask, no, it's not quite the same as self-hosting (good question though). The latter is more associated with compilers that can take a source file and produce another compiler. The former is often more like an interpreter that provides support for part of a language, but those part are enough to define support for the rest of the language.
So in this case, the base implementation starts with support for only a subset of the Forth language, picked for being either essential or much more performant when implemented "natively" in the binary. A subset of this subset is then used to construct support for the rest of the language. This is very typical for Forth- and Lisp-like languages.
Re:Show HN: PlanckForth – Bootstrapping an interpreter from ...
by qgc on Wednesday December 08, 2021 @05:38AM
(#29483173)
It would be more accurate to describe a metacompiler as a cross compiler to the machine an interpreted Forth is implemented on.
I recommend Moving Forth [1] for the full explanation. (That's the part that addresses metacompliers, the rest is still quite a great book.)