import ::= fn(x :: []char) &Package { p ::= pkg x; p_ptr ::= new(Package); *p_ptr = p; p_ptr }; puts :: fn(&char) i32 = #foreign "puts", "libc.so.6"; dprintf :: fn(i32, &char, f64) i32 = #foreign "dprintf", "libc.so.6"; hw ::= fn() i32 { s := "Hello, world!\0"; puts(&s[0]) }; sqrt :: fn(f64) f64 = #foreign "sqrt", "libm.so.6"; foo ::= fn() i32 { x := sqrt(2.0); s := "sqrt(2) = %f\n\0"; dprintf(2, &s[0], x) }; main ::= fn() { // io ::= import("std/io"); // io.puts("Hello, world!"); // hw(); x ::= hw(); y ::= foo(); sqrt2 ::= sqrt(2.0); // y ::= abort_1(); };