Live data from Hacker News

Rust, RR, Neovim: A perfect debug combination

github.com

11–20 of 102 posts

Re: Rust, RR, Neovim: A perfect debug combination

#11
Anyone got other useful tools for debugging within (neo)vim? Just seamlessly putting down breakpoints, stepping through code execution, and getting a fully fledged debugging UI experience (a la Visual Studio or Remedy BG)? This is possibly the only thing I miss from developing on Windows, and it's a shame!

EDIT: I specified 'within vim' but actually I'd be down for standalone Linux app recommendations too.

Re: Rust, RR, Neovim: A perfect debug combination

#12
post #3

Investing in a good debugging tool and knowing your way around using it well, makes all the difference.

It's one of those things where 'just a puts/printf/console.log/prtln' always seems easier.

But all those tiny times add up, over years, decades. And eclipse the time of that afternoon+ spent on learning & configging debuggers in months already.

Don't be me, that senior dev who'd been promising himself for decades to really get down to learning and setting up gdbg or equivalent. And then, once invested, keeps thinking: "I should've done this years ago".

Re: Rust, RR, Neovim: A perfect debug combination

#13

Anyone got other useful tools for debugging within (neo)vim? Just seamlessly putting down breakpoints, stepping through code execution, and getting a fully fledged debugging UI experience (a la Visual Studio or Remedy BG)? This is possibly the only thing I miss from developing on Windows, and it's a shame! EDIT: I specified 'within vim' but actually I'd be down for standalone Linux app recommendations too.

nvim-dap is what’s being used the most.

https://github.com/mfussenegger/nvim-dap

Re: Rust, RR, Neovim: A perfect debug combination

#14
post #9

Funny thing is that thanks to rust compiler I never had a need to debug my code :-)

So true. With proper type driven design you basically don't need a debugger anymore.

But I still find it helpful when you need to check what's wrong in other people's code, since they might not design with types like I do.

Re: Rust, RR, Neovim: A perfect debug combination

#15
post #3

Investing in a good debugging tool and knowing your way around using it well, makes all the difference.

After recently doing some JavaScript work and not knowing how to debug it, any suggestions for a JavaScript debugger? Part of the problem is it's already difficult to get a modern JavaScript stack setup: TypeScript transpiles to JavaScript trasnpiles to different bundles that all get minified and backfilled and next thing you know your debugging a variable named i̷̪̱͆͛w̵̤̹̠͊̇̈x̷̨̻̽̍̄͆ on line 582956, and you ask your coworkers for help and none of them have ever used anything but console.log and are like ¯\_(ツ)_/¯ -- it was traumatic.

Re: Rust, RR, Neovim: A perfect debug combination

#16
post #14
post #9

Funny thing is that thanks to rust compiler I never had a need to debug my code :-)

So true. With proper type driven design you basically don't need a debugger anymore. But I still find it helpful when you need to check what's wrong in other people's code, since they might not design with types like I do.

I find myself using the debugger to explore complex types created by procedural macros. You can use cargo to expand them andnpoke around, or dump the structure to debug if it derives it, but sometimes the debugger seems easier.

Also it can help find why something three crates deep into your dependency tree panicked.

Re: Rust, RR, Neovim: A perfect debug combination

#17

Anyone got other useful tools for debugging within (neo)vim? Just seamlessly putting down breakpoints, stepping through code execution, and getting a fully fledged debugging UI experience (a la Visual Studio or Remedy BG)? This is possibly the only thing I miss from developing on Windows, and it's a shame! EDIT: I specified 'within vim' but actually I'd be down for standalone Linux app recommendations too.

termdebug (used by the tool linked in the topic) basically does this for anything you can debug in GDB. It's the tightest integration of debuggers and (neo)vim I have used.

There are also DAP-based integrations, which I have put the effort into using.

Re: Rust, RR, Neovim: A perfect debug combination

#18
post #3

Investing in a good debugging tool and knowing your way around using it well, makes all the difference.

After recently doing some JavaScript work and not knowing how to debug it, any suggestions for a JavaScript debugger? Part of the problem is it's already difficult to get a modern JavaScript stack setup: TypeScript transpiles to JavaScript trasnpiles to different bundles that all get minified and backfilled and next thing you know your debugging a variable named i̷̪̱͆͛w̵̤̹̠͊̇̈x̷̨̻̽̍̄͆ on line 582956, and you ask your…

https://stackoverflow.com/questions/34087143/load-separate-s...

Re: Rust, RR, Neovim: A perfect debug combination

#19

Anyone got other useful tools for debugging within (neo)vim? Just seamlessly putting down breakpoints, stepping through code execution, and getting a fully fledged debugging UI experience (a la Visual Studio or Remedy BG)? This is possibly the only thing I miss from developing on Windows, and it's a shame! EDIT: I specified 'within vim' but actually I'd be down for standalone Linux app recommendations too.

The overall quality of a debugger is far more important than the question of which text editor it's integrated with for me personally.

To that end I would say Intellij products have the best debugging experience I've found on Linux. VS Code after that.

Re: Rust, RR, Neovim: A perfect debug combination

#20
post #9

Funny thing is that thanks to rust compiler I never had a need to debug my code :-)

It may be true that this holds for issues related with out-of-bounds accesses or temporal safety errors, but nothing eludes your application to contain logic bugs. In fact, whenever the application is big enough and you spot a logic error, the debugging burden is still there. Good part is that the debugging utilities for C/C++ are still helpful for Rust programs.
Post reply on HN