No description
  • Rust 97.3%
  • Makefile 2.7%
Find a file
2026-05-17 22:35:09 -04:00
examples I mean, it's skipped code, but let it be valid 2026-05-17 22:35:09 -04:00
src Jump to and back from a label 2026-05-17 10:35:10 -04:00
.gitignore The very beginning 2026-05-13 11:24:28 -04:00
Cargo.lock The very beginning 2026-05-13 11:24:28 -04:00
Cargo.toml The very beginning 2026-05-13 11:24:28 -04:00
Makefile Makefile 2026-05-15 00:14:52 -04:00
README.md Jump to and back from a label 2026-05-17 10:35:10 -04:00

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)