Forth, written in Python 3
In Python 4th, the "Hello, World" program can be written in two words:
Hello,\ World! ?
No, I did not count wrong.
Hello,\ World!
is one word;
here's
why.
[One] thing we want out of our languages is simplicity... of syntax. Think of a language like Forth. [Robert "Uncle Bob" Martin; emphasis added]
very small [programs allow] the [end-user] to use their visual field as an augmentation to their short term memory, and that is the critical thing in end-user programming. [Alan Kay; emphasis added]
The goals of Python Forth include:
- actual freedom,
- low barrier to entry,
- extreme simplicity
Why write Forth in Python 3?
Ariadne IIb, released for July "Forth" 2020 [Doc] [Code]
Ariadne IIa (Pre-release) of July "Forth" 2020 edition; accompanies "Why can't Python deepcopy stdin?"
See the example at the top of the source code.
Ariadne IIa is barely tested. The basic operations like DUP
, DROP
, and OVER
seem to work, as do the two compilers (:;
and the tripple :
, `, ;
).
A lot of essential features are yet to be incorporated (one development goal was to get the compiler working as soon as possible).
I draw inspiration chiefly from Charles H. "Chuck" Moore (Forth's inventor), Leo Brodie (author of Thinking Forth and other texts), and Charles-Hanson Ting (creator of several Forth implementations and author of eForth and Zen and other texts).