1. Installing, and the first program
You need JDK 21 (native compilation additionally needs GraalVM). bin/dawn brings up
its own toolchain: on the first run it downloads the dawn-selfhost.jar of the release
pinned by scripts/seed-release.txt (the seed, checked against
scripts/seed-checksums.txt by SHA-256), then uses the seed to compile selfhost/
into the current compiler. There is no Gradle — the Kotlin implementation is archived
at the kotlin-final tag, and ./gradlew :compiler:fatJar does not exist on main.
./bin/dawn --version # the first run fetches the seed and rebuilds the toolchain
./bin/dawn run hello.dawn # compile and run (on the JVM)
./bin/dawn test hello.dawn # run the test blocks in the file
./bin/dawn build hello.dawn --native -o hello # produce a standalone binary
The first program. Functions are pure by default; touching IO — printing, here —
requires !io on the signature:
pub fn main() -> Unit !io =
println("Hello, Dawn")
Open in playground
Hello, Dawn
String interpolation is introduced by $: $name interpolates a plain variable,
${expr} any expression (the value interpolated has to be printable). Braces on their
own are ordinary characters — without a $ there is no interpolation:
pub fn main() -> Unit !io = {
let name = "Dawn"
let year = 2026
println("$name was born in $year")
}
Open in playground
Dawn was born in 2026