a stack-based programming language i am working on
- turing complete implemented rule110
- Interoperability with other languages
- functions (or something resembling them)
macros were implementfunctions have been implemented
"Hello, World" . // string printing
69 . // int printing
0xFF . // hex printing (also supports binary and octal)
-69 . // int printing
-0.69 . // float printing
1 2 3 stack pop pop pop // prints the stack
-5 5 + .
6 1 - .
2 10 * .
10 5 / .
5 10 < .
5 10 > .
5 5 = .
1 0 > if "yes" else "no" done . // if 1 > 0
69 if "non zero" else "it is zero" done . // if 69 != 0
0 while dup < 100 do dup . 1 + end
int3 "waited for you" . // halt program execution until user presseed enter
69 dup . .
1 2 3 2 swap . . // this swaps the top element with the 2th one aka 3 and 2 respectively in this case
1 pop // deleted the top of the stack aka the 1 in this example
10 2 mems // stores 10 in memory no 2
2 meml . // loads the value in memory no 2 and prints it
fn test1_ // start of a macro names test1_
69 dup .
351 + .
fend // end of the macro
jmp test1_ // calling the macro
foo.stg
fn something
"foo" .
fend
main.stg
load "foo"
jmp something
first install odin
then
./build.sh debug
./build.sh release
build.bat debug
build.bat release
run:
// linux
./build/staga_debug examples/showcase.stg
./build/staga examples/showcase.stg
// windows
.\build\staga_debug examples/showcase.stg
.\build\staga examples/showcase.stg