Inspired by Lispkit, build your own Forth from scratch.
- Write an interpreter (in Python). Similar to Chuck Moore's first punch card interpreter.
- Play with it!
- Write a console Pixel library (in Forth) using Unicode Braille characters
- Use this to do turtle graphics (in Forth)!
- Make register-based "hardware" (VM in C) and assembler (in Forth)
- Use the assembler to build a kernel (a bytecode image using Forth)
- Abandon the Python interpreter and bootstrap Forth to the new "hardware"
- Port pixel library to this
- Port turtle graphics to this (using fixed point)
- Port kernel itself to this
- Achieve meta-circularity! That is, build the kernel using Python, then use that kernel to build a new (identical for now) kernel. Iterate.
- TODO: re-write kernel in more natural Forth syntax
- TODO: Fill out the vocabulary to support the standard core words
- TODO: Build an inner interpreter and take away
call
/ret
from the "hardware"- TODO: Experiment with direct/indirect threading
- TODO: Experiment with using the return stack for locals and loop counters
- TODO: Implement remaining Forth control structures
- TODO: Explain
does>
in the context of direct/indirect threading - TODO: Discuss/implement token threading
- TODO: Discuss separate headers (e.g. fall-through definitions, save memory, ...)
- TODO: Discuss separate host/target (like Brief)
- TODO: Make more new "hardware" - a stack machine this time
- TODO: Port our Forth to this - see how the inner interpreter goes away
- TODO: Use block-style disk I/O
- TODO: Move to a colorForth style variant (less syntax, no immediate words, etc.)
- TODO: Build a block editor and stop using Vim
- TODO: We've now bootstrapped a whole "OS" for ourselves!
- TODO: Discuss non-standard ideas:
- Quotations (
[:
...:]
), combinators, (Factor, Joy, Brief, ...) if
as a combinator- Recursion as only control flow
- Quotations (
- TODO: Discuss other execution models (e.g. stack/continuation, XY, Brief, ...)
- TODO: More ideas
- VT100 library
- Snake game
- Tetris game
- Discuss optimizing compilation