// 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 # 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; }