Skip to content

01 · Hello World

Every Sigil program starts with fn main(). Calling println! is an I/O operation, so main carries the !io effect — the compiler enforces that any function touching the outside world declares it. There is no hidden global state; effects are explicit in the type.

hello.cssl
fn main() !io {
println!("Hello, world!");
}
Hello, world!

main is the program entry point. The !io annotation is inferred automatically when the body contains println!, but writing it explicitly is a contract: if you later add a pure refactor that accidentally strips the I/O, the compiler tells you. The binary produced is native — no runtime, no VM.


Next → 02 · Variables and Types