3 ms·
True! I don't think that's what happening, though. At a quick glance, the primitive words seem to be directly implemented in C: https://github.com/eliben/gofor
by anyfoo 1y ago
True!
I don't think that's what happening, though. At a quick glance, the primitive words seem to be directly implemented in C: https://github.com/eliben/goforth/blob/3949fe0cc52131fdcae0e38ac5f6aee596056d3b/ctil/builtins.c#L106 https://github.com/eliben/goforth/blob/3949fe0cc52131fdcae0e...
So it looks like this one kind of sits in between. It has primitive words implemented in C, but a dictionary accessible by Forth. The interpreter loop however seems to be implemented in C as well, not Forth.
- johnecheck 1y agoI remember when I realized just how little host language code was needed to bootstrap a Forth. Before that I was making the same mistake. OP, I strongly recommend the book Threaded Interpreted Languages [1]. I had to read chapter 2 several times before it clicked (short and dense), but it's an excellent resource. [1] https://archive.org/details/R.G.LoeligerThreadedInterpretiveLanguagesTheirDesignAndImplementationByteBooks1981 https://archive.org/details/R.G.LoeligerThreadedInterpretive...