I would guess because more people know C than Pascal, and it is easier
to link Ruby to C than to Pascal?
Apart from that, having programmed both C and Pascal, I only see small
differences in level. Object Pascal aside, as far as I can remember
from my Pascal programming days (15 years since I wrote my last line
of Pascal - how time flies...), there's little abstraction available
in Pascal that's not there in C - the most I can think of would be
"with" and a nicer integration of the export/import module system.
Care to enlighten me as to how you see these as being at very different levels?
Eivind.
In C, in order to call by reference, you have to pass the address
of the variable to the function.
In C, you must use too many pointers.
In C, strings can't contain ASCII 0.
In C, there is no boolean type.
In Free Pascal, you have 1- and 2-dimensional dynamic arrays,
i.e., arrays that can be resized at runtime.
In Free Pascal, you have array slicing:
average( scores[ 3..8 ] );
write( name[ 5..20 ] );
In Pascal, you can have automatic buffer-overflow checking
if you want.
In Pascal, you have sets:
if 'e' in good_chars then
"... the programming language C was designed to assist in
writing a small single-user operating system (UNIX) for a
real-time minicomputer (PDP 11), now thankfully obsolete.
For this purpose, its low level of abstraction and plethora
of machine-oriented features are entirely appropriate. For
all other purposes, they are a nuisance. The successful
propagation of the language can be explained by accidental,
commercial, historical, and political factors; it is hardly
due to any inherent quality as a tool for the reliable
creation of sophisticated programs." - C. A. R. Hoare,
1994.
One of the most famous C gurus, Kernighan, apparently
can't correct the bugs in his software because it's
written in C. He has known of this bug in awk95 for
years:
BEGIN {
FS = "@"
$0 = "foo@bar"
print $1
}
It prints "foo@bar", although it should print "foo".