Mailing List Archive


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

Re: [tlug] Functional Programming Group Meeting



Curt Sampson writes:

 > I guess you're thinking of a different issue than the one I know about.
 > Send me the details, if you like, and I'll look into this.

They're on darcs-devel.  I don't really care any more; Darcs is dog-slow
compared to git in any case, and I don't expect that to change because
the problem it solves is inherently harder than the one git solves.

 > > I'm not claiming that average case is bad.  I'm claiming that worst
 > > case can be surprisingly bad.
 > 
 > So, would you also claim that in non-lazy languages the worst case can
 > also be surprisingly bad?

No.  It's a matter of what people are used to.

Haskell is a research language, and almost by definition most people
will not be used to it.  And I've seen people for whom it is the
weapon of choice get bad results from it.

 > When I set up the full search tree for a problem and start
 > searching it, it suprises me now that the computer went and did
 > about a hundred CPU-years of computations that it then threw away
 > becuase they were never used.

"The doctor says to put down the hammer."

And what do you do if you need that same search tree for 1000
searches?  It's not like

(defun get-search-tree ()
  (or search-tree-cache (setq search-tree-cache (compute-the-cache))))

hasn't been an idiom since John McCarthy was an assistant professor.
It's not that hard to express lazy construction in a similar fashion
(but I'm out of practice and in a hurry, so I won't do it right now).
Sure, Haskell generalizes and automates this to some extent with
memoization, which is nice.

 > Haskell certainly needs a different way of thinking. However, saying
 > that "commonly used" algorithms have "suprising" behaviour is about the
 > same as complaining that one's good algorithms don't work in Smalltalk
 > because it doesn't have a computed GOTO.

No, it's not the same at all.  When TOOWTDI[1] is an imperative, "that
way is efficient" is also imperative.  If it can't be done "that way"
then of course "that way" doesn't need to work, let alone be fast.

Footnotes: 
[1]  GOTO shell, type "python", and then "import this".



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links