Dawn Tutorial

中文 — this file is the original; the Chinese text is a translation of it.

Status: current — the reader-facing tutorial; the examples marked dawn run here are really run by CI (scripts/doc-check.py).

A deliberately small statically typed language: it compiles to JVM bytecode, and a native executable comes straight out of GraalVM native-image. This tutorial takes you from the first program to calling Java.

The dawn fenced blocks in this document were once extracted, compiled, run and checked against their output mechanically, by TutorialTest on the Kotlin side; that test is archived together with the Kotlin implementation at the kotlin-final tag. The gate is back (TEST-04 in docs/codebase-audit.md): scripts/doc-check.py is one of CI's jobs, and every block here marked ```dawn run is really compiled and really run. Blocks not marked run are still maintained by hand and may lag behind the language — mark your own if it matters that they are right.