by Rayhem · 3y ago · 0 comments
5 | let scores = inputs().iter().map(|(a, b)| {
| ^^^^^^^^ creates a temporary which is freed while still in use
is easier to make accessibility tools for than In file included from /usr/include/c++/4.6/algorithm:63:0,
from error_code.cpp:2:
/usr/include/c++/4.6/bits/stl_algo.h: In function ‘_RandomAccessIterator std::__find(_RandomAccessIterator, _RandomAccessIterator, const _Tp&,...rustc’s (default) “human” error format is going to be very messy for screen readers to follow, because it has a lot of visual alignment and decoration. You’re going to have to leap through hoops to make it decent for accessibility tools, whereas that C++ compiler’s output might not be quite so bad in some ways. (To clarify: I expect that both tools/formats are bad for blind users, in different ways. For sighted users, I don’t think there’s much of a contest—but the distinction is in the diagnoses more than their presentation, so this difference is about everyone, not blind people.)
But I think blind people probably genuinely shouldn’t be caring much about the error messages as they appear in a terminal these days, because this span formatting is always going to be lousy without very fancy tooling to sanely contextualise it, and guess what? There kinda is such tooling already: IDEs (and with the advent of LSP, it’s even broadly cross-language). Use something like rust-analyzer with your Vim + coc.nvim (what I use) or VS Code (the most popular choice) or whatever, and you can jump between error locations easily and have it all presented with your code, rather than separately. That way, the only accessibility support required is in the IDE, and that you have a language server (which people will want anyway ’cos they’re handy).
(Since I mentioned Rust’s error formats, relevant reading: `rustc --error-format=…` <https://doc.rust-lang.org/rustc/command-line-arguments.html#...>, and `cargo build --message-format=…` <https://doc.rust-lang.org/cargo/commands/cargo-build.html#op...>. My guess is that blind people would probably be better served by the “short” error format, or by tooling that consumes the “json” error format… like rust-analyzer.)
The big problem I see is that the ASCII art output relies heavily on contextual cues, pointing into user code that might be too long and with messages that easily go beyond the capabilities of a Braille display. There are mock ups I've done, removing and rearranging things to build output that works as if someone was talking to you, but don't have the expertise to say that it works for the target audience.
If there are people with relevant expertise reading this, I would love to pick your brain. There are simple questions like "is it useful to truncate paths to be just the file name and let users rely on their tools fuzzy search to find them?" or "is it better to just mention the place in the file we are talking about and not display a snippet? Same for suggestions?"
Ideally we'd provide a more narrative output with something like "file.rs, line 5, column 17, fn call to inputs creates a temporary which is freed while still in use". This would simultaneously be better for blind users, and give the people clamouring for more compact output an alternative.
With rust there's no buffer overflows, how will folks buy supercars to crash in the desert after escaping "flyover country"
(In all seriousness, people were obsessed with it at Mozilla but also just kept hazing me I was "just" a UX researcher -- do you know of a good primer who knows the basics of languages like Python, bash, and QBASIC but struggles with compiled languages like C/C++?)