Skip to content Skip to footer
0 items - $0.00 0

Odin, a Pragmatic C Alternative with a Go Flavour by hmac1282

Odin, a Pragmatic C Alternative with a Go Flavour by hmac1282

18 Comments

  • Post Author
    WhereIsTheTruth
    Posted May 9, 2025 at 7:13 pm

    I like odin a lot, however, there are two things that just don't stick with me, and i ended up quitting:

    – RTTI: just give me compile time type introspection and let me disable RTTI without making the language unusable

    – when/import: just let me wrap an import inside a when block, being forced to split my file in 3 made me quit the language

  • Post Author
    pbohun
    Posted May 9, 2025 at 7:23 pm

    I've started experimenting with Odin for some personal projects and it's been great. The built-in vendored libraries make creating certain programs trivial. For example, just `import rl "vendor:raylib"` and you can use `rl.InitWindow(800,600,"Test")`. No need to install Raylib, add to path or use special linker directives, just `odin build .`!

    Also I think Odin struck the right balance of features while trying to keep to the spirit of C.

  • Post Author
    throwawaymaths
    Posted May 9, 2025 at 8:19 pm

    > This is the polar opposite of Zig’s embracing of metaprogramming for as much as possible.

    I found this claim a bit strange. do people actually use metaprogramming in Zig a lot?

  • Post Author
    James_K
    Posted May 9, 2025 at 8:21 pm

    A C alternative means a language that will last for 50 years, whereas this seems more like "whatever's popular by way of LLVM". I can see some real smart stuff coming out of languages like Zig and Rust, where Odin seems just to follow along.

  • Post Author
    taylorallred
    Posted May 9, 2025 at 8:59 pm

    Odin really hits the sweet spot for everything you would want from a language for the game dev and game-dev-adjacent space in terms of simplicity, convenience, and speed. I think a major design decision of the language that will make or break it for users is the fact that the language gives you common features instead of giving you the means of abstraction to make those features yourself. For example, instead of preprocessor macros you get the `when` clause for conditional compilation because in Bill's estimation, that's one of the only real needs for macros. The same goes for data structures. Odin gives you the certified classics like dynamic arrays and maps but doesn't give you a whole lot to make your own custom data structures (it's possible, just not encouraged by the language design). All in all, I think if you want to make an application with a language that has batteries included and you don't need a lot more than that, Odin is nearly flawless.

  • Post Author
    mcbrit
    Posted May 9, 2025 at 9:14 pm

    I am currently limiting myself to 500 lines of (particle engine) code while listening to visual artists talking about their workflow in UE5 or Houdini, and Odin+Raylib are lovely to work in.

    GingerBill has shouted out Go, but Odin doesn't particularly feel like a Go flavo(u)r.

  • Post Author
    vandyswa
    Posted May 9, 2025 at 9:16 pm

    FWIW, another take on "C Alternative" is the D programming language:

    https://wiki.dlang.org/Tutorials

    Comparatively mature, there's even a freeware book which is quite good:

    http://www.ddili.org/ders/d.en/index.html

  • Post Author
    ultrarunner
    Posted May 9, 2025 at 9:18 pm

    As a completely incidental observation (and maybe related to the article from a few days ago considering the importance of language skills compared to math skills for software development), I'm interested in what people choose to capitalize when developing languages. With c, lowercase seems to be the default, signifying variables or function calls. Adding inheritance in c++ leads to Proper Nouns like classes being capitalized, while their instances are often lowercase. This communicates a subtle "feel" for the language, meta information about what's being accomplished.

    Capitalizing method calls (`rl.InitWindow()`) seems to place the importance on the Method being called, but at first glance (ASP, or Go off the top of my head) it muddies the waters. If this isn't clear, consider that capitalizing ALL code would reduce clarity as all letter shapes are now essentially the same (a box).

    I spend most of my time in c, c++, ruby, and javascript, but maybe I should try to do a personal project in Go (or Odin) for this reason alone.

  • Post Author
    leelou2
    Posted May 9, 2025 at 10:07 pm

    Odin seems to strike a really interesting balance between simplicity and practicality, especially for game development. I like the idea of having “batteries included” without too much abstraction getting in the way. For those who have used both Odin and Go, how do you feel about the differences in day-to-day development? Are there any features in Odin that you wish Go had, or vice versa? Would love to hear more real-world experiences!

  • Post Author
    gitroom
    Posted May 9, 2025 at 10:21 pm

    been playing around with odin and honestly the ease of getting started feels way better for me than most c-like stuff ever has. you ever think these smaller pain points keep more folks from switching than big technical features?

  • Post Author
    johnnyjeans
    Posted May 9, 2025 at 11:47 pm

    For me, I don't really look at Odin as a successor/fixer of C. There are other languages that can make a better case for that[1][2]. Instead, I look at it more like a successor/fixer of Pascal. It doesn't fall down the OO hole that so many others did. It has type casting, dynamic arrays, parametric polymorphism in both functions and data structures, is much less noisy (and in my opinion far more skimmable), more useful built-in primitive data structures like associative arrays and matrices, custom allocators, function overloading, reflection, etc.

    You can find odds and ends of these things in other Pascal successors like Delphi, Oberon and Object Pascal. Truth is though, I never found these languages compelling. Why? Because none of them were anywhere close to being the same kind of simplicity as Pascal, and they were too wrapped up in flashy, trendy things that went out of style. Where Odin wins out is that it distinctly lacks the 90's OO craze hangover, and it never feels particularly more complicated or bloated. It's an audaciously tasteful proposition for a language. A C replacement? No, not really. But as a C++ programmer who's fed up with the lack of things like structure introspection and ergonomic sum types, I'm keeping a very close eye on Odin.

    [1] – https://c3-lang.org/

    [2] – https://harelang.org/

  • Post Author
    thegeekpirate
    Posted May 10, 2025 at 2:49 am

    When I first saw Odin, I wrote down a list of everything I didn't think I'd like.

    After several thousand lines, it proved all of my major worries incorrect, and has been an absolute pleasure.

    It has since replaced my usage of Go, which I had been using since release.

    I would highly recommend giving it a proper shot!

  • Post Author
    Dwedit
    Posted May 10, 2025 at 4:03 am

    How does this compare with Zig or Beef?

  • Post Author
    mistrial9
    Posted May 10, 2025 at 4:34 am

    re Odin — I do not like reusing important names in this way. Can I be the only one?

  • Post Author
    yawaramin
    Posted May 10, 2025 at 5:23 am

    Can someone explain how Odin achieves memory safety? Eg how does it avoid use-after-free?

  • Post Author
    throwaway81523
    Posted May 10, 2025 at 6:04 am

    I don't understand the point of this. When I say "Go flavour" I thought it would have lightweight threads like Go, but there is no mention of that in the description page. So it's another uninteresting curly brace language as far as I can tell. I'd rather use one with more traction.

  • Post Author
    rednafi
    Posted May 10, 2025 at 6:55 am

    Odin truly feels like a C successor, and as someone who likes Go, it appeals to me a lot more than Zig or Rust. Partly because it took inspiration from the Pascal, Delphi, Oberon branch, same as Go.

    I don’t particularly enjoy working on the types of problems Zig or Rust aim to solve. I spend the majority of my time working at layer 4, and Go makes it immensely enjoyable. But sometimes I want a bit more control over the hardware and don’t want to pay the cost of a GC. Odin feels just right.

    In my case, the assortment of syntactic features like OOP, compile-time macros, or even the borrow checker suck all the fun out of programming. That’s why I still enjoy writing C programs, footguns and all.

  • Post Author
    ossobuco
    Posted May 10, 2025 at 8:24 am

    I've been using Odin for the last ~6 months, wrote a 15k loc project and it's been an absolute pleasure. This is my first low level language after 10 years of web dev, and it feels much higher level than it is, while giving you the control and performance of a language like C.

    I like pretty much every choice that has been taken when designing the language, except maybe the lack of namespaces, which can be solved anyway with prefixes.

    The lack of OOP features is the best part for me, it's rewiring my brain in a good way and I can now also reason much better about RDBMS schemas. Data oriented design is the most helpful approach I've stumbled upon in my career.

Leave a comment

In the Shadows of Innovation”

© 2025 HackTech.info. All Rights Reserved.

Sign Up to Our Newsletter

Be the first to know the latest updates

Whoops, you're not connected to Mailchimp. You need to enter a valid Mailchimp API key.