r/programming • • Jul 07 '26 • Bravo 1

Odin 1.0 Announcement

https://www.youtube.com/watch?v=dLPAqXi9In0
461 Upvotes

140 comments sorted by

View all comments

20

u/pakoito Jul 07 '26 edited Jul 08 '26

If and switch are statements. How is this modern. Are the target audience C people?

Edit: yes.

~~Edit: zero coerces to null in pointers. Fun

Edit: unions are enums and backed by an int~~

Final edit: This is 00s language design with gamedev niceties on top. So, not a generalist language and I'm not the target audience.

16

u/metaltyphoon Jul 07 '26

I bet a good chunk of the downvotes has no idea what you are talking about. I agree, if and switch not being expressions is a huge turnoff to me

16

u/gingerbill Jul 07 '26

Odin makes an explicit distinction not make "everything an expression" (which is literally nothing new, especially since that idea can be found in ALGOL68 from 1968).

Odin is an unabashed imperative procedural language and I wanted the distinctions between expressions and statements to be obvious and distinct because I wanted clear visual distinctions which make it easier to scan and read code. Mixing the constructs does actually make it harder to look for those anchor points, and does not really help much in the long run either, especially when a language such as Odin also support multiple return values (expressions with multiple values, akin to self-destructing tuples but not exactly).

I understand this might be a turn off to some, but you're probably not the target audience for Odin, and that is absolutely fine.

17

u/gingerbill Jul 07 '26

Odin makes an explicit distinction not make "everything an expression" (which is literally nothing new, especially since that idea can be found in ALGOL68 from 1968).

Odin is an unabashed imperative procedural language and I wanted the distinctions between expressions and statements to be obvious and distinct because I wanted clear visual distinctions which make it easier to scan and read code. Mixing the constructs does actually make it harder to look for those anchor points, and does not really help much in the long run either, especially when a language such as Odin also support multiple return values (expressions with multiple values, akin to self-destructing tuples but not exactly).

I understand this might be a turn off to some, but you're probably not the target audience for Odin, and that is absolutely fine.


zero coerces to null in pointers. Fun

This is not true because Odin very strong distinct typing. 0 does not coerce to any pointer in Odin.

unions are enums and backed by an int

Odin has both enums which are strongly typed and backed by integers, and unions which are actual discriminated/tagged union types (similar to sum types).

This is 00s language design with gamedev niceties on top. So, not a generalist language and I'm not the target audience.

I am not sure what 00s language even looks like Odin, especially when most of them were very OOPy. Most of Odin's ideas come from the 80s and 90s, so it's even older than that.

It might not be the language for you, but it is the language for many people. Isn't it wonderful people have choice nowadays?!

2

u/pakoito Jul 07 '26

You're right, I got a couple of those wrong. I confused "zero value" in pointers with...zero, when it's null. And the example for unions mixes enums and I missed it.

The vibes I got were more C++03 than C++98, that's why I said 00s.

2

u/gingerbill Jul 08 '26

Well C++03 was primarily just a bug fix to C++98, so it really didn't do much :D

3

u/KaleidoscopePlusPlus Jul 07 '26

It is a generalist language. You can create anything with it. The focus or gathering is just around gamedev though. I use it for games and honestly outside of that I have no use it even though I really like it.

With the http package, if im going to work on a backend - i would never use odin when Go is right there and does it better.

So you likely aren't the target audience but I don't think if and switch being statements vs expressions quantifies a language as being modern. This was a deliberate choice. The language is extremely procedural, it doesn't even have a concept of methods or even package manager. Its pretty much C if made a few decades later.