Forth like interpreter

Darrell darrell at dorb.com
Sat Mar 11 23:32:53 EST 2000


Wrote a Forth like interpreter in Python.
Probably useless but it gave me something to do today.
http://www.dorb.com/darrell/forth/forth.py

Kragen Sitaker mentioned in "What if Python Replaced Elisp" that Forth
compilers were easy. He's right!

I only did one branching instruction "if" and an assortment of other words.

The compile phase could generate Python byte code or for real crazies
assembler. Real Forth often comes with an assembler built in. So I can see
how some version of Lisp might compile to assembler.

--Darrell








More information about the Python-list mailing list