Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toyforth

A toy Forth interpreter written in C, inspired by Salvatore Sanfilippo's "Learn C" YouTube series.

Building

make

This compiles main.c with GCC and produces the toyforth executable.

Usage

./toyforth <filename>
./toyforth -d <filename>  # debug mode

Examples

Create a file with Forth code and run it:

# nums.ft - basic arithmetic
10 20 + 1 +
$ ./toyforth nums.ft
[10,20,+,1,+]
Stack context at end:
[31]

Currently supported operations: +, -, *, /, %

Reference

To experiment with a full Forth implementation, you can run gforth via Docker:

docker run -it --rm forthy42/gforth

License

Apache 2.0

About

toy FORTH

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages