This project is a minimal Interpreter for Forth programming language
First you have to make sure you have git, gcc and make install on your machine then you can clone this project:
git clone https://github.com/alimoghaddam2000/Forth
after cloning you must install sdl2 and ncurses. if you are in ubuntu22 you have to run following command otherwise you should lookup how to install libsdl2 on your specific OS in google.
sudo apt-get install libsdl2-2.0-0 libsdl2-dev libncursesw5-dev
then you could easily build the project by running:
make
and for executing the program you run ./Forth.out
on your terminal
For an example you can copy and paste content on snake.txt on your terminal and enjoy playing the snake game.
- do, loop, +loop, begin, until, i, i', j
- -, +, *, /, %, mod
- if, else, then, =, <, >, and, or, invert
- variable, constant, allot, @
- dup, drop, swap, over, rot,
- key, last-key - emit, cr, ."
- Sleep, random - (, )
- Stack underflow
- Stack overflow
- Division by zero
- Unknown word
- Unknown variable
- Using reserved name
- Adding syntax highlighting.
- Adding auto completion
if you want to cooperate to this open source project feel free to push your commit and reach me through my email: [email protected]