2 comments

[ 4.2 ms ] story [ 13.8 ms ] thread
I was inspired by the recent Forth-week on HN to dig up a minimal Forth that I created a while back. It is so minimal that it only runs one statically declared Forth program but that also makes it really easy to understand how little there is to a Forth interpreter and how they work.

As simple as this one is, this interpreter implements a handful of stack manipulation Words and fully supports DO/LOOP looping and IF/ELSE/THEN branching as well as VARIABLE, CONSTANT, and ALLOT style arrays. Forth is a really simple yet powerful concept. This one strives for clarity of understand over pure efficiency and is written in C.

Super clean code. Really good to see a classic implementation like this, and I happen to be partial to implementations in C myself