-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.
Description
https://doc.rust-lang.org/stable/book/the-stack-and-the-heap.html includes many large tables with some connection to code, but they and the transitions between them are somewhat complicated. So one (somewhat) low-hanging fruit for improving the stack v. heap documentation would be using more colours to connect stack variables with the function they come from.
E.g. "Let’s try a three-deep example:" could look like
fn red() {
let i = 6;
}
fn blue() {
let a = 5;
let b = 100;
let c = 1;
red();
}
fn main() {
let x = 42;
blue();
}
(There's a mistake in the text: "And then red()
calls blue()
" should be "And then blue()
calls red()
".)
It would be important to just use these as an extra piece, not core to the explanation, for (colour-)blind people.
Inspired/suggested by @velartrill on twitter, who also suggests using greys in a slightly different way.
Metadata
Metadata
Assignees
Labels
E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.