Re:Show HN: 3D shooter in your terminal using raycasting in Awk
by david-given on Thursday January 14, 2016 @06:04PM
(#10905501)
Yup! COM() is a varargs macro that actually assembles the data in memory --- the actual word layout is not the traditional one Forth uses (to make it C friendly). But the end result is a linked list of Forth words in exactly the same format that user words have, which the user dictionary extends.
It all means that the C source can just be compiled in a single step --- gcc -o fforth fforth.c --- without needing a precompilation stage, which makes it vastly easier to manage.
It's even portable!
So the embedded FORTH compiler written in AWK reads the FORTH code in a comment like this:
and compiles it into C code like this (reformatted here to help illustrate):