- close to the CPU
- architecture independent
These 3 aspects are insanely hard to combine effectively.
Also is Forth 'close to the CPU'? It definitely is low-level.
- close to the CPU
- architecture independent
These 3 aspects are insanely hard to combine effectively.
Also is Forth 'close to the CPU'? It definitely is low-level.
If you want to focus on performance as well (as WASM does), well, then it becomes really challenging to find a middle ground that works on IA64 and a 6502 chip.
So I guess what I am looking for is WASM with less focus on performance and more on portability. Forth might be half a layer above the CPU, but is insanely portable and/or simple to implement from scratch, which is why I mentioned it.
You can see that the x86 registers are used to avoid SWAP instructions via register renaming. That's a sufficiently low level technique to qualify.
The thing with Forth for me, is a lack of typing - you need to keep a model of the stack in your head at all times. It should be possible to build that in to a Forth compiler but I've yet to finish a prototype.