[TUHS] C vs Pascal thoughts - was Buffer overflow found/fixed in v4 tape ; )

Clem Cole via TUHS tuhs at tuhs.org
Tue Jan 6 04:16:44 AEST 2026


Moving to COFF, bcc  TUHS

On Mon, Jan 5, 2026 at 12:47 PM Bakul Shah <bakul at iitbombay.org> wrote:

> Actually Pascal got a lot of things right. Coming from being intimately
> familiar with Pascal and its orig. compiler, I disliked these things in C:
> 1. poor array support, no multi-dim arrays
> 2. C's union type vs Pascal's variant records
> 3. no subrange type
> 4. C's poor type system
> 5. C's enum type which are essentiall integers vs Pascal's strict
> enumeration type
> 6. No nested functions.
>
> [Of course, there were many things to like in C as well.]
>
> Granted, it was not as clean and orthogonal as Algol68 (whose popularity
> suffered from surface issues such as use of vW grammar od choice of
> keywords
> etc.).
>
> Also note that pretty much all non-C compilers pre-1988 generate code to
> do bounds check -- at least as an option but more often the option was to
> turn *off* bounds check!
>
> Now that we are aware of the danger of no bounds check, we seem to have
> gone
> to other extreme of using complicated languages like Rust....


I, too,  don't "hate" Pascal and don't argue with the strengths it
demonstrated.  But I have one primary issue: *"Which Pascal do you
mean?"  *When
I worked at Tektronix, Ward Cunningham and I counted 14 different "Tek
Pascals" in use at the time.  The paper "*Why Pascal is not my Favorite
Programming Language*" [
https://web.archive.org/web/20060821183401/http://cm.bell-labs.com/cm/cs/cstr/100.ps.gz
] offers up the fundamental issues.  I suggest looking at Ward's Wiki [
https://wiki.c2.com/?WhyPascalIsNotMyFavoriteProgrammingLanguage ] as there
are some interesting comments.

I think this observation is also important:

> "Interestingly, many of Kernighan's objections to Pascal are things that
> Knuth also found it necessary to address in his LiterateProgramming
> <https://wiki.c2.com/?LiterateProgramming> tool "Web", which he used in
> the development of TexTheProgram <https://wiki.c2.com/?TexTheProgram> and
> Metafont. It is fair to say that the Web system is only half about
> LiterateProgramming <https://wiki.c2.com/?LiterateProgramming>; the other
> half is just workarounds for the shortcomings of the Pascal dialects of its
> day. Most notably, Web provides a mechanism to allow the use of
> variable-length strings in things like error messages."


More information about the TUHS mailing list