← Back to context

Comment by devmor

10 days ago

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?

    • I would say as stated there were two ways to read the claim:

      - either that the claims are paired as you say (the second one implying that the program cannot be fixed),

      - or that the claims are completely distinct, that simply state the desirable state of things.

      Using the second interpretation, the corollaries would be:

      - there is (typically) no reasonable fix for the C++ compiler that would address the UB. Therefore to fix the UB all C++ programs exhibiting the same need to be fixed, which is hard, as the compiler will keep accepting them.

      - once the Rust compiler is fixed, then all safe Rust programs exploiting the bug must now be fixed, or the compiler will reject them.

      What I would sign under would be the second interpretation, not the first one. But I intentionally also selected the particular ambiguous form due to the cutesy, albeit misleading, symmetry of the statements.

      1 reply →