D mentioned on Rust discussions site

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat May 23 23:50:55 UTC 2020


On 5/23/20 4:11 PM, Dibyendu Majumdar wrote:
> 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.

It would be in plain sight, the point being it's associated with the 
pointer. Right now there's a cottage industry of analysis tools figuring 
out which size parameter matches which pointer parameter.

This "no fat pointers" decision cascaded into another disastruous choice 
- zero terminated strings. Worse than even autodecoding :o).


More information about the Digitalmars-d mailing list