Data-oriented pass on the encode hot path. Profiling showed bounds checks already elided by -o:speed; the cost was per-instruction loop/scan machinery and immediates falling off the hint path. - Gather the immediate slot in the single resolve pass and emit it straight- line (no scan over enc.enc); likewise drive the legacy REX prefix from the precomputed reg/mr/opr slots instead of a per-form scan. - Fold the separate needs_66 (GPR16) and SPL/BPL/SIL/DIL operand loops into the resolve pass, so user operands are visited exactly once. This was the big one: mov r,r 27 -> 21 ns. - Gate the whole legacy-prefix block on a single flags!=0 test (a legacy prefix is almost always absent) instead of four branches per instruction. - Make immediate forms hintable. A typed immediate builder names its width (inst_add_r32_imm32), the matcher already keys off the operand's declared size, so baking the form is byte-identical AND drops immediates from the full match scan: mov r32,imm32 55.7 -> 17.8 ns (3.1x). Floor (no-op) 14.55 -> 10.3 ns; realistic immediate-heavy typed mix 30 -> 20.5 ns/inst (~49 M inst/s). gen/builders/check/test/idempotent green; 2282 cases (typed==generic byte-identical, incl. the new immediate cases).
The Data-Oriented Language for Sane Software Development.
The Odin Programming Language
Odin is a general-purpose programming language with distinct typing, built for high performance, modern systems, and built-in data-oriented data types. The Odin Programming Language, the C alternative for the joy of programming.
Website: https://odin-lang.org/
package main
import "core:fmt"
main :: proc() {
program := "+ + * 😃 - /"
accumulator := 0
for token in program {
switch token {
case '+': accumulator += 1
case '-': accumulator -= 1
case '*': accumulator *= 2
case '/': accumulator /= 2
case '😃': accumulator *= accumulator
case: // Ignore everything else
}
}
fmt.printf("The program \"%s\" calculates the value %d\n",
program, accumulator)
}
Documentation
Getting Started
Instructions for downloading and installing the Odin compiler and libraries.
Nightly Builds
Get the latest nightly builds of Odin.
Learning Odin
Overview of Odin
An overview of the Odin programming language.
Frequently Asked Questions (FAQ)
Answers to common questions about Odin.
Packages
Documentation for all the official packages part of the core and vendor library collections.
Examples
Examples on how to write idiomatic Odin code. Shows how to accomplish specific tasks in Odin, as well as how to use packages from core and vendor.
Odin Documentation
Documentation for the Odin language itself.
Odin Discord
Get live support and talk with other Odin programmers on the Odin Discord.
Articles
The Odin Blog
The official blog of the Odin programming language, featuring announcements, news, and in-depth articles by the Odin team and guests.
Warnings
- The Odin compiler is still in development.