D mentioned on Rust discussions site

Dibyendu Majumdar d.majumdar at gmail.com
Sat May 23 20:11:17 UTC 2020


On Saturday, 23 May 2020 at 17:08:10 UTC, Andrei Alexandrescu 
wrote:
> On 5/23/20 9:18 AM, Dibyendu Majumdar wrote:
>> On Saturday, 23 May 2020 at 02:37:23 UTC, Walter Bright wrote:
>>> C missed some obviously great ideas. One is nested functions, 
>>> which fit right in with C's semantics. The other is the fix 
>>> for:
>>>
>>> https://www.digitalmars.com/articles/C-biggest-mistake.html
>> 
>> I do not think it was a mistake at all. Treating pointers and 
>> arrays uniformly is one of the great innovations in C.
>> 
>
> There's no doubt in my mind that the absence of a universal 
> "doped pointer" (pointer plus extent) built-in or standard 
> library in C has caused innumerable problems. The fact that 
> early C versions could not return structs by value might have 
> contributed to that decision.

A doped pointer or hidden length would not be in the spirit of C.

I would agree that the standard library could have been better 
designed but that is a different problem.

C was designed as a replacement for assembly - not another high 
level language.  Of course C is unsafe for general purpose 
programming - it wasn't designed for that. C treats memory as a 
blob to be manipulated - types are there to help you do that more 
easily but that is all they do.


More information about the Digitalmars-d mailing list