Skip to content

First Program

The smallest useful executable shows the three pieces every new project should recognize: a manifest, a source file, and an entrypoint that receives Context.

Ultraviolet.toml declares the executable assembly and the source root.

[[assembly]]
name = "hello"
kind = "executable"
root = "src"

Manifest loading, assembly records, source roots, and project diagnostics are owned by Project and Compilation Model.

Create src/Main.uv with a public main procedure.

public procedure main(move ctx: Context) -> i32 {
ctx.io~>consoleWrite("Hello, Ultraviolet!")
return 0
}

The explicit Context parameter is part of Ultraviolet’s authority model: effect-bearing behavior flows through visible capability values. The relevant reference sections are Authority Model, Procedure Declarations, and Call Expressions.

Terminal window
uv check
uv build
uv run

Use uv check as the first compiler pass when experimenting with syntax, diagnostics, or examples. The command surface is summarized in Quickstart and specified by Tool Resolution and IR Assembly Inputs.

Move from this page to the Handbook when you need exact syntax, typing, dynamic semantics, lowering, diagnostics, or ABI behavior.