Any real world experience debugging a production functional program?

前端 未结 6 1070
执笔经年
执笔经年 2021-02-05 11:31

I\'m interested in what tools and methods are used for diagnosing flaws in large scale functional programs. What tools are useful? My current understanding is that \'printf\'

6条回答
  •  借酒劲吻你
    2021-02-05 12:13

    Sadly, printf debugging seems to be the state of practice for Standard ML, Objective Caml, and Haskell. There's a little bit of debugging at the interactive read-eval-print loop, but once your app hits 25,000 or 50,000 lines that's less useful.

    If you're lucky enough to be using Haskell, there's an exception: QuickCheck is indispensible for testing and deubgging. QuickCheck can be used even on combinations of Haskell and C code, as demonstrated by experience with the Xmonad window manager.

    It's worth noting that around 1990 Andrew Tolmach built a very nice time-travel debugger for Standard ML of New Jersey, but that it was not considered worth maintaining. It's also worth noting that at one point the OCaml debugger (also a time-travel debugger) worked only on bytecode, which was inconvneient, and refused to violate abstraction barriers, which made it useless. This was around release 3.07 or so; perhaps things have improved.

    Also in the early 1990s, Henrik Nilsson built an interesting debugger for Haskell, but mostly what it did was prevent the debugger from accidentally changing the evaluation behavior of the program. This was interesting, but only to lavzy-evaluation weenies.

    As someone who has built or worked on large applications in all three of these languages, I find the state of play depressing.

提交回复
热议问题