-
Notifications
You must be signed in to change notification settings - Fork 2
Why we take so cryptic and low level language?
Forth has a big advantage as a model to look into dynamic software systems implementation. Its language model (virtual machine) is extra simple as it can ever be:
- stack as an operational memory area, which holds intermediate computational results, and
- vocabulary carries both long-time living data, and executable elements able to do data transformations.
Next, as a language, it factically has no-syntax. To do command and source code parsing, we need only lexer able to group nonspace characters as (word) names and detect few special literal forms like numbers, strings, and URLs.
Any programmer can easily implement such a lexer not only
- using parser generator, as we do here with PEGs, but just
- use hand-coded state machine automata, or
- select first non-space characters group by string functions and then check literal forms by regexes available in most modern languages.
Executable data is represented as a linear sequence formed from a limited set of executable primitives, and other sequenced defined beforehand recursively.
Intermediate data are passed globally between executable sequences thru shared stack, so we can use the concatenative programming approach by defining more and more complex executable elements using such elements defined beforehand.