Skip to content

eigenhombre/abaft

Repository files navigation

abaft

build

This is a work in progress leading towards a simple Forth interpreter, written in C, somewhat following along the lines of this discussion on Hacker News.

$ make
cc    -std=c17 -Wall -Werror -fsanitize=address -Iinclude -o abaft src/forth.c src/stack.c src/main.c src/parse.c src/cfunc.c

$ ./abaft -e examples.fs
Sally Forth. Elbert Abaft.
> 1 2 + .
3
> 5 6 * 19 20 + * .
1170
> 1 3 - .
-2
> 10 10 dup * .
100
> 99 100 drop .
99
>
> 88 99 . .
99
88
> 88 99 swap . .
88
99
> 88 99 over . . .
88
99
88
>
> 1 2 3 . . .
3
2
1
> 1 2 3 rot . . .
1
3
2
>
> : square dup * ;
Entering compile mode
Name of new word is 'square'
Leaving compile mode

About

Simple Forth interpreter in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published