Skip to content

Inspired by Lispkit Lisp, this is a series of DIY Forths

License

Notifications You must be signed in to change notification settings

AshleyF/Forthkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Forthkit

Inspired by Lispkit, build your own Forth from scratch.

  1. Write an interpreter (in Python). Similar to Chuck Moore's first punch card interpreter.
  2. Play with it!
  3. Make register-based "hardware" (VM in C) and assembler (in Forth)
  4. Use the assembler to build a kernel (a bytecode image using Forth)
  5. Abandon the Python interpreter and bootstrap Forth to the new "hardware"
  6. 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)
  7. TODO: Make more new "hardware" - a stack machine this time
  8. TODO: Port our Forth to this - see how the inner interpreter goes away
    • TODO: Use block-style disk I/O
  9. TODO: Move to a colorForth style variant (less syntax, no immediate words, etc.)
  10. TODO: Build a block editor and stop using Vim
    • TODO: We've now bootstrapped a whole "OS" for ourselves!
  11. TODO: Discuss non-standard ideas:
    • Quotations ([: ... :]), combinators, (Factor, Joy, Brief, ...)
    • if as a combinator
    • Recursion as only control flow
  12. TODO: Discuss other execution models (e.g. stack/continuation, XY, Brief, ...)
  13. TODO: More ideas
    • VT100 library
    • Snake game
    • Tetris game
    • Discuss optimizing compilation

About

Inspired by Lispkit Lisp, this is a series of DIY Forths

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published