No description
- Rust 97.3%
- Makefile 2.7%
| examples | ||
| src | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| Makefile | ||
| README.md | ||
nyl
An interpreted stack language.
Operators
| Operator | Stack | Effect |
|---|---|---|
| ADD | a b -- a+b | |
| DUP | a -- a a | |
| MUL | a b -- a*b | |
| SUB | a b -- a-b | |
| DIV | a b -- a/b | |
| OUT | a -- | prints the unicode code point |
| EXIT | a -- | exits with the exit code |
| DEF | starts a macro definition | |
| END | ends a macro definition | |
| EQU | a b -- | if a == b, the next word is evaluated, otherwise it is skipped |
| JMP | | a -- | jumps to the position on the return stack |
Labels
A word starting with @ defines a label. A word starting with !
will jump execution to that label. A word starting with % will jump
execution to that label and and push the current postion onto the
return stack.
Macros
Macros are ways to define words that expand to a set of instructions.
For example:
DEF square DUP MUL END
6 square
During the macro expansion phase 6 square will be replaced with
6 DUP MUL.
TODO
Stack
- swp
- pop
Logic
- neq
Data
- heap (a bigger place for accessing data by address)