Jon Gjengset (@jonhoo)
I've tried to teach intermediate Rust for years
and
I field a lot of questions from Rust developers.
There's doc.rust-lang.org, docs.rs, rustc dev guide, nomicon, cargo book, macro book, embedded book(s), cheats.rs, rust by example, rust cookbook, rust patterns, rust api guidelines, the book, StackOverflow, users.r-l.o, internals.r-l.o, Reddit, Discord(s), Twitter.
(and email/DM Jon..)
Great to have many avenues.
Very hard to navigate and discover!
There are some resources that try to organize this info, like the book of rust books, rust learning, awesome rust, and awesome rust mentors.
But those are themselves hard to find.
And all suffer from the "giant list" problem.
Can we do better?
"Known shortcomings" aren't too bad if you know.
But they're extremely confusing otherwise.
Suggests your mental model is wrong when it isn't.
Makes people give up.
Arguably fundamental, but a major stumbling block
Rc
vs Arc
Mutex
vs RefCell
vs Cell
usize
vs isize
vs NonZeroI32
vs ..Can, to some extent, be fixed with docs that explicitly show differences (tables are nice).
Can we encourage that somehow?
How do we teach "how to choose"?
As Rust gets better, Cargo pains become more visible.
Sometimes known limitations or poor diagnostics.
Often simply lack of knowledge!
No one reads the Cargo book.
Few even know it exists.
cc
? pkg_config
?git submodule
? Vendor?default-features = false
Diagnostics could help with many of these.
Clippy for Cargo!
Everyone is either too scared,
or not scared enough.
Constantly changing ground
(e.g., strict provenance).
The rules are under- or undocumented.
Unsafe Code Guidelines WG progress is slow.
Established conventions might help.
Always /// # Safety
and // safety:
.
Can we formalize as part of the language?
Miri is great, but
-Z
flagsShould work hard to stabilize unsafe-removing fns.
(e.g., [T; N]::each_mut
)
We need data.
Ask what users do not understand
or later realized they misunderstood.
Developers don't "believe" necessity claims.
Must show why Send
/Sync
/'static
/etc. matter.
Give concrete counter-examples.
Does anyone read --explain
?
Can they be repeated in docs?
Need end-to-end examples.
(e.g., https://www.rdocumentation.org/)
--timings
is great, but incomplete
(e.g., which proc macros, time spent linking)
Tracking issues should say what's blocking.
Resources need organizing.
Papercuts need fixing.
Choices need comparisons.
Cargo needs love.
unsafe needs rules.