Well, I've been learning a lot from the discussion here about my cryptarithm
program.  Seeing the same problem implemented in different ways has really
given me a better idea of what Haskell can do.

A few observations:
1.  The people on the Haskell mailing list are a friendly, helpful gang!
2.  The compiled versions of a program run significantly faster than
interpreted.  (I sort of assumed that the compiled code would effectively
just run an embedded version of the interpreter, so I thought I'd actually
get faster performance by just loading up the interpreter first, and then
judigng the run time from within the interpreter).
3.  It appears that there are significant speed gains when you explicitly
describe the types.  I don't really understand yet how the Haskell type
system works; I glossed over it because the tutorial implied that most of
the time declaring types was optional -- Haskell can infer if you leave it
out.  So I left out all type declarations, and it looks like that's a big
reason the program ran slowly.
4.  Andy Gill's general solution is most impressive, and I hope that I
eventually get to the point where his program makes sense to me.  I don't
quite understand Monads and some of the built-in functions enough to follow
it.  (Monads are Haskell's way of making imperative and mutative programming
harder to do so that programmers are less likely to do it, right? :))

As for the overall philosophical issues that people have raised here as to
whether my question was "fair", I'll throw in my two cents.  One person was
under the impression that I picked this puzzle because it was a problem that
I knew could be solved well in C++ and I already had an imperative-style
solution in mind.  That's not true.  This was simply a problem that I ran
across in a conversation with a friend, and I wanted to solve it in any
possible way.  Just for fun, I decided to try it in Haskell _and_ C++, using
whatever built-in functions and strategies that the language seemed to lend
itself to.  I think most of you took it in the spirit I intended, and the
feedback you've given me has been quite valuable.

Thanks,

Mark Engelberg



Reply via email to