Skip to content

timbarnes/f2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A tiny Forth in Rust and Forth, based on eForth

This implementation attempts to create a reasonable minimum system in Rust, with as much as possible implemented in Forth.

For convenience rather than efficiency, the data store is an array[i64], and it uses indirect threading. Builtin functions are made visible in the data space, which also contains:

  • The text input buffer TIB
  • The text working buffer PAD
  • A second text buffer TMP
  • A general area for use by ALLOT
  • The Forth calculation STACK
  • The return stack RET
  • WORD, VARIABLE, and CONSTANT storage

Despite being written in Rust, this program can crash from bad memory accesses, because Forth allows any value to be used as a memory address. It would be possible to check every reference before accessing it, but this is not always done in Forth engines, which are quick to restart.

Additional documentation is available in doc.md.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published