typestar

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

  1. Every file opens with package main; import "core:fmt" names the printing library.
  2. main :: proc() binds a procedure to a constant name — :: is the defining operator.
  3. fmt.println and fmt.printfln print; the verbs are Go-flavored.

Keywords and builtins used here

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.

Type this snippet

Step 1 of 3 in Values, step 1 of 27 in Language basics.

Next →

The program shape in other languages