SkillAgentSearch skills...

Forthkit

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

Install / Use

/learn @AshleyF/Forthkit
About this skill

Quality Score

0/100

Supported Platforms

Universal

Tags

README

Forthkit

Inspired by Lispkit, build your own Forth from scratch.

  1. Learn what Forth is by building a pixel library and turtle graphics in gforth
  2. Make register-based "hardware" (VM in Forth) and assembler
  3. Use the assembler to build a kernel (and boot image)
  4. Rewrite the VM in C and abandon gforth
  5. TODO: Bootstrap the rest of the language
    • TODO: Port pixel library
    • TODO: Port turtle graphics (using fixed point)
    • TODO: Port kernel itself
    • TODO: Achieve meta-circularity! That is, build the kernel using gforth, then use that kernel to build a new (identical for now) kernel. Iterate.
    • TODO: Re-write kernel in more natural Forth syntax
  6. TODO: Build an inner interpreter and replace calls
    • 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
View on GitHub
GitHub Stars41
CategoryDevelopment
Updated3mo ago
Forks4

Languages

Forth

Security Score

87/100

Audited on Jan 5, 2026

No findings