Hi! I'm the maintainer, and I'm glad yinz are enjoying rustlings :) I don't have any plans to do this for other languages, but please feel free to start your own!
If you have any particular Rust concepts that you'd like exercises for, please let me know here, file an issue, or even contribute an exercise! Errors that you've hit that took you out of your flow of working on something else are great candidates. I haven't been adding new exercises recently, but I would like to continue expanding.
holy cow...just went looking for the origins of "yinz" and found out about "western pennsylvania english." My wife does the "needs/likes/wants + past participle" thing listed in the wikipedia article[1], and I never knew it was commonplace in some parts of the U.S.
Thank you for doing this. Is there any chance we could see exercises involving lifetimes? I've found this is one of the trickiest Rust-only concepts to really understand.
Thanks for putting in the effort to produce this. I'm excited to learn Rust and to port a few projects over to it, but I haven't gotten traction to get past the first few steps. Your packaging-up of the examples is a great way to start.
Yeah, I love exercism! There's definitely conceptual overlap, but IIRC the exercises in exercism were more of the variety where you're given a problem and you start from scratch, then others give feedback on your solution. I'm not sure if the intentionally-broken starting places of rustlings would fit in?
This is great. It took me from occasionally scrolling through the Rust book ("Rust looks cool, I'll use it eventually") and never writing a line of code to actually trying the language.
One point that makes this particularly nice is the fact that for many languages of the compiled c++/Rust/etc kind there is a certain level of barrier for people coming from dynamic languages, and that is the non-existence of a repl where you can just try out basic idioms and constructs without having to manually set up a context. This kind of interactive environment kind of replaces that and therefore opens the language for much more people.
That's really cool. I like the whole idea behind this site, and apparently I missed it the times it's been on HN in the past. I'm totally going to use this for a few languages I've been meaning to pick up (including rust).
The only violator I found in these exercises is the one that uses mutexes. The suggested answer involves `val.lock().unwrap()`, which is (anecdotally) common in real Rust code. An error result of a mutex unlock implies that another thread panicked while holding the lock[0], so propagating that panic is likely the right answer in this case.
Often the quickest replacement for an `unwrap` is an `unwrap_or` with a sensible default.
Other times where error-handling is important use a `match` there and then. And don't nest the arms of the match instead use the return of the match expression.
On the other hand, I found `try!` pretty awkward. Especially since quite often you need to create custom errors alongside it and can go down a rabbit hole in which you have to read confusing compiler messages from within macros about traits not being implemented correctly, and lifetimes missing, etc.
These are very useful! Do you plan to add anything about object oriented approach of Rust (structs, traits, trait objects)? This topic (OOP approach) isn't documented in a focused fashion, especially since Rust lacks common inheritance (favoring composition).
I.e. some examples of how to do OOP "the Rust way".
If you have any particular Rust concepts that you'd like exercises for, please let me know here, file an issue, or even contribute an exercise! Errors that you've hit that took you out of your flow of working on something else are great candidates. I haven't been adding new exercises recently, but I would like to continue expanding.
Thanks! <3