Skip to content

Latest commit

 

History

History

tutorial

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

X-Forth Tutorial

Follow along with the development of a Python implementation of X-Forth. Each lesson builds incrementally on the last in manageable steps.

X-Forth.py

The file x-forth.py represents the latest tutorial completed and thus the most feature complete version of the python implementaiton.

Tutorial Index

X-B (basic)

  • 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

X-1 (External/Variable Source Code)

  • 6 - X-1 allows us to read source code from external files

X-2 (Symbols)

  • 7 - Implement Symbols which are a building block for many other extensions

X-3 (Bools)

  • 8 - Implement the boolean literals True and False

X-4 (Variables)

  • 9 - Implement variables and constants to read and write from memory locations referred to by name
  • 10 - Implement ! and @ to read and write

X-5 (String Support)

  • 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

X-6 (Include) - X-6.B (Mid Interpretation Includes)

  • 15 - Implement including other x-forth files