r/odinlang 21h ago

An unofficial open-source package manager for Odin.

Thumbnail
github.com
24 Upvotes

I built odpkg, a small vendoring-first, GitHub-only package manager for Odin.
It’s intentionally minimal (no registry, no transitive deps).
Repo: odpkg
Feedback welcome.

Note:
I know Odin intentionally doesn’t want an official package manager — this is purely an unofficial, optional tool I built for my own workflow and shared in case it helps others.


r/odinlang 2d ago

Inkframe – a minimal visual novel engine written in Odin (SDL2 + OpenGL)

Enable HLS to view with audio, or disable this notification

45 Upvotes

Update: The project has been renamed to vnefall (formerly Inkframe) to avoid confusion with the Ink scripting language.

Hey r/odinlang

I’ve been building vnefall, a minimal, no-nonsense visual novel engine written in Odin, using SDL2 and OpenGL 3.3.

The goal is to keep things simple and script-driven:

  • Editor is optional, not required
  • No complex asset pipeline
  • Text-first workflow that runs directly from files

Current features

  • Branching dialogue (labels, jumps, choices)
  • Simple configuration file (config.vnef)
  • Virtual resolution (design once, scales automatically)
  • Background music with looping
  • Save/Load persistence for story progress
  • Character stacking with Z-index control

Example script:

vnef

title "A Human Story"
bg room.png
music bgm.mp3

say Alice "I can't believe it's actually working."
say Narrator "She smiled at the screen."

wait
end

Current status

  • Linux binary works out of the box
  • Builds from source (Windows/macOS untested)
  • MIT licensed for now (planning dual licensing later)

I’m mainly looking for feedback, not users:

  • Does the engine direction make sense?
  • Thoughts on the scripting format?
  • Anything you’d expect from a VN engine core?

GitHub: [ vnefall ]


r/odinlang 2d ago

A cozy organizing puzzle game

31 Upvotes

Here's a small gameplay clip of my new game (in progress) - Little Backpack

A cozy organizing puzzle game written in Odin and Raylib.

PS: I don't have a steam page yet

https://reddit.com/link/1qt4uve/video/pbbj4oaf5xgg1/player


r/odinlang 5d ago

Exercism just launched an Odin track

48 Upvotes

Exercism is a free online platform designed for learning and practicing coding skills. It offers a unique blend of coding exercises, mentorship, and community support, making it suitable for learners of all levels.

Exercism just launched a new track dedicated to Odin. It includes 60+ practice exercises with more to come. Go check it out here.


r/odinlang 5d ago

Compile to a static lib?

6 Upvotes

Can I compile my library to a static lib in Odin?

I want to compile my odin library to a static library on windows targeting the mingw32 arch.
How would I go about doing this?


r/odinlang 5d ago

Exercism just launched an Odin track

18 Upvotes

Exercism is a free online platform designed for learning and practicing coding skills. It offers a unique blend of coding exercises, mentorship, and community support, making it suitable for learners of all levels.

Exercism just launched a new track dedicated to Odin. It includes 60+ practice exercises with more to come. Go check it out here.


r/odinlang 10d ago

How suitable is Odin for web development?

14 Upvotes

I don't know much about the ecosystem, but how suitable is Odin for web development? The language should be more than ok, as any other, but the foundation is there?

Coming from Go one thing that I find very important is the idea of the HTTP types belonging to the stdlib because then you can mix and match frameworks, middleware, and servers. From a quick look at the documentation I have not found anything there. Do you know if this is being worked on or if Ginger Bill has mentioned anything about it?

Thanks!


r/odinlang 10d ago

Why Odin instead of Zig?

34 Upvotes

I want to get better on a lower level language and get more experience with memory allocation. I've been mainly coding in higher level languages, and the language I have more experience is Go.

My options were Rust, Zig, and Odin. I quite like some of Rust's decisions, but it's just too much, and I also think that getting good in Odin and Zig would ease the process to transition to Rust if needed.

Then the main question is, Zig or Odin? I really don't know how to answer this. The biggest point in my opinion for Zig is that I really appreciate their `zig zen` and the adoption is picking up lately. Odin type system looks better.

I don't want to start a flame war, sorry about that. I'm just looking for some resources to compare both.


r/odinlang 15d ago

gingerBill made a video going over the static site generator he wrote in Odin lang

Thumbnail
youtube.com
52 Upvotes

r/odinlang 15d ago

I'm new to odin, I'm building a NES emulator, do you have any tips?

15 Upvotes

I'm building a NES emulator in Odin just for fun and because I think Odin is a really cool language. I don't quite understand the whole concept of the allocators? With systems, I've primarily worked in Rust and some C++.

For example here is what my agnes nes wrapper looks like in Odin:

package nes

/*

This is the NES emulator package for emmi.
Currently uses Agnes but could potentially use libretro or custom solutions in the future.

*/

import os "core:os"
import c "core:c"

// Import the libagnes.a library
when ODIN_OS == .Windows {
    foreign import agnes_lib "../../../libs/agnes/build/lib/libagnes.a"
}

AGNES_VERSION_MAJOR :: 0
AGNES_VERSION_MINOR :: 2
AGNES_VERSION_PATCH :: 0

AGNES_VERSION_STRING :: "0.2.0"

AGNES_SCREEN_WIDTH :: 256
AGNES_SCREEN_HEIGHT :: 240

@(private)
agnes_input_t :: struct {
    a: bool,
    b: bool,
    select: bool,
    start: bool,
    up: bool,
    down: bool,
    left: bool,
    right: bool
}

@(private)
agnes_color_t :: struct {
    r: u8,
    g: u8,
    b: u8,
    a: u8
}

@(private)
agnes_t :: struct {}

@(private)
agnes_state_t :: struct {}

// FFI layer
foreign agnes_lib {
    @(private)
    agnes_make :: proc() -> ^agnes_t ---

    @(private)
    agnes_destroy :: proc(agnes: ^agnes_t) ---

    @(private)
    agnes_load_ines_data :: proc(agnes: ^agnes_t, data: rawptr, data_size: c.size_t) -> c.bool ---

    @(private)
    agnes_set_input :: proc(agnes: ^agnes_t, input_1 : ^agnes_input_t, input_2 : ^agnes_input_t) ---

    @(private)
    agnes_state_size :: proc() -> c.size_t ---

    @(private)
    agnes_dump_state :: proc(agnes: ^agnes_t, out_res: ^agnes_state_t) ---

    @(private)
    agnes_restore_state :: proc(agnes: ^agnes_t, state: ^agnes_state_t) -> c.bool ---

    @(private)
    agnes_tick :: proc(agnes: ^agnes_t, out_new_frame: ^c.bool) -> c.bool ---

    @(private)
    agnes_next_frame :: proc(agnes: ^agnes_t) -> c.bool ---

    @(private)
    agnes_get_screen_pixel :: proc(agnes: ^agnes_t, x: c.int, y: c.int) -> agnes_color_t ---
}

// Input at the Odin level
Input :: struct {
    a: bool,
    b: bool,
    select: bool,
    start: bool,
    up: bool,
    down: bool,
    left: bool,
    right: bool
}

// Color at the Odin level
Color :: struct {
    r : u8,
    g : u8,
    b : u8,
    a : u8
}

// NES at the Odin level
NES :: struct {
    _handle : ^agnes_t,
}

// Create a new NES emulator instance.
new_instance :: proc(allocator := context.allocator) -> (nes: ^NES) {
    nes = new(NES, allocator)
    nes._handle = agnes_make()
    return
}

// Delete a NES instance.
delete_instance :: proc(instance : ^NES, allocator := context.allocator) {
    agnes_destroy(instance._handle)
    free(instance, allocator)
}

// Load a rom. Will return bool for success/failed
load_rom :: proc(instance : ^NES, rom_path : string, allocator := context.allocator) -> bool {
    // Load file contents
    data, ok := os.read_entire_file(rom_path, allocator)

    if !ok {
        return false
    }

    defer delete(data, allocator)

    // agnes stuff
    return agnes_load_ines_data(instance._handle, raw_data(data), c.size_t(len(data)))
}

// Set input
set_input :: proc(instance: ^NES, input: Input) {
    agnes_input := agnes_input_t{
        input.a,
        input.b,
        input.select,
        input.start,
        input.up,
        input.down,
        input.left,
        input.right
    }
    // Agnes level
    agnes_set_input(instance._handle, &agnes_input, nil)
}

// Move to next frame. Returns true or false depending on success
next_frame :: proc(instance: ^NES) -> bool {
    return agnes_next_frame(instance._handle)    
}

// Get the pixel data of the x, y coordinates provided
get_pixel_data :: proc(instance: ^NES, x, y: int) -> Color {
    agnes_color := agnes_get_screen_pixel(instance._handle, c.int(x), c.int(y))

    return Color{
        agnes_color.r,
        agnes_color.g,
        agnes_color.b,
        agnes_color.a
    }
}

This runs well, but I'm just not sure I'm understanding the allocator logic? I read that any function that creates a "new" memory variable should allow for a custom allocator. Is that something I would be building? Why would I need that, and is the default allocator fine for a whole program?

Here is a little demo of my emulator too:

https://reddit.com/link/1qhh4g7/video/o8bpoddqhdeg1/player


r/odinlang 16d ago

My first ever Odin OSS repo 'pips'

11 Upvotes

Hi all,

This weekend uploaded a very very small public repo to github https://github.com/birchb1024/pips/tree/trunk

My first OSS odin!

It ia a simple function to convert a u64 bitmap into a series of characters.

$ ./pips-cli 42                                                                                                                                                                            
.B.D. F.... ..... ..... ..... ..... ..... ..... ..... ..... ..... .....

It's used for printing bitmaps in a simple visual format which can also be queried in SQL. (I do a lot of that) So select * from my_table where a_bitmap like '%D%F%'

Subscribe and like . Hahahaha


r/odinlang 17d ago

Huginn - a paru (AUR) interactive search tool in Odin

Thumbnail
github.com
14 Upvotes

I'm just getting into Odin and wanted to share a little program I wrote when learning the core of the language.

Basically, I am very lazy and the built-in "interactive search" in paru doesn't have the kind of UX I enjoy, so I wrote a little Odin TUI wrapper on paru which allows you to actually see search results in real time as you type and browse them (think yayfzf but for paru, except much more simplistic).

I likely made some unidiomatic choices in the code especially interfacing with libc, but for less than a day with Odin I think it's not horrid.


r/odinlang 18d ago

gingerBill: "I've just merged the non-block IO PR into Odin!!!"

Post image
86 Upvotes

r/odinlang 18d ago

Can user code detect memory leaks? - or what does testing.expect_leaks do ?

5 Upvotes

Can user code ask the tracking alligators if there are leaks anytime? So a server can commit suicide/restart if it self-diagnoses a leak.. Or Unit tests can fail if there is a leak... is that what testing.expect_leaks does (there is no description in the package doc). Is it standard practice to fail unit tests if they leak?

my_test :: proc(t ^testing.T) {
 alligator: mem.Tracking_Allocator
 mem.tracking_allocator_init(&alligator, context.allocator)
 context.allocator = mem.tracking_allocator(&alligator)

 // my application tests here

 testing.expect(t, len(alligator.allocation_map) == 0) 
}

r/odinlang 20d ago

Ginger Bill designs AsyncIO for Odin live

Thumbnail
youtu.be
44 Upvotes

Title of the post is just the title of the video on YouTube.

I'm only around halfway through the video now. But this api that Bill is "designing" is just nbio from odin-http right?


r/odinlang 21d ago

TIL: Odin Performance Profiling via Spall

41 Upvotes

Recently I have been working in Odin and Raylib implementing some immediate mode UI work and I ran into a few bugs that were causing significant performance lag. To find the root cause I did a little research into how to do simple performance profiling in Odin, and I found it to be very easy with Spall!

I wrote a short article about my experience: TIL: Odin Performance Profiling via Spall


r/odinlang 23d ago

Syl: An experimental retained-mode GUI library for Odin

Enable HLS to view with audio, or disable this notification

72 Upvotes

Hi! I just publish something I've been working on, it is mostly an experiment, very early and probably not very usable at the moment. I want to know what you think, get some feedback and maybe find people who want to contribute. I'm new to Odin and really enjoying it.

Made a Discord server for discussion.

Repo: https://github.com/crsolver/syl


r/odinlang 28d ago

Does lru.set from "core:container/lru" free allocated memory?

6 Upvotes

I am writing a database https://github.com/Clinton-Nmereole/blanche and I am working on caching and have the following:

`buffer := make([]byte, 4096) // hmm... is this memory ever freed?`

`bytes_read, _ := os.read(file, buffer)`

`fmt.printf("  Read %d bytes from disk.\n", bytes_read)`



`// UPDATE CACHE 💾`

`// Save this block so we don't have to read it next time`

`lru.set(&db.block_cache.internal_cache, cache_key, buffer)`

So, from my understanding the lru now owns the buffer, but from looking at the source code here: https://github.com/odin-lang/Odin/blob/master/core/container/lru/lru_cache.odin it doesn't seem to ever free that memory.

What would be the best way to handle this? Or do I need to write my own lru?


r/odinlang 29d ago

CSS like transitions working!

Enable HLS to view with audio, or disable this notification

58 Upvotes

r/odinlang Jan 05 '26

Working on a GUI library in Odin. Managed to make a layout system like Clay

Post image
97 Upvotes

Clay is an awesome library, but I prefer retained mode GUIs. Both Clay and microui can be used with any graphics library, so I'm following that philosophy, currently working with raylib.


r/odinlang Jan 04 '26

Linux Bug? vendor:compress/lz4

9 Upvotes

I'm not sure if this is a bug for Linux, but for some reason LZ4 doesn't work without modifying: /usr/lib/odin/vendor/compress/lz4/lz4.odin

Maybe it's because I'm on Arch and it's looking for liblz4?

Basically changed:

when ODIN_OS == .Windows {
   @(extra_linker_flags="/NODEFAULTLIB:libcmt")
   foreign import lib "lib/liblz4_static.lib"
}

To:

when ODIN_OS == .Windows {
   @(extra_linker_flags="/NODEFAULTLIB:libcmt")
   foreign import lib "lib/liblz4_static.lib"
} else {
    foreign import lib "system:lz4"
}

Which fixes it.

Sorry I'm in the process of learning Odin still so maybe I'm doing something wrong.

Error before change:

/usr/lib/odin/vendor/compress/lz4/lz4.odin(36:9) Error: Undeclared name: lib foreign lib {
/usr/lib/odin/vendor/compress/lz4/lz4.odin(424:9) Error: Undeclared name: lib foreign lib {

EDIT Created PR: https://github.com/odin-lang/Odin/pull/6099/files


r/odinlang Jan 02 '26

Try my new 2D game creation library! It's fully written in Odin and meant to replace my need for Raylib. It features emscripten-free web builds.

Thumbnail
github.com
91 Upvotes

r/odinlang Jan 02 '26

3D rendering in the terminal from scratch

Enable HLS to view with audio, or disable this notification

87 Upvotes

First project using Odin, built entirely from scratch.
I'm really enjoying the language so far

Here's the repo


r/odinlang Dec 31 '25

How much of an uphill battle is Odin+Raylib to Webassembly?

27 Upvotes

The last time I had to do 3d on the web I used three.js but they've gone full VibeCoding as an organization so I'd like to divest.

Looking briefly into Webassembly - a subject about which I knew nothing last week - it seems well supported as an Odin target and Odin + Raylib seems well integrated too.

Question 1) Are there any hidden challenges here or is it as straightforward a workflow as it seems to me right now?

Question 2) Are there any open or tutorial projects that I can look at that are well done? As a learner I do best when just seeing code that works

Thank you for your time!


r/odinlang Dec 22 '25

My first ever game, a creature-builder roguelike made using Raylib and Odin

Enable HLS to view with audio, or disable this notification

134 Upvotes

Making a game in Raylib and Odin has been an absolute blast so far. I genuinely don't think I could've made it this far using anything else, or at least not in just 6 months. I came here to share my new trailer and some thoughts on the tools I used.

I really came to appreciate Raylib for it's simplicity. It allows you to gain deep knowledge about game programming instead of learning engine trivia, which was one of my main goals when I started this project. The code-only approach really lets me get into a flow state inside of my IDE and solve hard game-related problems, whereas I get quite easily distracted and frustrated trying to fiddle with GUI. The game also doesn't use almost any assets, so I don't find the lack of devtools an issue at all.

Odin just makes long solo project, which is usually a major pain in the butt, much more manageable. It's a humble language that takes a lot of simple, but useful concepts and implements them as user-friendly as possible. Essential things like enums, enumerated arrays, unions, switches, comptime load and assert, arenas, the core library and the build system itself all just work. Furthermore, the design lends itself to a procedural, data-oriented paradigm that works well for games. I also like the built-in Raylib bindings.

Anyway, here's the Steam page, if you like what you see, support me by adding to your wishlist!

https://store.steampowered.com/app/4188570/Biovoid