Difference between revisions of "Self-Extension"

From bootstrapping
Jump to navigation Jump to search
(Created page with "== Self-Extension == 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''. Th...")
 
Line 7: Line 7:
 
Examples of ''Self-Extension'':
 
Examples of ''Self-Extension'':
 
* forth immediate words: adds new syntax to forth.
 
* forth immediate words: adds new syntax to forth.
 +
* forth words implemented in assembly: e.g. in stone knife forth <code>: compile-minus 41 . 4 . 36 . 88 . ; ( `sub %eax, [%esp]; pop %eax` )</code>
 
* lisp macro definitions: allows you to add new language constructs to lisp.
 
* 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).
 
* 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?
 
any more?

Revision as of 12:48, 25 December 2017

Self-Extension

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 spares 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?