Going Forth

Well. It turns out that writing microcontroller code in Python is too slow for driving a bus (who would have thought?), there's no C runtime for small embedded systems that does a reasonable job of cooperative multitasking, even a trivial C program pulls in far more dead code than you could shake a stick at, C's error handling is ugly as hell, it's bloody difficult to figure out what an embedded program is doing if you don't have a JTAG debugger (good luck connecting that through an in-house bus), there's no possibility of crash recovery … and I ended up doing anything but get some progress on the actual MoaT bus device things done.

Oh yes, I also discovered that it's basically impossible to connect one-strand wires to a circuit board in a way that allows the board to be removed. So I had to re-design that. To be announced shortly.

Back to coding, but onwards to a workable solution instead of ranting.

The solution turns out to be a 50-year-old programming language. FORTH. For which you can write a compiling, register-optimizing interpreter (no, a compiling interpreter is not a contradiction) in less than 20k of Flash storage.

See MoaT Forth <https://github.com/M-o-a-T/forth.git for the repository where our Forth code lives. Or rather, is going to live. Eventually. As soon as the groundwork is done, because we need some operating-system-ish things (which are much easier to write in Forth) as groundwork.

Some basic stuff is already done, like multitasking and buffers. Some of it still needs doing, like timers and stuff. Then we can think about implementing support for our bus wires.

Eventually.

Kommentare

Comments powered by Disqus