Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upRWIB Mission 6: A Better Example #180
Comments
edunham
added
the
RWIB Missions
label
Aug 28, 2015
This comment has been minimized.
This comment has been minimized.
mdinger
commented
Aug 28, 2015
|
The best analysis of front page examples I've seen is listed here. It's well worth looking at. |
This comment has been minimized.
This comment has been minimized.
|
As mdinger mentions, I wrote up my thoughts on examples earlier; and I had done that research with the intent of proposing some front page examples, which I then didn't get around to. That said, I am still interested in the project; I have several ideas for examples, and just need to flesh them out. As I proposed earlier, I think it would be best to have several small to medium sized examples, each focusing on a particular feature, rather than trying to have one be-all and end-all example. I think it's too hard to have a 20 line example that shows off all of what Rust is, and anything much longer will be too much to take in at once. Rather, I liked Scala's approach of having a few feature bullet points, and each one show an example, though I would prefer to have one on display on the first load rather than having to click through to see any example. One sticking point I ran into when trying to write up some examples is that many of them require cargo or other things you can't use on Playpen. I think that it might be OK to have only some of the examples be runnable, while the others are just plain text that you can run if you download and install Rust and Cargo. Those that can be run on Playpen should be, but I think it's OK to not constrain ourselves that way. Here are the current bullet points of Rust features on the front page; I am thinking of trying to write one example of each:
I think it would also be good to list Cargo, and how easy it is to use a fairly extensive ecosystem growing in Cargo. For "zero-cost abstractions", it would be nice to embed something like the compiler explorer to show an example of using iterator combinators that compile down into the equivalent of a For pattern matching, I really loved this example that Felix wrote in Mixing matching, mutation, and moves in Rust:
I have some thoughts on the other examples that I will continue to flesh out over the next few days. Does this sound like a reasonable direction to go in with the example? We will of course still need to pick the example that is displayed by default, but I think that with several examples, each of one major Rust selling point, there's a lot less desire to try to cram too much into one small example. |
This comment has been minimized.
This comment has been minimized.
|
Nice analysis @lambda. I agree that slideshows are probably not the way to do, but perhaps a small collection of examples, each of them accessible via some sort of selector (and with one of them shown by default). Each example should also have a link to something explaining the major feature(s) being shown off, probably from the Rust book. As far as what sort of thing can be used for each of the major features identified above, here are some thoughts:
All in all, I think this is a solid collection of example ideas that should nicely showcase the strengths of the language for newcomers. |
This comment has been minimized.
This comment has been minimized.
This is a good idea. The only qualm I have is that if we use the feature list to link to examples then we probably can't also use it as planned to link to related blog posts (the mixed types of links would be too intuitive). |
This comment has been minimized.
This comment has been minimized.
My thought was that each example could also include a little bit of explanatory text, which could include the appropriate links, rather than all of the explanatory text in comments. I'll draft up a PR for the front page with a couple of examples of what I'm thinking about. |
This comment has been minimized.
This comment has been minimized.
|
@lambda perhaps something akin to the install page in structure, with a small explanation and links to accompanying materials in a column on the left, and executable example code from the playground on the right. |
This comment has been minimized.
This comment has been minimized.
|
I'm open to having multiple examples on some kind of carousel, with one showing up by default. I don't think we should try to get one for every bullet point, just because it's so ambitious we probably won't get there. Good idea using the bullets to come up with themes. Let's try to get people to come up with simple examples for each of the bullets and see where it goes. I'll make a reddit post. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
After we add logos to the front page we're probably going to end up with the content extending just slightly below the fold for a lot of viewers, which is pretty much the worst scenario (rather have everything above or lots of content below). So I suggest that we need the example to be even fewer lines that it is currently. |
This comment has been minimized.
This comment has been minimized.
dumindu
commented
Sep 22, 2016
•
|
Please add more examples which are friendlier to new users
and etc. Also please order docs properly, new users learn about borrow and checker before basics of structs, vectors and etc. This will confuse the absolute new comers. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for the suggestions @dumindu. You're first example might make a good replacement for the current one. |
This comment has been minimized.
This comment has been minimized.
dumindu
commented
Sep 25, 2016
|
let me repeat https://users.rust-lang.org/t/soliciting-multiple-new-examples-for-rust-lang-org-homepage/3676/34 in here. This might not be the right place or the right time, but I would like to suggest a new layout for Rust main page.
Thanks |

brson commentedAug 28, 2015
Link.
Come up with a new example that fits in the same space and exemplifies
the Zen of Rust. This is a newb's first impression of Rust and it
needs to be breathtaking.
Consider that we might have multiple examples serving different
purposes and put them on a carousel.