Mottek: 2016-03-20

The thumbulator

I now pushed the thumbulator branch as the new master branch for CoreForth. The idea behind thumbulator is to have just enough of a host based virtual environment to compile Forth source, and dump the resulting binary which can then be flashed. The .elf file is therefore now just an intermediate file, it could be flashed, but contains only the core part. However, if thumbulator fails to run or produce a binary, it will silently still create a garbage binary, which won't flash properly. I guess I need to make that part more robust :)

When writing CoreForth, I got quite far with the assembly based pseudo code approach, but at some point, I wanted to switch to high level code. Metacompilation is probably the right approach but I felt it would require a rewrite of the whole system. Same with a tethered Forth. I also was using qemu for experimenting without hardware, and the 1.0 branch of CoreForth was just converting the Forth byte code into assembly sources for later compilation via an assembler.

qemu seemed a bit heavy though, and with thumbulator I found a lightweight way to have a host based environment to produce a target binary. This works as long as there are no fancy hardware dependencies at compile time, but usually, there aren't any ;) And if something is desperately needed, it is pretty easy to extend thumbulator.