Live data from Hacker News

Odin, a pragmatic C alternative with a Go flavour

bitshifters.cc

1–10 of 131 posts

Re: Odin, a pragmatic C alternative with a Go flavour

#2
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

Re: Odin, a pragmatic C alternative with a Go flavour

#3
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.

Re: Odin, a pragmatic C alternative with a Go flavour

#6

> 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?

I can't comment about everyone, but I use it a lot for building libraries and such. I just recently built a database ORM, but since their metaprogramming is used for their generics I've run across it a lot just for those case.

Re: Odin, a pragmatic C alternative with a Go flavour

#7
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.

Re: Odin, a pragmatic C alternative with a Go flavour

#8

> 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?

IMO it's one of Zig's advantages over C (text substitution macros are both too powerful and not powerful enough). If you're using Zig without metaprogramming, you're leaving a useful (if advanced) tool on the table.

Re: Odin, a pragmatic C alternative with a Go flavour

#9
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 reply on HN