The Om programming language
Learn to write OmA compiled systems language with Rust's ownership model, no garbage collector, no lifetime annotations, and less to type.
Early and experimental. Everything on this site runs on today's compiler unless it is marked in review or planned.
fn fib(n: i64) -> i64 {
if n < 2 { n } else { fib(n - 1) + fib(n - 2) }
}
fn main() {
let name = "Om"
print("Hello, {name}!")
print("fib(20) = {fib(20)}")
}
$ om run hello.om
Hello, Om!
fib(20) = 6765
Install in a few minutes
Om is built from source for now. You need Rust, Git and a C compiler for linking. The repository is private, so cloning needs a GitHub account with access.
# Debian / Ubuntu (Fedora: sudo dnf install gcc git)
sudo apt install build-essential git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/agnsha/om
cd om
cargo install --path crates/omc
om run examples/hello.omFull steps and troubleshooting: Install on Linux.
xcode-select --install # clang and git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/agnsha/om
cd om
cargo install --path crates/omc
om run examples/hello.omFull steps: Install on macOS.
# Today: run Om inside WSL
wsl --install # as administrator, then restart
# open the Ubuntu app and follow the Linux stepsOn main today, Windows uses WSL. Native PowerShell support (no WSL) is in review: see Om on Windows.
Pick a way to learn
10 minutesGetting startedWrite, run and build your first program, and read your first compiler error.
Language tourOm in one pageThe whole language on one page. Small enough to paste into an AI assistant.
11 chaptersThe Om BookFrom hello to ownership, traits and generics. Start here if you're new.
18 programsOm by ExampleShort, complete programs, one topic each, with their real output.
12 exercisesExercisesSmall broken programs to fix. Learn by getting the compiler to say yes.
One pageOm for Rust programmersAlready know Rust? Every difference that matters.
One command does it all
The om command compiles your code to a native executable through Cranelift. There is no interpreter and no virtual machine.
om run app.om # compile and run
om build app.om -o app # standalone executable
om check app.om # type-check only, fastest

