3 ms·
- simple language - close to the CPU - architecture independent These 3 aspects are insanely hard to combine effectively. Also is Forth 'close to the CPU'?
by eterps 3y ago
- simple language
- 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.
- alexisread 3y agoYes, its used to bring up new hardware as its easy to write drivers for (See Open Firmware). If you look at https://github.com/dan4thewin/FreeForth2/blob/master/ff.asm https://github.com/dan4thewin/FreeForth2/blob/master/ff.asm 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.
- sph 3y agoI don't think that's insanely hard. If you squint hard enough, WASM has those 3 things as a goal, and it is conceptually much easier than developing a regular, general purpose language, say Rust. 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.