Hasty Briefsbeta

Bilingual

Implementing a Forth

a year ago
  • #Forth
  • #Programming
  • #Language Implementation
  • The author shares their experience with implementing Forth, emphasizing the learning opportunities it provides about concatenative programming and computer operations.
  • Three approaches to implementing Forth are suggested: porting an existing Forth (like JONESFORTH), creating an ultra-tiny Forth core (examples include PlanckForth, SmithForth, sectorforth, milliForth, StoneKnifeForth, and a 'Three Instruction' Forth), and designing a Forth around a tiny target program (like Meow5 and Snobol4th).
  • Porting existing Forth implementations is highlighted as a valuable learning method, with the author's own experience porting JONESFORTH to NASM as an example.
  • The concept of minimal Forth cores is explored, discussing how few words are needed to bootstrap the rest of the language, with examples of extremely compact Forth implementations.
  • The idea of targeting a specific program to guide Forth implementation is presented, with examples like Meow5 and a SNOBOL4-based Forth that runs a '99 Bottles of Beer' program.
  • Resources for aspiring Forth implementers are recommended, including JonesForth source, Brad Rodriguez's Moving Forth series, and the book Threaded Interpretive Languages by R.G. Loeliger.