Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack vs. Heap documentation could use more colours #29854

Closed
huonw opened this issue Nov 16, 2015 · 4 comments
Closed

Stack vs. Heap documentation could use more colours #29854

huonw opened this issue Nov 16, 2015 · 4 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@huonw
Copy link
Member

huonw commented Nov 16, 2015

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();
}

mockup

(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.

@huonw huonw added the A-docs label Nov 16, 2015
@brson brson added the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Nov 18, 2015
@brson
Copy link
Contributor

brson commented Nov 18, 2015

Neat idea.

@Manishearth Manishearth added the E-help-wanted Call for participation: Help is requested to fix this issue. label Nov 20, 2015
@Manishearth
Copy link
Member

Manishearth added a commit to Manishearth/rust that referenced this issue Dec 17, 2015
…abnik

…entation clearer

I could not use colors as suggested for rust-lang#29854 because Github doesn't support these in markdown, however this solution may be better for color-blind readers.
steveklabnik added a commit to steveklabnik/rust that referenced this issue Dec 17, 2015
…abnik

…entation clearer

I could not use colors as suggested for rust-lang#29854 because Github doesn't support these in markdown, however this solution may be better for color-blind readers.
@steveklabnik
Copy link
Member

Update: there has been some work done here, but there could be more.

@steveklabnik
Copy link
Member

I am going to give this one a close, as I'm not going to be working on this chapter of the book anymore.

If someone wants to make this look more colorful, please be my guest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

4 participants