3 ms·
Here's a comment from a few years ago where I go over how do make a FORTH-like language starting from a simple basic RPN calculator in C [1] and then adding pro
by tzs 6y ago
Here's a comment from a few years ago where I go over how do make a FORTH-like language starting from a simple basic RPN calculator in C [1] and then adding programmability (mostly implemented in the language itself with only a little bit of C support), and finishing with some ways you could optimize it to actually get decent performance.
This would be reasonable afternoon project (except for the optimization stuff).
None of the C code is complex or tricky or big. You could easily do it in assembly instead. That's why these kind of languages are great for a lot of embedded applications. You only need to write a small assembly core to support your language, plus assembly function to support your hardware, and then you can do everything else in your higher level FORTH-like language.
[1] https://news.ycombinator.com/item?id=13082825 https://news.ycombinator.com/item?id=13082825
- stevekemp 6y agoI hacked up a quick implementation of your writeup in go just now, as I said at the time your summary was wonderfully direct and "obvious". https://github.com/skx/foth https://github.com/skx/foth Thanks again, four years later! I'll get the compilation phase done tomorrow, barring surprises.