Skip to content

Instantly share code, notes, and snippets.

@justinmeiners
Last active February 11, 2022 15:09
Show Gist options
  • Save justinmeiners/53699d91e9aad78c6a93013bf53e8cab to your computer and use it in GitHub Desktop.
Save justinmeiners/53699d91e9aad78c6a93013bf53e8cab to your computer and use it in GitHub Desktop.
Notes on the Forth programming language.

Learn the Language

About Forth

Forth Related Sites

Implementing Forth

The outer interpreter is (very roughly):

skip spaces
read token up to next space
search dictionary for token
if found
    if interpreting or word is immediate
        execute word
    else
        compile word
else if token is number
    if interpreting
        push number on stack
    else
        compile number as literal
else
    abort

https://www.reddit.com/r/Forth/comments/229sl5/i_want_to_write_my_own_forth_interpreter_where_do/

Examples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment