▲ | tialaramex 3 months ago | |||||||
> the behavior you're describing could very well be "unspecified" not "undefined" and that's a distinction some folks care about. Nah, it's going to be Undefined. What's going on here is that there's an optimising compiler, and the way compiler optimisation works is you Define some but not all behaviour in your language and the optimiser is allowed to make any transformations which keep the behaviour you Defined. Jai uses LLVM so in many cases the UB is exactly the same as you'd see in Clang since that's also using LLVM. For example Jai can explicitly choose not to initialize a variable (unlike C++ 23 and earlier this isn't the default for the primitive types, but it is still possible) - in LLVM I believe this means the uninitialized variable is poison. Exactly the same awful surprises result. | ||||||||
▲ | leecommamichael 3 months ago | parent [-] | |||||||
Your reasoning appears to be: 1. because it is the kind of optimizing compiler you say it is 2. because it uses LLVM … there will be undefined behavior. Unless you worked on Jai, you can’t support point 1. I’m not even sure if you’re right under that presumption, either. | ||||||||
|