D mentioned on Rust discussions site

Patrick Schluter Patrick.Schluter at bbox.fr
Fri May 22 05:32:52 UTC 2020


On Thursday, 21 May 2020 at 20:34:19 UTC, Walter Bright wrote:
> On 5/21/2020 3:57 AM, Patrick Schluter wrote:
>> ANSI C89 and then C99 changed C significantly. Some of the 
>> features introduced make modern C quite different from the 
>> initial K&R C.
>
> Sorry, nope.
>
> What C89 mostly did was clear up unspecified areas in K+R that 
> had resulted in incompatible compilers. In particular, whether 
> value-preserving or sign-preserving integral promotions were 
> done. About half the compilers did it one way, half the other.
>
> Value-preserving rules were selected, and the out-of-luck C 
> compiler vendors were pretty graceful in accepting the changes 
> for the greater good.
>
> Another was clearing up confusion in how the preprocessor was 
> supposed to work.
>
> C99 mainly cleared up a lot of uncertainty in IEEE floating 
> point arithmetic, by stamping approval on the obvious things 
> the C compilers were doing anyway. C99 added a couple new 
> features, which were badly designed and remain unused - things 
> like 'restrict' and that weird way to allocate arrays on the 
> stack. Oh, and those miserable trigraphs, which were never used 
> outside of test suites.
>
> Maybe you're talking about function prototyping. They were very 
> welcome, indeed, but they didn't make C "quite different" at 
> all.
>
> A "quite different" change would be something like adding 
> modules, or getting rid of the preprocessor.

  As a C user I can only witness the impact on the use of the 
language not on its implementation. Some of the features 
introduced had quite the impact in the the resulting code, but 
were minimal to implement as they were already C++ features like 
the for with variable definition, variable definition anywhere.
I guarantee that if you tried to translate one of my current C 
code to an ancient compiler it would be a pain to get to work. 
Alone the preprocessor varargs would make porting to pre C99 very 
difficult endeavour.

This said, while the changes might be more conservative than to 
what happened to other languages, your statement that C hasn't 
evolved is simply false.


More information about the Digitalmars-d mailing list