Thanks for the suggestions. I'll go through them.
Why would the fpc.exe be 3 MB? On my PC it's only 131 kB. Symbols?
I want to try and make an "interactive" microcontroller, so I can have a dashboard and change functions while it is running. It isn't meant as a replacement for a PC, like a Raspberry Pi, (all communication through USB / Ethernet), but as an interactive way to build your circuit.
The most common MCU's have 64 kB of Flash and 20 kB of RAM. That's not much. The largest practical MCU's are like this:
https://uk.farnell.com/stmicroelectronics/nucleo-l432kc/dev-board-nucleo-32/dp/2580786. It has 256 kB of Flash and 64 kB of RAM.
There are ARM MCU's with 2 MB Flash and 1 MB RAM on-board, but they are around 4 cm
2 in size and have 100+ pins, so they're hard to fit on a bread-board. Adding external Flash and RAM just to get the compiler running would be counter-productive and make it reasonably expensive.
My options for programming would be:
1. External compiler. Possible, but not interactive enough. A dashboard is like a debugger running on the device.
2. Assembler. Doable, but too low-level.
3. Interpreter: Slow but doable. But Pascal, no Basic or whatever. It would mess up your timing and be unusable for handling interrupts. Meh.
4. Tiny compiler, with the code split in units / objects and interactive debugging. Actually, something like Turbo Pascal 1.0 would work.
Optimally, the program is stored in P-code, for example like a ZX_Spectrum did it. It might be interesting to see if I could make a parse tree editor. And units / objects are loaded and linked in memory on demand. Objects would simplify memory management as well. Ok, that's a lot of work. But with a lot of re-use probably doable.