
On 07-May-2005, Hamilton Richards
As far as I know, the last programming language that included arrays' sizes in their types was Standard Pascal,
There have been many such languages since Standard Pascal. For example C, C++, C#, Java, Ada, VHDL, and NU-Prolog.
and it turned out to be an unmitigated disaster. Because array parameters were typed with their sizes, a procedure for searching arrays of size 100 could not be used for arrays of any other size. Every useful (non-Standard) dialect of Pascal provided a way around that restriction, as did Pascal's successor, Modula-2, and as far as I know the mistake has not been repeated.
The disaster was the lack of polymorphism in Pascal's type system,
not making array sizes part of their types.
The languages above all have some means of writing a procedure
that works for different sized arrays, whether it be using
pointers (in C), templates (in C++), unconstrained array
parameters (in Ada and VHDL), or inheritence (in C# and Java).
Another example of a programming language for which array lengths are
part of their type is Cryptol