what is Aglang?
Aglang is an esoteric language made to be similar to Assembly: with just two registers and the stack available, it forces the developer to engineer creative ways to do simple things.
1001000>\ $ H $;
1100101>\ $ e $;
1101100>\ $ l $;
1101100>\ $ l $;
1101111>\ $ o $;
101100>\ $ , $;
100000>\ $ (space) $;
1010111>\ $ W $;
1101111>\ $ o $;
1110010>\ $ r $;
1101100>\ $ l $;
1100100>\ $ d $;
100001>\ $ ! $;
1010>\ $ (newline) $;
this is a simple hello world program, and it shows how Aglang manages output: to print a character, its ascii value can simply be moved into the stdout.
1100>'; $ counter $
0>:; $ put 0 in the stack (marks end of the loop) $
0>:; $ temporary value that'll get deleted $
[
:!; $ pop the first value from the stack $
1>:; $ put 1 in the stack $
'-1; $ remove 1 from the counter $
'>:; $ push the counter in the stack
(when it gets to zero, the loop will stop) $
];
$ pop a value from the stack; that would have
been a zero, since its the last value of the
counter that gets pushed before the loop stops $
:!;
$ actual fibonacci logic $
0>'; $ F(0) $
1>''; $ F(1) $
$ print F(0) and F(1) $
'>\#;
1010>\; $ newline $
''>\#;
1010>\; $ newline $
[ $ fibonacci loop $
''>:; $ put the current number in the stack $
''+'; $ sum numbers and save to register 1 $
:>'; $ put the previous number in register 0 $
:!; $ pop it from the stack $
''>\#; $ print the current number $
1010>\; $ newline $
:!; $ pop one of the counter 1's from the stack $
]
and this is a fibonacci example: it prints the fibonacci sequence up to 233 (since that's the maximum that 8-bit integers can fit) and is a great example of how things have to be made in Aglang. in Aglang, you only have two registers, and they have to be used to keep track of the fibonacci numbers, so to make a counter, you have to use values in the stack followed by a zero to make the loop stop at the correct iteration. (aglang now supports labels, so this example is considered obsolete, but still good)
how can i try it?
Aglang can be tried online in the web interpreter, or, if you want to install it, you can use the cli: the cli includes an interpreter, a transpiler and a compiler.
if you want to learn it, you can try the interactive tutorial, or if you like a more theoretical approach, check out the docs