Aby programatori neostali naprazdno tak prinasam linku
na programovaci jazyk FORTH.
SCREENSHOT:
DOWNLOAD:
https://github.com/ehaliewicz/megaforthSOURCE:
https://github.com/ehaliewicz/megaforth ... /forth.binOVLADANIE:
Controls (6-button isn't required but definitely helps):
A - Set character at cursor to A
B - Delete character in front of cursor
C - Insert space at cursor
X - show possible words based on prefix starting where the cursor is pointing (shows one suggestion per button press)
Y - enable on-screen keyboard
Z - hold to allow left-right movement in keyboard mode.
Mode - Starts or completes word definitions by inserting ";" or ":" based on state. This is done on a line-by-line basis, it doesn't keep track of the state of the interpreter. Don't use with multi-line definitions.
Start - send line to interpreter
Features:
- Basic forth dictionary (stack manipulation, arithmetic, memory manipulation, basic text i/o)
- Subroutine-threaded compiler (compiles words as lists of JSRs to other words)
- C interop via CCALL0/1/2/3 words, binary includes SGDK libraries. Push args in left-to-right order with the function's address last. C function addresses have to be hardcoded, it has no way of discovering them at runtime.
- Supports compiling included forth text at start up.
Currently known issues:
- Probably several word-related bugs. Expect division related words to fail.
- "." (general number printing) is buggy for larger numbers.
- Weird issue with deleting and inserting near the beginning of input line.
- Prefix suggestions overwrite rather than insert text
- Clearing keyboard on hardware doesn't work
Future Ideas (in order of likeliness to implement):
- Fix bugs
- Implement more compiler words (for IF/ELSE, variables, etc.)
- Implement optimizer (for inlining short words, compiling BSRs rather than JSRs, tail-call optimization, etc)
- Some way of calling arbitrary C routines at runtime? We'd need to keep track of a symbol table, I guess.
- Task switching for lightweight cooperative multitasking
- Some way to develop on PCs and send code over serial to compile
- Cool logo on startup
- Open to other suggestions