3 ms·
Debugger visualization is a really great idea. I hadn’t thought of using attribute annotation to do it but now I’m wishing more languages had that.
by dagmx 3y ago
Debugger visualization is a really great idea. I hadn’t thought of using attribute annotation to do it but now I’m wishing more languages had that.
- jauntywundrkind 3y agoDo any other languages have anything like this debugger_visualizer attribute?
- dagmx 3y agoNot that I know of. But I’d certainly like to know that I missed it
- colejohnson66 3y agoC# has the `DebuggerDisplay` attribute: https://learn.microsoft.com/en-us/visualstudio/debugger/using-the-debuggerdisplay-attribute?view=vs-2022 https://learn.microsoft.com/en-us/visualstudio/debugger/usin...
- mihular 3y agoYes and much more like DebuggerVisualizerAttribute which allows you to present data in any possible way. https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-visualizers-of-data?view=vs-2022 https://learn.microsoft.com/en-us/visualstudio/debugger/crea...
- klysm 3y agoI guess repr is kind of similar in python but not really
- yencabulator 3y agoPython's repr is Rust's impl Debug for Foo
- fsloth 3y agoA slightly different thing - Visual Studio allows you to create custom visualizations for any live debug data. This is absolutely wonderful.
- scottlamb 3y agoOne of the nice things about Rust's RFC process for new features is they answer questions like this: https://rust-lang.github.io/rfcs/3191-debugger-visualizer.html#prior-art https://rust-lang.github.io/rfcs/3191-debugger-visualizer.ht... edit: actually, I guess that focuses more on the debugger side, and less on the language side, so not a great answer to your question.
- mark_undoio 3y agoNot exactly but for shared libraries in general it's possible to ship some accompanying Python that will get installed and automatically loaded by GDB. You can even embed that Python script within the shared object using some scary ELF tricks - I was surprised, to say the least, to discover this is supported.
- ojosilva 3y agoPerl has Smart::Comments, original work by the brilliant Damian Conway. https://metacpan.org/pod/Smart::Comments https://metacpan.org/pod/Smart::Comments