657 karma · joined May 24, 2024
That's definitely what compilers emit. The UB comes from the fact that the compiler cannot guarantee how the actual memory will respond to that. Will the OS kill you? Will your bare metal MCU silently return garbage? Will you corrupt your program state and jump into branches that should never be reached? Who knows. You're advocating for wild behavior but you don't even realize it.
As for your example. No, the compiler couldn't optimize like that. You seem to have some misconceptions about UB. If foo is false in your code, then the behavior is completely defined.
And because this is HN, based on past experience, I need to preface with the fact that I'm a professor of math. So no need to start by questioning my knowledge on the topic, just get straight to the point.
Also, I'm not too familiar with JVM bytecode, but if I load i64 in two registers and then perform floating point addition on these registers, does the type system prevent me from compiling/executing the program?
Can you say more about "proven to be sound"? Are you talking about a sound type system?
Can you name a single language that is used for high-performance software and whose type system is sound? To speed up the process, note that none of the obvious candidates have sound type systems.
> Without knowing the type of the vector, we don’t know what constructor it’s invoking, so we can’t really say what that line is doing.
Macros aren't a particular case of reflection... And at least in the way they're done in C++, they're a big source of bugs / spaghetti.
As for being treated as an outsider, I actually moved and lived to the US for close to a year. I made tons of effort to try and speak good English. On the face of it, the locals were very appreciative - French accent is so romantic, am I right? In reality, they made absolutely zero effort to understand me when my pronunciation differed slightly from the correct one, on countless occasions. And believe me, I tried.
> Without knowing the type of the vector, we don’t know what constructor it’s invoking, so we can’t really say what that line is doing.
And note I'm replying to someone claiming it's impossible to charge companies with union busting at all.
That's the exact point where your argument breaks down. It is possible, sometimes, to prove that a company closed a store because of a union. See the recent Starbucks trial. In the end, they were only saved by the SCOTUS, who isn't exactly uncontroversial at the moment.
Good for you, maybe your phone screen is huge. I routinely tap on the wrong element when using HN on mobile. Even on desktop I have to set the zoom level to 125%.