top | item 41204324

(no title)

thurn | 1 year ago

The queryable expression thing is something I struggle with all the time in Rust. It's especially bad in that language because (unlike in e.g. Java or C#) there is no way to view the Debug representation of your types in the debugger, you just get the raw memory layout which adds a huge barrier to 'what is going on with this code?' and requires you to dig around through countless nested layers to understand it.

discuss

order

Yoofie|1 year ago

I also find this super annoying. In C++ land, Microsoft solves this problem by having "natvis" [0] files which allows you to have custom representations of complex & deeply nested objects. Unfortunately, most third-party debuggers don't support it. And like you said, any non-trivial program in Rust is basically not parsible without digger though 50 layers of nested abstractions.

[0]: https://learn.microsoft.com/en-us/visualstudio/debugger/crea...