Something went wrong. Try again.
A general purpose .. programming language written in zig ijadux2.tngl.sh/Rinnescript
zig language
Something went wrong. Try again.
1.0 kB · 25 lines
12345678910111213141516171819202122232425// native.rg — compiling a script to a native executable (`rinne build`)//// This example uses ONLY the native-subset constructs so it compiles cleanly// on the x86-64 backend (linked against libc) and the freestanding ELF path://// fn main() int # parameterless int-returning entry point// @stdout("literal", .{})# write a literal to stdout (via libc)// return <int expression> # the value becomes the exit code//// Build tagged (linked, dynamic executable against libc):// rinne build --native examples/native.rg// ./examples/native.rgx && echo "exit=$?"//// Build freestanding (static ELF, raw syscalls, no libc / no linker):// rinne build --native --no-libc examples/native.rg// ./examples/native.rgx && echo "exit=$?"//// Default `rinne build` (no --native) leaves this subset and falls back to// the C11 pipeline instead.fn main() int { @stdout("hello from a native build\n", .{}); @stdout("exit code will be 42 + 8 = 50\n", .{}); return 42 + 8;}