Debugging Go code (a status report)
blog.golang.org
blog.golang.org
Creating a programming language by itself isn't all that hard. The real work is actually making it usable with good error messages and stack traces, tools like debuggers and profilers, editor support (if you're into that sort of thing), and documentation and specs. All of that (especially good editor support) is easily an order of magnitude more work than a parser and a compiler, and that doesn't even consider libraries you might need to write if you can't interoperate with an established language. (Spoken from personal experience, for what it's worth).
One of there reasons new langauges are often targeting the JVM or the CLR. You can reuse most of the tools and libs with less work.
When it comes to debugging, nothing beats a few strategic print statements to inspect variables or a well-placed panic to obtain a stack trace.
I respectfully disagree with this statement.Beyond simple issues a debugger is invaluable for following program flow and inspecting variable/memory states.
And why does "missing .. patience" mean you are more likely to use a debugger over a print statement?
Anyone got any good debugging war stories?
But more seriously: one of Go's selling points is fast compilation times. Even for large projects compilation is mostly I/O bound, which typically means sub-second compiles.
http://swtch.com/plan9port/man/man1/acid.html
You can debug a kernel on a remote machine with a different architecture.
Shame that we've got to go back to the dark ages of GDB for Go.
However print statements become my go-to tool when debugging multithreaded code.