[PRL] Benjamin Pierce: Types Considered Harmful

Matthias Felleisen matthias at ccs.neu.edu
Sat May 31 08:27:56 EDT 2008


On May 30, 2008, at 11:58 PM, William D Clinger wrote:

> Pascal was regarded as the leading typed language

... for the average PL consumer.

> and Pascal's type system wasn't entirely static.

(neither is ML's; as someone else said, you assume
memory safety for type soundness and that is dynamic)


> Those subrange checks were type
> checks, because subranges are actual types in
> Pascal; they were also expensive, because none of
> the early Pascal compilers made any attempt to
> optimize them away.

Just to confirm this on an anecdotal basis:

My first industry job involved real time programming
for distributed systems in Pascal. (In 1980/1981 this
was considered advanced and heretical and impossible.)
One of the stunts my boss pulled was to study how the
commercial compiler produced code and to remove by
hand run-time checks for ranges IF we could "prove"
they were superfluous. I was one of a handful of
people he hired out of college to do just that.
When he realized we didn't have a real "proof",
he'd leave those checks in, including the worst
inner loop I ever worked on (a menu controller).
Our code still ended up faster than the highly
developed ASM code for the same task. The effect
was so stunning to the rest of the company that
my boss got fired over this rewrite of an ASM
system in Pascal (faster development, faster code).
(The shop was highly unionized and pulling such
stunts was anti-community behavior.)

I left the company to get my PhD. -- Matthias




More information about the PRL mailing list