Self-Extension
Self-Extension[edit]
To get good bootstrap leverage it's useful when a language implementation provides more than it uses. One technique to do this is Self-Extension.
The PL can implement only very sparse functionality, including a way to add to itself. Then a bunch of new features can be loaded on boot.
Examples of Self-Extension:
- forth immediate words: adds new syntax to forth.
- forth words implemented in assembly: e.g. in stone knife forth
: compile-minus 41 . 4 . 36 . 88 . ; ( `sub %eax, [%esp]; pop %eax` )
- lisp macro definitions: allows you to add new language constructs to lisp.
- lisp reader: implement only a basic reader in the core, use it to read in and make use of a much more comprehensive lisp reader from then on (MES does this).
any more?