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):
This creates:
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¶
Output:
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:
// 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¶
The optimised binary is placed at:
Run it directly:
Step 6 — Check for errors¶
Use ooga check to validate your code without building:
If everything is correct:
If there is a problem — for example, using an undeclared variable:
OW! CAVE THINKER CONFUSED at line 1, col 5:
NAME "undeclared_name" NOT KNOWN. CAVE CREATURE NOT DECLARE IT WITH OOGA FIRST.
Next steps¶
- Read the Language Overview to understand all syntax
- Explore the Examples for complete programs
- Learn about Functions and Loops
- See all Data Types