Remix.run Logo
bertili 2 days ago

Another thread on small forth interpreters from just 15 days ago:

https://news.ycombinator.com/item?id=45039301

Forth can be beautifully and efficiently implemented in portable c++ using the using continuation passing style via the clang musttail attribute.

Have a look at Tails (not my project):

[1] https://github.com/snej/tails

acidx 2 days ago | parent [-]

I recently wrote one, in C, using tail calls to implement dispatch with CPS: https://tia.mat.br/posts/2025/08/30/forth-haiku.html

It's already pretty efficient but I'm working on it to make it even more efficient so I can use it as some sort of primitive fragment shader for an art project. This Forth variant is intended to execute Forth Haikus, as defined by the Forth Salon website.