[Haskell-cafe] education or experience?

Doug McIlroy doug at cs.dartmouth.edu
Mon Dec 10 01:03:35 CET 2012


> > Lazy evaluation--at the heart of spreadsheets since the beginning.

> Never thought of that  -- nice!

Unfortunately it's not literally true, because spreadsheets push
recalculated values to all the variables that depend on them,
rather than waiting until the dependent values are needed.  But
the idea that sequencing is by dependency rather than by
algorithmic specification is the same.  I remember playing around
(before spreadsheets) with the idea for Fortran-like code and 
concluding that the benefit of not having to specify sequence 
wasn't worth the effort. What a lack of imagination!

> > Pattern matching--native to string processing (e.g. COMIT, SNOBOL).
> >   Appeared nearly in its present form in COGENT (1965).

> Hmm google gives me different cogents/  I guess you are referring to the
> Reynolds one?

Yes.

> > Booleans as first class*--surely this is a joke. Algol 60 had them.

> Not sure what you are saying (unless its about the footnote that Boole
> treated bools as ints! This is new to me)  I was referring to the fact that
> C programmers have great difficulty thinking of bools as first class

Your observation is interesting. Booleans and their utility were well
known when C was designed. But since the language level was
deliberately very close to real machine architecture, which rarely
had native support for 1-bit quantities, the data type was deemed
superfluous. (If C had begun on the IBM 7030 it probably would have
have had Booleans.) I don't remember anybody predicting that the choice
risked banishing Booleans from mind.  The one deviation from real
architecture that C did embrace was to define a representation for 
the result of comparison.  That had another unpredicted consequence:
computer architects imitated the language in hardware! (C's largely
ignored bitfield capability came later and, if anything, demoted
Booleans to an artifact of structs.)

The joke I saw was that there was no way that Boolean values
had ever been denied first-class citizenship as Strachey defined
it--even if they didn't have a special syntactic identity.

> >   Matlab exploits them heavily (though represented as doubles).

> Not sure what you are referring to

I had in mind Matlab's frequent use of a Boolean array as
a characteristic function describing some property of the
elements of another array.  Such arrays are used to control
other array operations. In this usage, the characteristic
array may be optimized out of existense, but it fosters
higher-level thinking and concise code.

In reply to your second note, Malcolm Wallace is right. I did
intend to say that FP was late with lazy evaluation.  My mistake
was to think VisiCalc had appeared before 1970. Similarly,
I believed that call by need came into our vocabulary
soon after Algol 60 brought call be name and call by value to
our attention as somewhat better-behaved models than Fortran's
call by reference. Now I suspect that belief is wrong, too.

Doug



More information about the Haskell-Cafe mailing list