Skip to content

Quick Start

Write and run your first Ooga Booga program in five minutes.


Step 1 — Create a project

Use ooga new to scaffold a project (mirrors cargo new):

ooga new hello-cave
cd hello-cave

This creates:

hello-cave/
  Ooga.toml       # package manifest
  src/
    main.ooga     # your program
  .gitignore

Step 2 — Write a program

Open src/main.ooga and replace its contents:

OOF My first cave program!

OOGA name: WORDS BE "Thog"
SAY "Hello from cave creature:"
SAY name

OOGA year: ROCK BE 10000
SAY "Year:"
SAY year

Every variable needs a type annotation (: WORDS, : ROCK, etc.). See Data Types for the full list.


Step 3 — Run it

ooga run

Output:

Hello from cave creature:
Thog
Year:
10000

ooga run automatically transpiles src/main.ooga to Rust, compiles it with cargo, and executes the binary.


Step 4 — Inspect the generated Rust

The transpiled code is written to .ooga-gen/src/main.rs:

cat .ooga-gen/src/main.rs
// Generated by oogac — the Ooga Booga compiler
#![allow(non_snake_case, unused_variables, dead_code, unused_mut)]

fn WORDY(x: impl std::fmt::Display) -> String { ... }
// ...helper functions...

fn main() {
    let mut name: String = "Thog".to_string();
    println!("{}", "Hello from cave creature:");
    println!("{}", name);
    let mut year: i32 = 10000;
    println!("{}", "Year:");
    println!("{}", year);
}

Step 5 — Build a release binary

ooga build --release

The optimised binary is placed at:

target/release/hello-cave

Run it directly:

./target/release/hello-cave

Step 6 — Check for errors

Use ooga check to validate your code without building:

ooga check

If everything is correct:

CAVE GRAMMAR GOOD! NO PROBLEMS FOUND.

If there is a problem — for example, using an undeclared variable:

SAY undeclared_name
OW! CAVE THINKER CONFUSED at line 1, col 5:
NAME "undeclared_name" NOT KNOWN. CAVE CREATURE NOT DECLARE IT WITH OOGA FIRST.

Next steps