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.

hello.om
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.

Shell
# 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.om

Full steps and troubleshooting: Install on Linux.

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.

All commands and flags

Shell
om run   app.om          # compile and run
om build app.om -o app   # standalone executable
om check app.om          # type-check only, fastest

Two games written in Om in review

Emberdeep, a first-person 3D descent drawn in the terminal, and The Hollow Bell, a stealth roguelike of sound and spoken spells. Each is one Om file of a couple of thousand lines.

Emberdeep: ember light on a brick corridorEmberdeep: the open gateEmberdeep: a hound in the caves

How to run and play them