fa/examples/hello_world_loop.fa
Ari Archer c30a3de674
Deprecate mutability contexts
Signed-off-by: Ari Archer <ari.web.xyz@gmail.com>
2022-07-27 13:41:50 +03:00

39 lines
599 B
Text

include 'std/std.fa'
fun main [ str str int ] eo
--<
This basically translates to:
#include <stdio.h>
int main(void) {
int i = 0;
while (i < 6) {
puts("Hello, world!");
i++;
}
return 0;
}
>--
0 -- i = 0
label hello_world
"Hello, world!" %puts
copy 1 add 6 grt if -- i < 6
1 add -- i++
goto hello_world
end
goto exit
goto hello_world
label exit
%EXIT_SUCCESS %exit
end
#main