7 hours ago

As it turns out, even the original creator of C recognized its biggest mistake all the way back in 1990, and came up with a plan to address it. Here's the link to the paper:

https://www.bell-labs.com/usr/dmr/www/vararray.pdf

The syntax is a little weird--he uses

int (*arr)[?];

...instead of Walter's proposed

int arr[..];

...but the core idea is the same: "the pointers carry the array bounds inside themselves." That is, instead of a naked pointer, arr stores a pointer+length pair.

It's honestly kind of incredible that the C committee has been sitting on this for more than 30 years. What the heck were they thinking?

6 hours ago
On 12/8/2024 2:48 PM, Paul Backus wrote:
> It's honestly kind of incredible that the C committee has been sitting on this for more than 30 years. What the heck were they thinking?

It is amazing indeed, considering all the useless complexity they've added to C, like normalized Unicode identifiers.

Of course, C++ refuses to fix it as well.