News for hackers. Stuff that matters.
Re:Implementing Rust's dbg! in Python by drewm1980 on Friday December 11, 2020 @12:50PM (#25388505)
Might be worth mentioning that you do not have to resort to printf debugging in Rust or python; both languages have good ide debugger support. I use python and rust together professionally.
Re:Implementing Rust's dbg! in Python by damnyou on Friday December 11, 2020 @01:10PM (#25388720)
printf debugging (i.e. listing code execution traces) is better than a breakpoint-based debugger in most situations, in my opinion.
Re:Implementing Rust's dbg! in Python by breuleux on Friday December 11, 2020 @01:42PM (#25389092)
For what it's worth, I made a Python package that lets you combine both approaches: https://github.com/breuleux/breakword. You run your program once to print out what's going on, but it also displays a unique word next to each line and on a second run you can set a breakpoint at any of these words to investigate deeper. It's pretty handy when you spot an issue at the hundredth invocation of some function deep in the program's execution.
Re:Implementing Rust's dbg! in Python by a_t48 on Friday December 11, 2020 @06:10PM (#25392889)
That's really awesome.
Re:Implementing Rust's dbg! in Python by brundolf on Friday December 11, 2020 @12:59PM (#25388612)
For something quick, it's often more ergonomic to just print a thing out than step through. Also, most debuggers also won't be very helpful for embedded expressions; you have to break it out into a local variable.
Re:Implementing Rust's dbg! in Python by 0x008 on Saturday December 12, 2020 @11:00AM (#25399032)
You can set a breakpoint and also watch expressions, so there is not more work involved than hitting 2 keyboard shortcuts usually.
Re:Implementing Rust's dbg! in Python by int_19h on Friday December 11, 2020 @09:07PM (#25394616)
They do, but sometimes you have to debug in an environment where an IDE is not available, and even remote attach can be problematic sometimes.

And then, sometimes, you need to debug the debugger...

Re:Implementing Rust's dbg! in Python by colejohnson66 on Friday December 11, 2020 @01:11PM (#25388740)
Would this make sense in a logging situation?