3 ms·
A bit back I wrote a Forth interpreter that's a single file containing shell (a tiny bit), awk, C, and (a limited dialect of) Forth. https://github.com/EtchedP
by david-given 10y ago
A bit back I wrote a Forth interpreter that's a single file containing shell (a tiny bit), awk, C, and (a limited dialect of) Forth.
https://github.com/EtchedPixels/FUZIX/blob/master/Applications/util/fforth.c https://github.com/EtchedPixels/FUZIX/blob/master/Applicatio...
The awk byte-compiles the initial Forth dictionary into the C file; if you edit the C file, you then run it (as a shell script) and it updates the byte-compiled word definitions. Then you can compile it as a standalone C program.
Amazingly, this was actually the simplest way to solve the problem...