Improve debugger visualization for `ndarray` arrays using `#[debugger_visualizer]`
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reviewing discussions in issues #827 and #366, then read the Rust Reference debugger attribute documentation and the Rust Compiler Development Guide section on supported debuggers. Evaluate whether embedding Python pretty-printers and .natvis files with #[debugger_visualizer] is feasible for ndarray arrays. Done means a decided approach for official debugger visualization support.
Written by the indexing model from the issue text.
Description
This issue has been discussed in #827 and #366, but it remains partially unresolved.
Problem and Previous solution
When debugging ndarray arrays in VSCode, their display is often not human-readable:

However, with this custom formatter.py file (along with some additional configuration), the display becomes much more readable:

(This solution was originally provided by @MartinRJDagleish in this comment)
More Discussion
The #[debugger_visualizer] attribute has been stabalized in Rust 1.71.0 for 2 years, which can be used to embed a debugger visualizer file into the debug information. This means we can write pretty-printer files (Python script, for GDB and LLDB) and .natvis files (for Windbg) for ndarray arrays, and embed them into the Rust code using the attribute, to provide official support for debugger visualization of ndarray arrays.
I'm not sure whether it is a feasible approach, but I'm glad to have a discussion.
Relevant Links
-
The Rust Reference: Some examples to use
#[debugger_visualizer]attribute. -
Rust Compiler Development Guide: Describes the underlying implement in Rust compiler.
- Dominant language
- Rust
- Stars
- 4.3k
- Forks
- 391
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-ndarray/ndarray
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
rust-ndarray/ndarray#1612 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1617 · 1 comment ·
-
bug good first issue
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rust-ndarray/ndarray#1615 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
rust-ndarray/ndarray#1610 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
rust-ndarray/ndarray#1609 ·
All issues in rust-ndarray/ndarray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100