Skip to content

Hello World

The current compiler samples usually use integer return values because the CLI can compile them into standalone executables without extra setup.

Int main() {
print(42);
print(false);
return 42;
}

Compile and run:

Terminal window
./build/jiangc hello.jiang -o hello
./hello
echo $?

print is currently provided as a compiler-supported primitive. The runtime boundary still uses the host C runtime for low-level services such as printf, malloc, free, and abort.

Int add(Int a, Int b) {
return a + b;
}
Int main() {
return add(40, 2);
}

This is the smallest useful example for checking parsing, type checking, LLVM emission, and final linking.