Hello World

Write your first Sounio program

Hello World

Hello world is still the best way to verify that you have a working souc, a correct stdlib path, and a basic understanding of how effects appear in normal Sounio code. The point of this page is not the string literal; it is the full workflow around checking, then optionally running, a program.

What this example proves

  • A function entry point is written as fn main().
  • Console output is effectful, so the conservative docs require with IO in the signature.
  • A successful check confirms parsing, type checking, stdlib resolution, and the selected artifact all line up for this file.

Program

fn main() with IO {
    println("Hello, Sounio!")
}

Validation workflow

export SOUC_BIN="$(pwd)/artifacts/omega/souc-bin/souc-linux-x86_64-jit"
export SOUNIO_STDLIB_PATH="$(pwd)/stdlib"

"$SOUC_BIN" check examples/hello.sio
"$SOUC_BIN" check hello.sio
"$SOUC_BIN" run hello.sio

Why check comes first

  • The checked-in artifact is the most reliable public surface today, and check is the part that consistently matches the documented contract.
  • run may still work for small programs, but runtime behavior depends on the artifact, backend path, and any codegen limitations in that build.
  • When a docs page says an example is “working,” interpret that first as “type-checks cleanly under the pinned artifact” unless the page explicitly says execution was also verified.

Repo pointers

  • examples/hello.sio is the canonical checked fixture used across the public docs.
  • self-hosted/io/stdio.sio and self-hosted/check/effects.sio are useful code paths to inspect if you are tracing how the language models simple console output.
  • tests/run-pass/ is the next step when you want programs that exercise more of the type system than hello world does.