[Info-vax] Rust as a HS language, was: Re: Quiet?

Arne Vajhøj arne at vajhoej.dk
Tue Apr 5 20:18:09 EDT 2022


On 4/5/2022 4:21 PM, Bill Gunshannon wrote:
> On 4/5/22 15:59, Dan Cross wrote:
>> The point is that, even though C has a standard, it is riddled
>> with almost inescapable UB, and compiler writers can, and WILL,
>> take advantage of that over time.  New versions of compilers may
>> well introduce UB-based optimizations that fundamentally alter
>> the behavior and indeed the correctness of programs without the
>> programs themselves changing.
> 
> But, that was my point exactly.  A definition of "UB" means that
> particular case should never be used because the results are "UB".
> Not the fault of the language.  Not the fault of the compiler.
> Strictly the fault of truly bad programmers.

There are two schools of thought about that.

A) Those that believe that if the language/compiler allows for
    good code then all is good and when the code does not
    work then it is the fault of the programmer.

B) Those that believe the language/compiler should make
    it very difficult for developers to make bad code.

#A can be called "disaster".

#B can be called "good engineering".

Because it is irrelevant what "can be done". It is
what "is actually done" that matters.

And experience shows that if the language/compiler
allows for lots of undefined behavior then for large
projects with many developers then undefined behavior
sneak into the project.

Arne




More information about the Info-vax mailing list