by krig · 1y ago · 0 comments
But I haven’t looked very closely at it myself, hence the afaik qualifier.
https://odin.godbolt.org/z/8onn4hxP1
This brief example makes a hash map, then it demonstrates that if we call a sub-routine which makes its own distinct hash map, that doesn't change ours, but, once we destroy our hash map and call the sub-routine again, we can still use the variable for our (destroyed) hash map (!) but doing so reveals the contents of that other hash map from the sub-routine instead in the cases I saw.
Now, in C or C++ if you do this that's Undefined Behaviour and the symptoms I saw (and which you're likely to see if you follow the link) are just one of arbitrarily many ways that could manifest.
In Rust of course the equivalent code won't compile because the hash map is gone so we can't just go around using it after that.
And in Odin, well, as Ginger Bill has explained Odin does not have Undefined Behaviour so... this has behaviour which er, Odin has not defined ? Does that make you feel warm and tingly or do you feel like Bill just wasted time arguing semantics?
This statement is incoherent. UB is undefined behavior, and it existed long before any compiler exploited it and isn't (circularly) defined by whether the Odin compiler exploits it.
My take on what he is saying is that the odin compiler won't try to exploit that there is some behavior which is platform-defined or only knowable at runtime to do aggressive optimizations etc.
https://xcancel.com/TheGingerBill/status/1495004577531367425
To point out that use after free is possible in Odin is not really a gotcha unless you really are just arguing semantics. That's by design, just like use after free is possible in C or C++ or Rust too.
2. Odin 0s out memory when declaring a variable unless you explicitly state so with ---. This defines the state of memory when allocated.
Please don't be pointlessly insulting. The description matches many people's experience.
"He was mean to me once" isn't that interesting, especially without anything concrete to back it up.
I haven't seen the conversations he is referring to, he didn't link to or quote anything. It's just some general complaint about Bill, which may be true but who cares?
As for my "highly opinionated" things, honestly, I don't think I am that opinionated about many things, but I guess the ones I am on, they are the "well known" aspects. If I am wrong about something, I will gladly change my opinion given a good argument or set of facts.