Follow along with the development of a Python implementation of X-Forth. Each lesson builds incrementally on the last in manageable steps.
The file x-forth.py represents the latest tutorial completed and thus the most feature complete version of the python implementaiton.
- 1 - A simple tokenizer with hardcoded Forth source
- 2 - A simple interpreter that can push numbers to the stack and display the stack contents
- 3 - Adding math operators to the interpreter
- 4 - Adding logic operators to the interpreter
- 5 - Finish X-B by Adding some basic stack manipulation and display words
- 6 - X-1 allows us to read source code from external files
- 7 - Implement Symbols which are a building block for many other extensions
- 8 - Implement the boolean literals
True
andFalse
- 9 - Implement variables and constants to read and write from memory locations referred to by name
- 10 - Implement
!
and@
to read and write
- 11 - Beginning string support. First we'll modify the tokenizer to tokenize strings as a single token
- 12 - Add the string type and modify the interpreter to recognize and evalute string tokens by pushing them to the stack
- 13 - Add some words to work with strings
- 14 - Finish by allowing escape sequences in strings
- 15 - Implement including other x-forth files