Jump to content
Search

This wiki is under development. Features may be missing. Data loss is unlikely, but possible. Read the announcement.

Odin

From Ubuntu Wiki

Odin is a programming language designed for data-oriented software development. It is a relatively new language and is one of a growing class of C alternatives.

As well as an extensive standard library, Odin has a range of vendored libraries. Many of the vendored libraries are targeted at graphics programming and games development. For example, the popular library Raylib is included with the installation.

Installing

Odin is not currently available as a Deb or a Snap.

Release binaries are available in the Odin repo.

Detailed instructions to build Odin from source can be found on the Odin website.

Building

Tip
Odin requires that clang and llvm be installed on your system.

Install an appropriate version (14-21) with:

sudo apt install clang-18 llvm-18.

To build Odin, first clone the repo:

git clone https://github.com/odin-lang/Odin

Then change into the repo and run the build script:

cd odin && ./build-odin.sh

Add the odin binary that is created in the root of the repo to your PATH.

Running

Create a hello directory containing a simple main.odin file:

package main

import "core:fmt"

main :: proc() {
    fmt.println("Hello!")
}

Compile and run the program from the hello directory:

odin run .