Debugging haskell

Andrew Moran
Mon, 24 Feb 2003 07:22:18 -0800

Dave Tweed wrote:

> If you discard `compliation preventing, very very quick to solve' bugs
> (e.g., missing semi-colons in C++, silly typecheck errors in Haskell) I
> find that the ratio between source code bugs and algorithm bugs is mayb=
> 1:5. This means that whilst I find Haskell a great deal easier to write
> correctly than C++, there's not that much difference between debugging
> times for Haskell and C++ because the algorithm level bugs dominate.

In my experience, the number of algorithm bugs is usually about the same,=
regardless of which language you're using.  And simple source code bugs a=
no real problem in any language.  But because there's more translation=20
involved in rendering a mental model of an algorithm in C++ than in Haske=
there's much more opportunity for introducing more subtle source code bug=
s. =20
I find that I very rarely have these kinds of bugs in Haskell (and the=20
type-checker usually catches them anyway), but they were always the large=
proportion of bugs when I used to program in C, etc.


Andy Moran                                              Ph.  (503) 526 34=
Galois Connections Inc.                                 Fax. (503) 350 08=
3875 SW Hall Blvd.                                    http://www.galois.c=
Beaverton, OR 97005                                        moran@galois.c=