Skip to content

Your first program

Create hello.vow:

fn main(caps: Caps) -> int {
return 1 + 2;
}

Every program’s entry point is fn main(caps: Caps) -> int. Capabilities enter only here. If you never use caps, you still must declare it.

Terminal window
vow build hello.vow -o hello
./hello
echo $? # 3

Or:

Terminal window
vow run hello.vow
  • Integers: int, int64 (no implicit mix — use as)
  • bool, heap String, Array<T>
  • Prelude: Option<T>, Result<T, E>no null
  • Structs, enums, match (exhaustive)
fn unwrap_or(opt: Option<int>, fallback: int) -> int {
return match opt {
Some(x) => x,
None => fallback
};
}