r/odinlang

I am happy to hear ThePrimeagen say that Odin and Zig are "very, very different languages"

I am happy to hear ThePrimeagen say that Odin and Zig are "very, very different languages"

A chatter asked how they compare in his stream today (ongoing as I write this) and I found it refreshing to hear.

I don't have anything against Zig, I like it quite a lot- it would probably be my language of choice were Odin not a thing, but it seems to be more or less impossible to read discussions about Odin without comparisons to Zig cropping up.

I've found this to be a tad frustrating because I also feel they're vastly different. I understand why people categorise them similarly, they're both systems languages with aims that roughly sound like "a nicer C with modern features," but I think you can only mistake them as similar if you haven't spent much time with one of them.

It feels like Zig often being mentioned when Odin is discussed connects a bit to what gingerBill said in his Marketing the Odin Programming Language is Weird blog.

Zig really does have the "killer features" that make the merit of a language easy to comprehend, which is something Odin lacks, and it is simple to rattle of those features when drawing comparisons.

In my experience with Odin, the accumulation of quality of life features, things you discover that simply make your life so much easier on the micro-scale, is what makes it such a pleasure to work with.

Those things will rarely mean much to someone who hasn't experienced them first-hand. I think that, rather than any actual lack of value, is one reason that discussions/comparisons often slant in Zig's direction. I've read so many comments from people that say something along the lines of "I just don't get the point of Odin" - which is not something I can say I've seen said about Zig.

So, it is nice to hear someone with an audience emphasise how different they are rather than leaning into comparisons that are unlikely to highlight what it is that Odin offers - even if it was just an offhand response to a viewer!

u/concerbed — 2 days ago

New To Data Orientade Design and Odin, need some tips

HI Everyone i am a C# developer and very new to Data oriented languages i followed the book ray tracing i a weekend (a c++ book) to use as a learning project, and wanted to see if anyone could look up through my code and give some tips about design patterns and use of the language in general.

this is my repo: https://github.com/Rogue-Telvanni/Odin-Raytracer

I would apreaciate any help.

best regards.

reddit.com
u/saymelonandenter — 1 day ago

HEEELP!!! *bashes his head against the wall*

i've been making a library for text rendering for the past few months and i have done a lot of rewrites and i feel kinda stuck so your help will be greatly appreciated. Currently when i read the tables i get a stack overflow and i think scaler type really shouldn't be THAT big (the font i'm using is AdwaitaMono-Bold). there is quite a lot of files so you can find everything over on my github

u/Senior-Question693 — 6 days ago

Authoritative or official Odin Community

Hello friends,

so far I see three different sites of communities and it looks a bit fragmented.

Which one is the official or central community?

Thanks in advance

reddit.com
u/turbofish_pk — 7 days ago

Build system

I made a small build system for Odin (called Spear)

I originally put it together while experimenting with my own projects, mostly because I wanted a simple way to manage multiple external libraries.

The idea is pretty straightforward: you define "collections" for libraries, have a couple of targets (like game/test), and a minimal config file.

Right now it supports:

  • init / build / run (and little more)
  • simple TOML config
  • multiple targets
  • basic compiler options

It's very minimal and probably missing a lot of things, but maybe it's useful for someone or at least interesting to look at.

Repo:

https://github.com/okkamitsuki/spear

u/OkkamiTsuki — 7 days ago

How to get the string from a string builder?

String builders are cool but how do i get the string? The sb from core:strings appears to be just a [\dynamic\]u8 but i need a string, after quite a bit of googling i didn't find anything (maybe i'm just blind) so your help will be greatly appreciated (also it would be nice if it's a cstring cuz i'm making a c library)

reddit.com
u/Senior-Question693 — 7 days ago
▲ 18 r/odinlang+1 crossposts

BARbarian: a minimalist status bar for wayland

https://github.com/xb-bx/barbarian
Just a simple status bar for people who need a simple status bar.

I wrote it almost a year ago because I've got a bit frustrated with the way you define menus in Waybar. Ive been using it ever since. Perhaps, it will be useful for someone else.

u/Interesting_Dream_83 — 8 days ago

Showcase: A HTTP/1.1 server library for Odin

Hey, I'd like to share Tina HTTP — A HTTP/1.1 server framework/library built on Tina concurrency framework. It passes 33/33 spec compliance check using uNetworking/h1spec for compliance check. There is some API reference guide in the README but there are a few examples to show how to use it.

See the [README](https://github.com/pmbanugo/tina/tree/main/examples) for running the examples or for using the HTTP library API. Here's info if you want to verify the compliance check.

I'll write and share a blog post about the architecture and how it's built on Tina Isolates. But the example and rough doc should have good enough detail for anyone who wants to try it and leave feedback.

Looking forward to you trying it and sharing your thoughts/feedback.

u/pmbanugo — 12 days ago

compilation time conditional imports... somehow?

Context: currently I'm working on a game that uses dear imgui for all of the debug UI. I'm looking for an easy way to make these procedures only available at DEBUG builds.

I know that I can go through each procedure that uses imgui and define them conditionally with when ODIN_DEBUG, and do the same for the places that call them. That is actually what I'm doing already. However, it's hard to find the places that I need to do this. What if I miss a spot?

You know what would be easier? Being able to wrap the import statements themselves in these when blocks. This way I can easily grep my codebase for imports of this specific module, wrap them all with a when ODIN_DEBUG statement, and then have my compiler scream in case i use them anywhere inside a production build.

Any easy way to achieve this?

reddit.com
u/brubsabrubs — 13 days ago

Could context.io solve function coloring without signature changes?

It might be worth considering an approach in Odin similar to Zig's std.Io — particularly because Odin already has `context`. With something like `context.io`, this could potentially be done without requiring any signature changes in libraries.

I don't have deep experience with nbio, but it seems to me that unless you adopt a model like Go's goroutines or Zig's std.Io, the function coloring problem is essentially unavoidable. Given that Odin already has `context`, I'd argue it's actually in a better position than Zig to adopt and apply this kind of approach.

reddit.com
u/_anarcher_ — 13 days ago