5 ms·
Here's my suggestion that I strongly believe could help Rust's (or any platform's for that matter) adoption: There should be a list of somewhat larger projects
by adamnemecek 12y ago
Here's my suggestion that I strongly believe could help Rust's (or any platform's for that matter) adoption:
There should be a list of somewhat larger projects (similar to the sample apps for Cocoa https://developer.apple.com/library/mac/navigation/index.html#topic=Sample+Code§ion=Resource+Types https://developer.apple.com/library/mac/navigation/index.htm...) maintained by people who actually understand the language. For me, and I imagine a lot of other people, the hardest part about learning a new language/platform is getting from the stage where I understand the syntax and APIs to getting somewhat proficient with it and being able to make informed decisions about how things should be done in that language.
A lot of times, when I look at some open source projects to learn from, I'm left with the impression that the author might not have really understood what s/he's doing and that really increases my frustration with the platform. A list of canonical projects would prevent this.
I'm aware of Servo but I feel that Servo is a.) too large of a project for a Rust n00b to learn from b.) it's not always up to date WRT to the language version and the best practices.
Alternatively, this could also be a list of 3rd party projects blessed by the Rust people as good projects to learn from.
While it might seem like a waste of time, I feel like this would e.g. reduce the number of people needing help on IRC or the mailing list so it might actually save time.
- steveklabnik 12y agoThanks for the suggestion. Now that Rust is actually starting to get some 'somewhat larger projects,' I think this is a great idea. And after 1.0, that list will explode pretty shortly.
- adamnemecek 12y agoFair enough. You probably want to make sure that you have something like this before people start writing larger projects in Rust but write them the same way they would write C++. Eventually, they would hit some wall and complain about Rust as whole even though it's not really Rust's fault.
- netcraft 12y agoI completely agree. 9 times out of 10 I can pick up a new language, understand the syntax, but how to idiomatically structure a project is a completely different thing. Most of the time I would rather have the latter than the former - I can pick up most syntax from its actual use.
- steveklabnik 12y ago> how to idiomatically structure a project is a completely different thing. Agreed, and I plan on explicitly tackling this too. That'll come after Cargo is a bit more solid, however.
- charlieflowers 12y agosteveklabnik, along these same lines, I've come across the claim that things like map, reduce, fold, etc., are not idiomatic Rust. But nothing about why or why not that might be true. That kind of guidance would be valuable, especially since Rust borrows so many concepts from functional languages.
- dbaupp 12y agoThey're perfectly idiomatic operations on iterators, but they're not the one-and-only way to do things, sometimes you just need an imperative loop. (That is, Rust borrows concepts from functional languages, but is not a deeply functional language itself.)
- steveklabnik 12y agoI will certainly say that Rust is young enough that idioms are still forming, so beware of those who say anything is strongly idiomatic. Except four spaces, no tabs. That's _incredibly_ so. ;) But yes, as they develop, I'll be encouraging the use of idioms directly in the documentation. My years of Ruby make me a big believer in developing and following idioms. Oh, one last thing about that: iterators are way better than explicit loops in Rust, because loops have to do bounds checking, but iterators don't. So generally, iterators are not just better stylistically, but also performance-wise too.
- cpeterso 12y agoMozilla's pcwalton wrote and maintains sprocketnes, an NES emulator written in Rust, which seems like a good example of a practical project with a well-defined scope: https://github.com/pcwalton/sprocketnes https://github.com/pcwalton/sprocketnes