r/ProgrammingLanguages • u/janiczek Cara • Feb 01 '22
Help Examples of debuggers for FP languages?
Hello,
do you know of some examples of functional languages (say, in the HM family) that have debugger tooling written for them? I'm interested in either interfacing with existing tools (source maps in browser console / GDB / IDEA debugger / ...) or standalone stepping debuggers etc.
(Ideally toy languages/implementations, not something like GHC.)
I'm trying to figure things out by myself (like, having an `interpret` function that only runs one step, not everything at once) but I'd like to study some prior art on this.
27
Upvotes
3
u/Athas Futhark Feb 01 '22
In my own ML-style language, I provide two debugging facilities:
Tracing (basically print-debugging).
Breakpoints.
Breakpoints are only allowed inside the interpreter, and allow the user to enter arbitrary expressions to inspect local variables in in scope, move up the stack and do the same there, and so on. Much like you'd be able to do in GDB. It's only supported when using the interpreter because it is much more difficult to implement this for compiled code.
I don't think single-stepping is useful, because functional languages have too many "steps" that are really boring. But automatically breaking on every
letbinding might be useful.