Mailing List Archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] From an enthusiast TLUG follower

On Mon, 31 Aug 2020 at 02:03, Stephen J. Turnbull <> wrote:
Benjamin Kowarsch writes:

 > Subrange types were a Pascalian innovation. I don't know of any curly
 > braces language that adopted them. Do you know of any?

I'm sure Pascal did not check subranges at compile time.

First of all, it is irrelevant whether or not early Pascals did compile time checking of subranges.

I wrote that Pascal *introduced* subrange types while C and its brethren did not have subrange types, nor do they have them today.

That is very easily verifiable. Or are you trying to suggest that Pascal did not actually introduce subrange types? Or are you trying to suggest that C and its brethren did and/or does have subrange types, but simply doesn't check them? Either way, such a claim would be manifestly false.

Nevertheless, Wirth's (or more precisely ETHZ's) Pascal compiler did implement compile time _expression_ evaluation even if Wirth's (and coauthor Kathleen Jensen's) Pascal User Manual and Report did not distinguish between compile time and runtime expressions, nor mandating compile time evaluation of expressions with only constant terms.

This became common practice and was then formally specified in ISO Pascal.

Pascal uses type promotion, which means (1) mixed type expressions are permitted and (2) terms of a type of a smaller range are automatically are converted to the type of the term with the largest range in a mixed type _expression_.

This means, given the declarations

type octet = 0..255;

var n : octet;

procedure p ( value : octet );

an _expression_ of the form


is promoted to type integer, and thus there is no compile time error.

BUT, you will get a compile time error for statements of the form

n := 1000;


because 1000 is a compile time _expression_ and of type integer.

 > Once upon a time there were Dykstra, Hoare and Wirth preaching
 > type safety and their teachings had weight.

Yup.  The programs and languages that followed their teachings were so
weighty they sank in the quicksand of real problems without a trace. ;-)

Is this an attempt at sarcasm?

Dykstra, Hoare and Wirth always promoted simplicity, and the languages that came out of that tradition are all known to be lightweight.

The only language one might consider within that tradition which is not lightweight is Ada. And Tony Hoare made Ada the sole focus of his Turing award acceptance speech "The emperor has no clothes" in which he lambasted Ada precisely because it wasn't lightweight. Mind you, compared to the modern day egg-laying wool milk sow languages, even Ada appears rather moderate in weight.

And Wirth is known to be a minimalist. In his later years his minimalism went so far, that the vast majority of the once many fans of his languages Pascal and Modula-2 did who liked them precisely for their simplicity, did not want to follow him when he created his next language Oberon, which he stripped down to the bones, the most minimalist language until Brainfuck arrived on the scene. Wirth boasted that the language description fits on 16 A4 pages and his compiler is only 5000 lines of code. Yes, he did remove subrange types in Oberon, but most people would argue that this is in violation of the very philosophy he stands for.

Clearly, if you call these languages "weighty", you must be joking.

And as for sinking into the sand, the languages of this tradition were extremely successful and influential. Pascal and Modula-2 were amongst the most popular and most widely used languages in their day. Pascal was also very influential. The GUI desktop, Ethernet and laser printer coming out of PARC was powered by Mesa, which was PARC's system implementation language and it was of the Pascal tradition, albeit with weird syntax like square brackets where just about every other language would use parentheses, but structurally and design principle wise nevertheless a close Pascal descendant. Mesa begat Ada, Modula-2 and Cedar, which begat Oak, later renamed Java. And C# is very much directly influenced by Pascal as its creator was the chief designer of Delphi, formerly known as Turbo-Pascal.

I wouldn't call that "The programs and languages that followed their teachings were so weighty they sank in the quicksand of real problems without a trace". In fact nothing in that sentence makes any sense. They weren't weighty, they didn't sink, and they left plenty of traces.

Oh, no, you don't.

Not sure what this is supposed to mean, it does not even match grammatically, because I didn't make any statement about what I do.
Before Linus came Richard (Gabriel, 1989)., read the whole thing,
but pay careful attention to paragraphs containing the word "virus".
OTOH, python -m this is shorter (though later, Peters, 1999).

I know Gabriel's essay and I have also read statements of him made years later in which he lamented that people have misunderstood him in taking the headline literally when he was actually trying to express the exact opposite. His essay describes a trend and says that this trend is bad. I was saying the same thing.

 > The industry is now ridden with people who think type systems and
 > strong typing are something that belongs into a museum.

Those people have names, you know, like "CIO" and "CTO". :-)

Oh really? What then of the large crowd using all those egg laying wool milk sow languages, none of which is designed around type safety, even if some of them pay lip service to type safety, but that's not the same thing as designing for type safety.


Home | Main Index | Thread Index