PASCAL as a systems programming langugage
Doug Gwyn <gwyn>
gwyn at brl-tgr.ARPA
Fri Jan 11 18:55:46 AEST 1985
> ... The current state of the UN*X kernel (ever looked at namei or ever
> wondered where all these unreferenced inodes come from) and the UN*X
> utilities ("My sendmail has a bug!") seem to indicate that 'C' is not
> that easy to debug either.
This argument is totally bogus. You can't prove anything about the
relative merit of two languages by pointing at bad examples of either.
(Not to imply that UNIX is all that bad.) By the way, what
unreferenced inodes? I never noticed that problem..
> Indeed, no pointer arithmetic. Using arrays and indices instead is a
> lot more portable ...
There is nothing unportable about C pointers that are used in accordance
with the language rules. C's convenient pointers are one of its
significant advantages for implementing systems efficiently.
> PASCAL is written such that the compiler has a lot of freedom in
> optimising the code. 'C' code, on the other hand, is very hard to
> optimise, just because 'C' allows you to do funny things like get a
> pointer to any variable anywhere &c.
Yes, C was designed to provide that level of control. Traditional
optimization is much less important when the language is that close
to the machine already.
> So what? Why does the whole world have to look like '&&' and '||'?
> Use 'IF' instead, it might even come out more readable.
Using multiple "if"s is definitely LESS readable and is why && and ||
were invented in the first place.
Using J&W Pascal as a systems implementation language is much like
using Small-C or some similar emasculated C subset. Sure, one can
do it (with some amount of cheating), but C was deliberately designed
to facilitate systems implementation and it is pretty good at that.
There are several improvements one would like to see (many of them
are in C++), but following the Pascal model is not one of them.
I note with disgusted amusement that C is the only significant major
language that was not considered in the Ada project.
More information about the Comp.lang.c
mailing list