larsbrinkhoff / lbForth

Self-hosting metacompiled Forth, bootstrapping from a few lines of C; targets Linux, Windows, ARM, RISC-V, 68000, PDP-11, asm.js.
GNU General Public License v3.0
418 stars 112 forks source link

Switching search order between interpretation and compilation #13

Open larsbrinkhoff opened 10 years ago

larsbrinkhoff commented 10 years ago

The search order is different in interpretation state and compilation state. When interpreting, only forth is searched, but when compiling there's an implicit also compiler-words. This is currently done in a buggy and nongeneral way.

The solution might also consider metacompilation. Inside the metacompiler in interpretation state, the search order is host-interpreter, meta-interpreter, forth. In compilation state, the search order is host-compiler, meta-interpreter, forth.

When metacompiling in interpretation state, the search order is: meta-interpreter, forth. When metacompiling in compilation state, the search order is: meta-compiler, then target dictionary.