The program shape in Odin
The smallest Odin program: a package line, one import, and main bound with ::.
// Every file names its package; core:fmt is the printing library.
package main
import "core:fmt"
main :: proc() {
fmt.println("Gull Rock light: keeper on duty")
fmt.printfln("Visitors welcome at %s tide", "low")
}
How it works
- Every file opens with
package main;import "core:fmt"names the printing library. main :: proc()binds a procedure to a constant name —::is the defining operator.fmt.printlnandfmt.printflnprint; the verbs are Go-flavored.
Keywords and builtins used here
importpackageproc
The run, in numbers
- Lines
- 9
- Characters to type
- 216
- Tokens
- 36
- Three-star pace
- 75 tpm
At the three-star pace of 75 tokens a minute, this run takes about 29 seconds.
Step 1 of 3 in Values, step 1 of 27 in Language basics.