[Haskell-cafe] Re: how do you debug programs?

Johan Tibell johan.tibell at gmail.com
Wed Sep 6 13:01:33 EDT 2006


Note: I meant to send this to the whole list a couple of messages ago
but accidentally I only sent it to Lennart, sorry Lennart!

I know that Linus Torvalds doesn't find debuggers all that useful
either and he hacks C [1].

1. http://linuxmafia.com/faq/Kernel/linus-im-a-bastard-speech.html

On 9/6/06, Lennart Augustsson <lennart at augustsson.net> wrote:
> I've also used Visual Studio, and I wouldn't mind having something
> like that for Haskell.  But I have to agree with Jon, I think the
> best way of debugging is to understand your code.  I think people who
> come from imperative programming come with a mind set that you
> understand your code by stepping through it in the debugger.  But I
> find this paradigm much less useful for functional code.
>
>         -- Lennart
>
> On Sep 6, 2006, at 06:22 , Neil Mitchell wrote:
>
> > Hi
> >
> >> But why should c and d exist at runtime? They're only used
> >> once each, so the compiler is free to replace f with
> >>
> >> \a b -> (a+b)+ a*b
> >
> > Yes, and if the compiler is this clever, it should also be free to
> > replace them back at debug time.
> >
> >
> >> I've said this before, but I think it's worth repeating: in
> >> most cases, if you need to debug your programme it's because
> >> it's too complicated for you to understand, so the correct
> >> thing to do is to simplify it and try again.
> >
> > That makes it impossible to ever improve - initially all programs are
> > beyond you, and only by pushing the boundary do you get anywhere. As
> > for me, I always write programs I can't understand, and that no one
> > else can. Perhaps I understood it when I originally wrote it, perhaps
> > not, but that was maybe over a year ago.
> >
> > It's been my experience that debugging is a serious weakness of
> > Haskell - where even the poor mans printf debugging changes the
> > semantics! And everyone comes up with arguments why there is no need
> > to debug a functional language - that sounds more like excuses about
> > why we can't build a good lazy debugger :)
> >
> > [Sorry for the slight rant, but I've used Visual Studio C++ so I know
> > what a good debugger looks like, and how indispensable they are]
> >
> > Thanks
> >
> > Neil
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list