Odin, a Pragmatic C Alternative with a Go Flavour

https://news.ycombinator.com/rss Hits: 9
Summary

Odin is a general-purpose systems programming language authored by Bill “gingerBill” Hall. Designed as a modern alternative to C, Odin emphasizes simplicity, performance, and readability without sacrificing control over low-level details. The website says it’s “data-oriented”, and features such as SOA (structs-of-arrays) and implicit zero initialization tie into that. Despite this focus, the language surprisingly has dynamic maps and arrays built into the language itself. While the memory is still manually managed, it’s uncommon to see such built-ins. This perhaps sets the tone of Odin: it tries to be ergonomic and easy to write by offering a lot out of the box. Odin also comes with “vendor”, containing bindings to a wide variety of popular libraries. This makes the language very easy to get into. Design Philosophy Odin focuses on practical solutions to real-world programming challenges—in other words, it favours pragmatism over idealism (I’ll return to this when I later discuss Zig). Rather than introducing complex features, Odin focuses on code that is simple and clean to read and reason about. This is the polar opposite of Zig’s embracing of metaprogramming for as much as possible. Odin also has a fairly old-fashioned view of types. The current trend is to make programming languages increasingly more complex so that they can describe more and more types in the language itself. Odin instead harkens back to older languages where built-in types flourished. Consequently, Odin does not just offer the aforementioned hashmaps and dynamic arrays, but also numerical types such as complex numbers, vectors, matrices, and even quaternions. This makes up for its rejection of operator overloading by a wide margin. It’s not a coincidence that the flagship app to demonstrate Odin’s capabilities, EmberGen, is a math- and graphics-heavy tool. A quick look at the syntax Odin has a fairly straightforward syntax for a beginner. The fact that there is no excessive nagging about mutabi...

First seen: 2025-05-09 20:16

Last seen: 2025-05-10 04:17