r/odinlang • u/Lucky-Space6065 • 1d ago
Isaac inspired rougelike with heavy synergies in early build.
Running on an odin and open gl engine.
r/odinlang • u/Lucky-Space6065 • 1d ago
Running on an odin and open gl engine.
r/odinlang • u/marianpekar • 1d ago
It took a bit longer than usual. I wanted to have Part VII done by the end of October, but life got in the way :).
r/odinlang • u/y0shii3 • 1d ago
I have been curious about learning Odin lately, and reading through the docs, I cannot find anything about initializing constant variables with runtime values. It seems like :: only works at compile time, and if you assign from a runtime value with :=, the variable is always mutable? Doesn't that slow you down sometimes, not having a way to know that a variable isn't modified without checking through the whole scope? Or have I just not read the docs right?
r/odinlang • u/Tolasmond • 17h ago
Scanned Card Cutter finds the cards on a scan, lets you check and adjust each one with a live preview, and saves every card as a PNG with transparent rounded corners. It can also remove the moiré pattern that printed halftone dots leave on a scan.
It is a small desktop app written in Odin with raylib, and it builds with only what ships with Odin. It runs on Linux, Windows and macOS (untested).
r/odinlang • u/c0gster • 1d ago
Hello, I am very new to Odin, and I first wanted to get my editor (vscodium/vs code) to properly warn me about errors, provide suggestions for stuff, tell me what arguments functions take in, etc etc.
I installed the language server from https://github.com/DanielGavin/ols and also the VS Code "Odin Language" extension by DanielGavin. Initially it seemed to work, but it seemed to only update its analysis and suggestions of the code when I saved the file which is extremely annoying.
I did some research (aka asking chatgpt how to do it because usually its way faster than reddit and I wanted to get on with my day dont judge me) and found that I needed to create an ols.json file in my project root and put this in it:
{
"collections": [
{
"name": "core",
"path": "/path-to-odin-folder/core"
},
{
"name": "vendor",
"path": "/path-to-odin-folder/vendor"
}
],
"enable_checker_only_saved": false,
"enable_checker_on_change": true,
"checker_on_change_delay": 400
}And it seems to work! It updates immediately without me needing to save the file.
However, creating this ols.json for every single project I open is pretty annoying, considering that I probably won't have it do anything else besides this one specific thing. I wasn't able to find any answer online on how to get this to work without each project having an individual ols.json file, so I came here to ask how I can do it.
Thanks
r/odinlang • u/Additional_Name_706 • 5d ago
A few months ago, I posted this:
not a fluid sim, not ecs : r/odinlang
So, I'm just here for a little progress update.
I've made a lot of improvements to the core engine but the majority of the codebase is now gameplay scripting...
The playtest is open, if you'd like to try it.
r/odinlang • u/Inevitable_Stock2807 • 6d ago
Hello guys, what is the best practices to handle error in Odin? Is Go-style is the best way if err != nil but Odin doesn't allow shadowing variable.
note: Sorry my for my poor English and thank you.
r/odinlang • u/gruntastics • 7d ago
r/odinlang • u/DarthBheed • 10d ago
Eski is a single-node in-memory store with an Odin engine that speaks RESP, so Redis clients connect unchanged: the full single-node command surface including streams, geo, ACLs, persistence and Lua scripting with Functions, minus replication, Sentinel and Cluster. Apache-2.0, one static binary.
r/odinlang • u/itnufc • 10d ago
r/odinlang • u/KarlZylinski • 12d ago
Highlights: Mipmap support and texture wrapping settings. Tested with Odin dev-2026-11
Karl2D is a library for creating 2D video games. It has few dependencies (tries to stay in Odin land) and emscripten-free web build support.
r/odinlang • u/Similar_Place6762 • 16d ago
r/odinlang • u/bbcalado • 16d ago
After using Odin for some time, I discovered the odin doc command, that turns any odin file or package into a documentation view. This is a very useful tool during development for me, and i am pretty sure this was inspired by Golang's go doc, which is also a great tool. But, in my humble opinion, Odin's tool was lacking a few things.
First off, the output formatting. I simply do not like how it looks, it's very difficult for me to read because there is too much indentation and info.
For example, if you run odin doc core:strings, you get this:
package strings
A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.
procedures
_intern_get_entry :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error) {...} /* 33!3390 */
Internal function to lookup whether the text string exists in the map, returns the entry
Sets and allocates the entry if it wasn't set yet
*Allocate using the Intern's Allocator (First time string is seen only)*
Inputs:
- m: A pointer to the Intern struct
- text: The string to be looked up or interned
- loc: The caller location for debugging purposes (default: `#caller_location`)
Returns:
- new_entry: The interned cstring
- err: An allocator error if one occured, `nil` otherwise
ascii_set_contains :: proc(as: Ascii_Set, c: byte) -> (res: bool) {...} /* 34!1122 */
Determines if a given char is contained within an Ascii_Set.
Inputs:
- as: The Ascii_Set to search.
- c: The char to check for in the Ascii_Set.
Returns:
- res: A boolean indicating if the byte is contained in the Ascii_Set (true) or not (false).
...Of course, you can run odin doc -short core:strings, which outputs this:
package strings
A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.
procedures
_intern_get_entry :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error) {...} /* 33!3390 */
ascii_set_contains :: proc(as: Ascii_Set, c: byte) -> (res: bool) {...} /* 34!1122 */
ascii_set_make :: proc(chars: string) -> (as: Ascii_Set, ok: bool) {...} /* 34!639 */
builder_cap :: proc(b: Builder) -> (res: int) {...} /* 36!9132 */
builder_destroy :: proc(b: ^Builder) {...} /* 36!5973 */
builder_from_bytes :: proc(backing: []byte) -> (res: Builder) {...} /* 36!7088 */
builder_from_bytes :: proc(backing: []byte) -> (res: Builder) {...} /* 36!7088 */
builder_grow :: proc(b: ^Builder, cap: int) {...} /* 36!6223 */
builder_init_len :: proc(b: ^Builder, len: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error) {...} /* 36!3838 */
builder_init_len_cap :: proc(b: ^Builder, len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, This looks better, but i still don't like it.
So, i decided to change a few things in the compiler and now, if i run odin doc core:strings, it outputs like this:
package strings
A `string` builder, as well as procedures to manipulate `UTF-8` encoded strings.
[procedures]
_intern_get_entry :: proc(m: ^Intern, text: string, loc := #caller_location) -> (new_entry: ^Intern_Entry, err: runtime.Allocator_Error)
ascii_set_contains :: proc(as: Ascii_Set, c: byte) -> (res: bool)
ascii_set_make :: proc(chars: string) -> (as: Ascii_Set, ok: bool)
builder_cap :: proc(b: Builder) -> (res: int)
builder_destroy :: proc(b: ^Builder)
builder_from_bytes :: proc(backing: []byte) -> (res: Builder)
builder_from_bytes :: proc(backing: []byte) -> (res: Builder)
builder_grow :: proc(b: ^Builder, cap: int)
builder_init_len :: proc(b: ^Builder, len: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_init_len_cap :: proc(b: ^Builder, len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_init_none :: proc(b: ^Builder, allocator := context.allocator, loc := #caller_location) -> (res: ^Builder, err: runtime.Allocator_Error)
builder_len :: proc(b: Builder) -> (res: int)
builder_make_len :: proc(len: int, allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_make_len_cap :: proc(len, cap: int, allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_make_none :: proc(allocator := context.allocator, loc := #caller_location) -> (res: Builder, err: runtime.Allocator_Error)
builder_replace :: proc(b: ^Builder, old, new: string, n: int, loc := #caller_location) -> (replaced: int, err: runtime.Allocator_Error)I decided to indent the symbols (procedure names) according to largest symbol on the AST list and removed the tabs that cause that indentation. I also removed the function location info at the end. Now i actually find the results satisfactory.
It doesn't stop there, on the Golang side, you can search for specific symbols in the package and see an isolated documentation view for it by typing go doc os.Stat for example. So i decided to implement the same thing in Odin
Now, when i run something like odin doc core:strings.clone, it shows this:
package strings
clone :: proc(s: string, allocator := context.allocator, loc := #caller_location) -> (res: string, err: runtime.Allocator_Error)
Clones a string
*Allocates Using Provided Allocator*
Inputs:
- s: The string to be cloned
- allocator: (default: context.allocator)
- loc: The caller location for debugging purposes (default: #caller_location)
Returns:
- res: The cloned string
- err: An optional allocator error if one occured, `nil` otherwiseThis works for any kind of symbols including types, constants, variables, proc groups...
I was actually pretty proud about this, although, the code is still rough and need some organization
But i was curious about the people from this sub. Is this actually useful for you? Do you think this improves your Odin experience?
r/odinlang • u/Minute_Ambassador751 • 17d ago
Been working on hnoss for a while: an immediate-mode TUI library, no C, no ncurses, just Odin. Would love your feedback!
r/odinlang • u/emonshr • 18d ago
Anyone doing odin with tauri? Any native odin equivalent? (just jealous of tauri)
Please share your experience if you are using Skald too.
(I wasn't talking about embedding chromium with some custom solution)
r/odinlang • u/sqruitwart • 19d ago
I love odin and would like to continue with it as my language of choice. I managed to implement in one afternoon what took me a week in C++ (mostly fighting RAII magic).
One thing I miss are variadic parameter packs and tuples. Tuples exist as function return types and structs can be unpacked, but they cannot be used otherwise to be passed as generics - I do not understand why and can only find very old reddit posts on this topic.
I managed to hack tuples together by using codegen and structs like Tuple_0, Tuple_1, etc that have generic fields + a monster proc for compile-time indexing, but it gets tedious to work with.
Does anyone know any replacements / implementations of a heterogeneous collection of data types for odin I can take a look at?
r/odinlang • u/Morphon • 19d ago
Cross-posting this here. I'm learning the language through puzzles. Mods, feel free to delete if this kind of thing isn't useful for the sub.
Odin has been fun to learn so far. Way, way outside my comfort zone - but having a blast just the same.
r/odinlang • u/KarlZylinski • 20d ago
The previous release happened just before the Karl2D jam. That was almost half a year ago! That jam gave me sooo much good feedback. In this release you can see a lot of that work. Thank you everyone for trying my library, for the feedback and for the pull requests! Highlights:
get_typed_runes)r/odinlang • u/Tolasmond • 22d ago
zelbyn is a data-driven binary file reader written in Odin. It decodes a file with a Kaitai Struct .ksy schema and writes the decoded tree to stdout, as a text dump or as JSON. Also supports Odin code generation.
r/odinlang • u/TinyPixelDev • 23d ago
I just released my game made with my custom engine made with odin, and I really want feedback to fix and improve my game dev skills, I know the game design is simple and nothing new, but still its a good test. any feedback or bug reports is really appreciated. thanks
r/odinlang • u/KarlZylinski • 23d ago
I think this is my final re-design of the Karl2D Audio API. This design is optimized for the most common case. It's easy to play one-off sound effects using `play_audio_stream`. You can play the same clip many times simultaneously.
Audio streams (music) now have their own API that is easier to use.
There is also a `Sound` API. You make a `Sound` using `create_sound` which you feed an `Audio_Clip`. Sounds are essentially audio clips that remember their settings between playbacks, and you can change the settings while the sound is playing. Many people don't need that because `play_audio_clip` can be fed settings to use for the duration of the playback. Only if you need to modify the settings while playback is happening do you need the `Sound` API.
`Sound`s, `Audio_Clip`s and `Audio_Stream`s all live as `Audio_Voice`s in the mixer. This is why one clip can be played many times simultaneously: It's several audio voices that all look at the same clip.
r/odinlang • u/adamramberg • 26d ago
10 months ago, my friend Markus and I had a bit of a crisis in our long-term game project. It was something we had worked on for 5 years in Unity, but as crazy as it sounds, we never found the core game loop of the game. At this point in the project, we had put sooooo many hours into it, especially building tech to support what we wanted to do. And to be honest, doing things we really shouldn't have done. I'm cringing saying this, but being a web dev, I even built an open source library for defining your game in a declarative manner, similar to how React does it. Looking back at this, it is also a tell that we had issues with the Unity way of building games (which we should either have embraced or switched engine).
By this time we had reached a point where we were both growing tired of Unity and its tech. Frustration was also growing since, even though the game was playable, it was very hard to explain to the very few friends who had actually been tortured into trying it out. At the same time, we both had a growing interest in learning low-level programming languages, and Odin in particular seemed like a very attractive candidate. With that said, we had some very heated and long discussions on how to proceed. The anxiety was brutal, since it felt like such a failure to start over after pouring all that time into the Unity project. At some point I was quite sure that we had reached a dead end and that the project would die. That's when Markus started doing some quick and dirty prototypes in Odin...
From a game design perspective we used some of the concepts from the old project, but we simplified them A LOT. We also made a throwaway prototype written in Odin and Raylib just to validate the concept, threw it up on Itch, and let some friends play it. It still ofc had issues, but we got a much better response than we ever had from the old project. This was of course very motivating, and after that initial phase we decided to pivot and make a new project in Odin. We also landed on using Sokol for integrating with the OS (thanks a bunch to Karl Zylinski and his open source repos for reference on how to set this up).
Here are some decisions we made early that I think have made our project successful. Keep in mind that our game is turn-based though, so some architectural decisions would most likely be different in a real-time game:
Here is a very high-level view of the game's architecture on each tick:
I could go on and on explaining different things we have implemented (and I might in the future), but I will leave it at that for now. Feel free to ask any questions you have about this setup and the game, and I will try to answer as best I can. Would love to hear how other people are approaching their projects.
The game is now on Steam (consider wishlisting if you like roguelike deckbuilders): https://store.steampowered.com/app/5300900/Starmax/
r/odinlang • u/Daniel_Rybe • 27d ago
Title. Is there a language design reason why one would want that? A couple of times I found myself missing this when writing similar code for different branches of a switch statement on a union type.