Documentation channel: current development main at compiler checkpoint 1d7e15e. The latest tagged release is v0.0.3; pages identify APIs that are not yet released.
Getting started
After downloading Strut 0.0.3 or building it from source, the simplest workflow is one source file and one command.
Your first program
function main() -> int {
print("hello, world!");
return 0;
}
Executable entry points return a process exit status. Use main(string cmd, string[] args) when you need command-line arguments: cmd is native argv[0], and args contains only user arguments. The command may be a bare name, relative path, or absolute path depending on how the program was invoked.
function main(string cmd, string[] args) -> int {
for (arg : args) {
println(arg);
}
return 0;
}
Compile it
strut hello.p
The default output is a native executable named from the source file. Use -o when you want to choose the path explicitly.
strut hello.p -o hello
./hello
Check source without linking
strut --check hello.p
From here, the syntax and types pages are the shortest path through the implemented language surface.
