<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><BR class="khtml-block-placeholder"></DIV><DIV><DIV>On 06/09/2006, at 17:10, Andrae Muys wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><BR><DIV><DIV>On 06/09/2006, at 8:22 PM, Neil Mitchell wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">It's been my experience that debugging is a serious weakness of</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Haskell - where even the poor mans printf debugging changes the</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">semantics! And everyone comes up with arguments why there is no need</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">to debug a functional language - that sounds more like excuses about</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">why we can't build a good lazy debugger :)</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">[Sorry for the slight rant, but I've used Visual Studio C++ so I know</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">what a good debugger looks like, and how indispensable they are]</DIV></BLOCKQUOTE></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I simply can't let this pass without comment.  It's irrelevant if you're using a functional or imperative language, debuggers are invariably a waste of time.  The only reason to use a debugger is because you need to inspect the contents of a processes address-space; so either you're using it as a disassembler, or you're using it to examine the consequences of heap/stack corruption.  Consequently, if you're using Java, C#, Scheme, Haskell, Erlang, Smalltalk, or any one of a myriad of languages that don't permit direct memory access, there's no reason for you to be using a debugger.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Jon understates it by implying this is a Functional/Haskell specific quality - it's not.  Debuggers stopped being useful the day we finally delegated pointer handling to the compiler/vm author and got on with writing code that actually solves real problems.</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>You seem to base everything on the assumption that a debugger is a program that lets you, and I quote your words below, "trace through individual lines of code".</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>A debugger in the sense that this post regards it is any kind of program that helps you to understand a piece of code. A debugger is the program that tries to answer the following questions:</DIV><DIV>"What information can we provide to the programmers about how a program is running?"</DIV><DIV>"What information will help the programmer most?"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>If it happens that traditionally debuggers are based in inspecting the memory, this is an unavoidable situation considering the history of programming languages. But certainly there are many other possibilities that can help a programmer to manage the complexity of a running program, and it seems as if you disregard them all completely in your argument !</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV></DIV><DIV>It's just that historically functional programmers have tended to already be experienced programmers who realise this.  Why would they waste their time building a tool that no-one needs?</DIV><DIV><BR class="khtml-block-placeholder"></DIV></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This whole block is offensive to the rest of the world. Fortunately it has nothing to do with reality:</DIV><DIV> - the recent GHC survey uncovered "some kind of debugger" as the most demanded tool</DIV><DIV> - Other functional languages have seen magnificent efforts in the debugging camp, such as the awesome Ocaml debugger or the now sadly defunct ML Time-Travel debugger from A. Tolmach</DIV><DIV> - The Lispish languages, which are arguably on the functional side too, have always  enjoyed impressive online debugging tools.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV></DIV><DIV>It's a truism to say if your code doesn't work it's because you don't understand it; clearly if you did understand it, you wouldn't have included the bug that's causing you difficulty.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Therefore either</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1) The code is poorly structured and you need to restructure it to better represent your understanding of the problem</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>or</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>2) Your understanding of the problem is flawed, so you need to sit back and reexamine your thinking on this problem in light of the counter-example you have found (the bug).</DIV></BLOCKQUOTE><BLOCKQUOTE type="cite"><DIV></DIV><DIV>Spending your time tracing through individual lines of code is counter-productive in both cases.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Andrae Muys</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>P.S. It is worth noting that I am here talking about the sort of debugger raised in the original post.  I am not talking about using a separate tool to extract a stracktrace from a core file in a C/C++ program or equivalent - I'm talking about runtime debugging with variable watches, breakpoints, and line-by-line stepping.</DIV><BR></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><BR><BLOCKQUOTE type="cite"><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Andrae Muys</DIV><DIV><A href="mailto:andrae@netymon.com">andrae@netymon.com</A></DIV><DIV>Principal Kowari Consultant</DIV><DIV>Netymon Pty Ltd</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Haskell-Cafe mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>