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

Metacompiler overhaul #38

Open larsbrinkhoff opened 7 years ago

larsbrinkhoff commented 7 years ago

The metacompiler is due for an overhaul.

pipcet commented 7 years ago

The asm.js target essentially has separate code and data spaces; it gets around the single memory space limitation by compiling to the data space and emitting code directly. The wasm target also has separate code and data spaces, and makes two passes over the nucleus, one for the code and one for the data (it would require a third pass to actually just count the number of defined words, but right now that's hardcoded). So these two targets would benefit a lot from this improvement.

gas has sections and numbered subsections within those. That's sufficient for WebAssembly, while simple sections might not be.

larsbrinkhoff commented 7 years ago