D mentioned on Rust discussions site

Araq rumpf_a at web.de
Tue May 26 07:09:38 UTC 2020


On Saturday, 23 May 2020 at 02:26:38 UTC, Walter Bright wrote:
> On 5/22/2020 12:08 AM, Araq wrote:
>> [x] Users had to patch every function in order to get type 
>> safety. Check.
>
> They didn't have to change anything. The following code 
> compiles today on gcc:
>
>     foo(i, j) { return i + j; }
>
>
>> [x] Compiler writers had considerable effort in implementing 
>> the new standards. Check.
>
> Nope. (Note that I speak from actual experience.) Want 
> something that's hard to implement? See exception handling, 
> which wasn't added.
>
> Ya know, I've actually implemented a K+R compiler, then 
> upgraded it to C89, then C99. You've got a very tough hill to 
> climb trying to tell me what is hard to implement and what 
> isn't.
>

Well your C99 implementation isn't widely used and if you were to 
do it properly, you would have had to review every line of code 
in your optimizers to see if they break the new threading model 
in subtle ways. I guess you didn't do that, so C is still a 
simple language to implement when you don't try too hard and have 
few if any users.

>
>> [x] New features like overloading, and type system extension 
>> like 'const' or 'restrict' were added. Check.
>
> Overloading was not added. 'const' was added, but could be 
> ignored, and did not result in any significant coding style 
> change. I already discussed 'restrict' which remains unused.
>

Overloading was added, see the _Generic keyword in C11.

>
>> [x] New code doesn't compile with older compilers without 
>> jumping through all sort of hoops. Check.
>
> That's true of any new feature, trivial or not.

Exactly, that's the point. C isn't special.


More information about the Digitalmars-d mailing list