Hacker News new | ask | show | jobs
by Animats 588 days ago
The only time I use a debugger with Rust is when unsafe code in some library crate messes up. My own code has no "unsafe". I have debug symbols on and a panic catcher that displays a backtrace in a popup window. That covers most cases.

Rust development is mostly fixing compile errors, anyway. Once it compiles, it often works the first time. What matters is compile time for error compiles, which is pretty good.

Incremental compile time for my metaverse client is 1 minute 8 seconds in release mode. That's OK. Takes longer to test a new version.

1 comments

Debuggers are not only useful for actual debugging as in 'finding and fixing bugs', they are basically interactive program state explorers. Also "once it compiles, it works" is true for every programming language unless you're a complete newbie. The interesting bugs usually only manifest after your code is hammered by actual users and/or realworld data.
You're obviously not a Rust programmer.
Rust only protects from a very small subset of bugs (memory corruption issues and data races) but not from logic bugs which are far more common.
Rust protects against undefined behavior. This is enough that programs either panic in a well-defined way, or continue to run well enough that logging works.
Not having UB isn't exactly unique to Rust though (Rust does have some UB btw it's just not as easy to encounter as in C or C++).