Comment by _flux

10 days ago

I don't find that anyone made a claim that the program could not be fixed. Why are you suggesting to find a proof of this?

The point of course was not that what you can do, but what you should do. All cases of safe Rust compiler producing unsound code should be fixed, but the same argument is more difficult to make for C++.

Sometimes should might be different of what you must. For example, if your program exhibits unsound behavior in safe Rust (or C++) code, it's probably a lot more practical to just change the program so that it doesn't, instead of updating the compiler, unless you happen to be a Rust compiler developer. But, at the same time, you should file an issue about it.

You can of course find C++ compiler bugs as well, although I expect that to be quite rare nowadays. But the typical case is that if a C++ program exhibits unsound behavior, there is no reasonable compiler fix for it.

Then there's of course Fil-C! This improves the situation greatly by converting most interesting cases of unsound behavior into runtime errors. It seems not everyone is happy with the runtime costs of making this happen, though. And you must compile everything with Fil-C. It doesn't work with Windows or MacOS either.

Your shoulds and musts are nice and all but you said that in these situations, the rust compiler needs to be fixed when the C++ program can be adjusted.

I simply cannot imagine a situation where you can’t find an alternate solution to a problem with the compiler. Even if the compiler would optimize your intended solution away, you can write an asm! macro.

It sounds to me like you have simply decided that one language cannot do what the other can because you personally would not do it, which is very silly.

If this is not the case then I restate my request for an example, for the third time - an example would prove the point you are not making through explanation.

  • I suggest you point the exact statement where I claimed the corresponding safe Rust program is impossible to fix to avoid unsound behavior.

    I hold the argument that if the Rust compiler produces unsound behavior for safe Rust, then the compiler needs to be fixed.

    • The original comment I replied to, in which you claimed that the difference between a safe Rust and C++ program with unsound behavior is that the C++ program needs to be fixed, but for the Rust program, the compiler needs to be fixed.

      As I see it, in either case, the program can be fixed, or the compiler can be fixed. The only difference as I see it is that the C++ spec does not expect the compiler to be fixed.

      Did I misunderstand your post?

      2 replies →