3 ms·
Now that I think about it, the grammar is entirely regular, yes?
by shadowofneptune 5y ago
Now that I think about it, the grammar is entirely regular, yes?
- Someone 5y agoI’m not sure Forth has a grammar in the traditional sense. I think any grammar needs to cover immediate words because you cannot ignore CREATE… DOES>. Those can do anything, so how do you handle them? There’s also BASE (the current number conversion radix). It makes parsing integers context-dependent.
- codr7 5y agoIt's just a stream of tokens, which are either literals or identifiers; it's the only language I know that has less syntax than Lisp.
- vitiral 5y agoAnd "tokens" are literally "any string of non whitespace characters." One of it's biggest downfalls imo is that the toeknizer is too simple. I'm making GitHub.com/civboot/fngi as a "better than forth".
- codr7 5y agoOh, I've been down that rabbit hole for a long, long time :) It makes a nice foundation for syntactic experiments. https://github.com/codr7/gfoo https://github.com/codr7/gfoo https://github.com/codr7/forthy2 https://github.com/codr7/forthy2