In order for me to learn anything, I need some form of "homework". If you want to teach me a new language, a new framework, I need to "get my hands dirty".
Working through exercises makes sure I actually understand what I am reading, and sometimes it even shows me I don't understand what I thought I did.
How about Advent of Code? They start out easy, but after a while the difficulty is all over the place, and it'll force you to seek out new features of the language. It's a somewhat "realistic" way to learn the language, instead of having a set of more contrived set of exercises that only make you look at a particular part of the language.
The first day, for example, will kind of force you to figure out how to parse arguments, how to loop, how to convert strings into ASCII... all basic, practical tools that you will need sooner or later anyway. Now it's your job to pick up a Rust reference, look around for the tools that you need, and use them to solve an actual problem.
You could take a look at exercism.io. I just started the exercises on there yesterday so I don't have an informed opinion on whether they are good or not overall, but it might be what you're looking for.
I wholeheartedly agree with this! I am a pretty inexperienced self-taught frontend developer currently trying to learn Haskell and C. I went through Learn You A Haskell and have started going through Zed Shaw's Learn C The Hard Way.
On the surface, LYAH looks a lot more polished. It has nice drawings, less typos, seems like an actual book rather than a gathering of notes and thoughts turned into teaching material. But the exercises in LCTHW are amazing. They always challenge my knowledge in a way that often makes me realize that I didn't understand anything from the prior paragraph.
In LYAH I usually tried following along in GHCI to get an intuitive idea of the functions and patterns used. Yet, whenever I sit down to just build something that, while using the same features, deviates from the example code quite a lot, I often notice glaring holes in my understanding of the topics.
And so, bottom line, I want teaching material to ask hard questions which challenge my assumptions and perceived understanding. As a beginner, I can't come up with such questions on my own. Just presenting me with already assembled programs and going through them line by line just doesn't work (for me at least).
While this probably isn't helpful to you in particular, my company has a learning site geared towards beginner/intermediate programmers, including some content on Rust. The catch: it's in Japanese, so you'll have to use Google translate if you can't read it. The code is in English though.
Similarly, what I liked the most about programming MOOCS was the online test/grading server. It gamified the learning, and was very stimulating for me. At one point, all "quantitative" subject learning platform could probably just be a grading server plus exercises.
I agree. Good exercises will make you realise that you haven't actually read the chapter properly and you should probably go back and actually pay attention!
I've always made my own exercises by deciding what I want to build with a language before I build it. Then I break it up into chunks and learn as I go.
I love those succinct introductions to languages, I find it easier to understand when you don't have to read lots of text and languages possibilities are written as a series of quick examples.
What I miss from Rust learning material is a series of exercises that focus on reference, lifetime, ownership where you have to fix some code to make it compile.
One note on borrowing/ownership that really made it click for me was that to move from &mut T to &T you have to transition through owning the value type, so:
&mut T -> T <- &T
Whichever scope holds the actual value-type is the only scope that can make that transition(absent cases like RefMut)
If such pointer weakening was not possible, how would you be able to call a method that takes &self on binding of type &mut self? Of course, you can't use a mutably while b is in scope. So, something like the following results in a compiler error:
fn no_mut(a: &mut usize) {
let b: &usize = a;
*a = 10;
println!("a: {}, b: {}", a, b);
}
Downgrading &mut T to &T is perfectly valid in every context[0]. Upgrading from &T to &mut T is impossible in safe Rust and can easily cause undefined behavior when it's done in unsafe block. If you have T, you can create one &mut T reference or many &T references.
[0] Except in a case when there's &mut U reference, which points at some part of the object referenced by &mut T.
Higher dimensional things are trivial in other languages while they are nonobvious in Rust.
For example, this week I was working on a mechanism for one request to start a future and then all further requests for that resource to await that same future.
I implemented it in less than 5 minutes in Node by just storing Promises in a map. But I'm still not sure of the ideal solution in Rust. It's definitely outside of my familiarity zone.
But what I'm finding over the months is that my routine Rust code is pretty fast now once I've run the gauntlet of experiencing the same compiler errors over and over. And when I reach for Rust instead of Node or Python, it takes longer but my executable is 3mb and it's much faster without much additional expense.
Also, it's tough to do async work in an ecosystem that isn't async-everything, something easy to take for granted in Node and Go.
I write python for most of the day, professionally. I write Rust at home.
I'd say I spend similar time on the same problem with both, maybe a bit more upfront on Rust and a bit more on the tail with Python. This is, of course, disregarding libraries.
I'm more familiar with Python than Rust right now, but I feel like after adjusting for amount-I-have-to-look-up-standard-library-things my development speed is similar. The biggest advantage Python gets is IPython.
I really want to learn and use Rust, but just lack the motivation, especially when APIs turn out to be incomplete - I think the last one I saw was multicast not allowing me to set the send interface.
I guess the main draw for me to any given language is great libraries with great APIs. Python has those, Javascript has those, C++ has those, Rust... not so much yet.
> I guess the main draw for me to any given language is great libraries with great APIs. Python has those, Javascript has those, C++ has those, Rust... not so much yet.
Well... what makes (especially) Rust libraries great is the relative absence of bugs. I can use a Rust library and have great confidence some ugly bug won't bite me later on. The developers of the libraries you (don't) mention continuously struggle to achieve the same property.
So in a sense those libs are not at all great in the same sense that a Rust library is!
This looks like a fairly nice website. For someone coming from a background of C and D, but familiar with quite a few others, I have to ask: what makes rust different and better? Aside from memory safety, what reason do I have to choose rust over another language?
Good (and improving steadily) compiler feedback, centralized package manager, thoughtful approach to language versioning, a syntax that I like (very subjective), and the flexibility to write unsafe code blocks if for some reason you need to. Those are some of my reasons for liking it.
Programming Rust has 21 chapters and is 583 pages long. I’ve read it, and I’ve also read the online Rust Book (both several times). Most chapters are in the order of 20 to 30 pages long. Programming Rust is one of the best programming books I’ve ever read, and I’ve been coding professionally since 1997. If you want to get an A+ in Rust read Programming Rust a few times. You can see the entire Contents section of the book on Amazon. Below is a list of chapter titles from Programming Rust that get little to zero coverage in this Learning Rust website.
Ownership. References. Expressions. Error Handling. Enums & Patterns. Operator Overloading. Closures. Iterators. Collections. Strings & Text. Input & Output. Concurrency. Macros. Unsafe Code/FFI - the coolest part, they show you how to create a safe wrapper around libgit2.
At that time search was not working, had bit ugly ui, no indicator for current page and etc. Even it's duplicate, this time people actually saw it correctly. So sometimes trying things again is a good thing :)
Have a nice weekend!
If you are going through a proxy server (e.g. at work) then you may find that the SSL interception proxy has not been correctly configured to provide revocation information.
[+] [-] mswift42|8 years ago|reply
In order for me to learn anything, I need some form of "homework". If you want to teach me a new language, a new framework, I need to "get my hands dirty".
Working through exercises makes sure I actually understand what I am reading, and sometimes it even shows me I don't understand what I thought I did.
[+] [-] jordigh|8 years ago|reply
The first day, for example, will kind of force you to figure out how to parse arguments, how to loop, how to convert strings into ASCII... all basic, practical tools that you will need sooner or later anyway. Now it's your job to pick up a Rust reference, look around for the tools that you need, and use them to solve an actual problem.
That's how I got very comfortable with D.
http://jordi.inversethought.com/blog/advent-of-d/
If you do this for Rust, I'd love to see a blog post like the above.
[+] [-] mattherman|8 years ago|reply
http://exercism.io/languages/rust/about
[+] [-] YuukiRey|8 years ago|reply
On the surface, LYAH looks a lot more polished. It has nice drawings, less typos, seems like an actual book rather than a gathering of notes and thoughts turned into teaching material. But the exercises in LCTHW are amazing. They always challenge my knowledge in a way that often makes me realize that I didn't understand anything from the prior paragraph.
In LYAH I usually tried following along in GHCI to get an intuitive idea of the functions and patterns used. Yet, whenever I sit down to just build something that, while using the same features, deviates from the example code quite a lot, I often notice glaring holes in my understanding of the topics.
And so, bottom line, I want teaching material to ask hard questions which challenge my assumptions and perceived understanding. As a beginner, I can't come up with such questions on my own. Just presenting me with already assembled programs and going through them line by line just doesn't work (for me at least).
[+] [-] lukes386|8 years ago|reply
[+] [-] dumindunuwan|8 years ago|reply
[+] [-] bschwindHN|8 years ago|reply
https://codeprep.jp/books?tags=&sortBy=createdAt&keyword=Rus...
The exercise style is "fill in the blank" so it's not as rigorous for learning, but still fun to get a sense of different language concepts.
[+] [-] agumonkey|8 years ago|reply
[+] [-] weavie|8 years ago|reply
[+] [-] smt88|8 years ago|reply
[+] [-] unknown|8 years ago|reply
[deleted]
[+] [-] dumindunuwan|8 years ago|reply
[+] [-] _Chief|8 years ago|reply
> I am a Sri Lankan Web Developer who lives in Vietnam. So I am not a native English speaker and just learning Rust
This guide is so well done, props to you. I haven't worked with Rust yet but your docs make it seem so easy to work with.
[+] [-] dumindunuwan|8 years ago|reply
[+] [-] hokkos|8 years ago|reply
What I miss from Rust learning material is a series of exercises that focus on reference, lifetime, ownership where you have to fix some code to make it compile.
[+] [-] shepmaster|8 years ago|reply
> Small exercises to get you used to reading and writing Rust code. Includes practice reading and responding to compiler messages!
https://github.com/carols10cents/rustlings
[+] [-] vvanders|8 years ago|reply
One note on borrowing/ownership that really made it click for me was that to move from &mut T to &T you have to transition through owning the value type, so:
&mut T -> T <- &T
Whichever scope holds the actual value-type is the only scope that can make that transition(absent cases like RefMut)
[+] [-] microtonal|8 years ago|reply
[+] [-] red75prime|8 years ago|reply
[0] Except in a case when there's &mut U reference, which points at some part of the object referenced by &mut T.
[+] [-] unknown|8 years ago|reply
[deleted]
[+] [-] Scarbutt|8 years ago|reply
[+] [-] siscia|8 years ago|reply
In my humble opinion python give the impression to move fast, but when you need to maintain the code base the rust compiler is simply too wonderful.
[+] [-] always_good|8 years ago|reply
For example, this week I was working on a mechanism for one request to start a future and then all further requests for that resource to await that same future.
I implemented it in less than 5 minutes in Node by just storing Promises in a map. But I'm still not sure of the ideal solution in Rust. It's definitely outside of my familiarity zone.
But what I'm finding over the months is that my routine Rust code is pretty fast now once I've run the gauntlet of experiencing the same compiler errors over and over. And when I reach for Rust instead of Node or Python, it takes longer but my executable is 3mb and it's much faster without much additional expense.
Also, it's tough to do async work in an ecosystem that isn't async-everything, something easy to take for granted in Node and Go.
[+] [-] mlindner|8 years ago|reply
[+] [-] staticassertion|8 years ago|reply
I'd say I spend similar time on the same problem with both, maybe a bit more upfront on Rust and a bit more on the tail with Python. This is, of course, disregarding libraries.
[+] [-] mquander|8 years ago|reply
[+] [-] piracykills|8 years ago|reply
I guess the main draw for me to any given language is great libraries with great APIs. Python has those, Javascript has those, C++ has those, Rust... not so much yet.
[+] [-] childintime|8 years ago|reply
Well... what makes (especially) Rust libraries great is the relative absence of bugs. I can use a Rust library and have great confidence some ugly bug won't bite me later on. The developers of the libraries you (don't) mention continuously struggle to achieve the same property.
So in a sense those libs are not at all great in the same sense that a Rust library is!
[+] [-] earenndil|8 years ago|reply
[+] [-] mykull|8 years ago|reply
[+] [-] Drdrdrq|8 years ago|reply
That said, while I love the idea of Rust I find the language itself offputting somehow. I don't know, maybe I just need to give it another try.
[+] [-] Paul-ish|8 years ago|reply
[+] [-] talloaktrees|8 years ago|reply
[+] [-] rayascott|8 years ago|reply
Ownership. References. Expressions. Error Handling. Enums & Patterns. Operator Overloading. Closures. Iterators. Collections. Strings & Text. Input & Output. Concurrency. Macros. Unsafe Code/FFI - the coolest part, they show you how to create a safe wrapper around libgit2.
[+] [-] dumindunuwan|8 years ago|reply
[+] [-] faitswulff|8 years ago|reply
[+] [-] anon335dtzbvc|8 years ago|reply
https://news.ycombinator.com/item?id=16048065
[+] [-] dumindunuwan|8 years ago|reply
[+] [-] always_good|8 years ago|reply
Do you expect people to start participating in that submission with zero comments now that it's three months from the top of the stack?
[+] [-] yusrilhs|8 years ago|reply
[+] [-] Wildgoose|8 years ago|reply
[+] [-] steveklabnik|8 years ago|reply
[+] [-] Animats|8 years ago|reply
[+] [-] steveklabnik|8 years ago|reply
Anything you learned since May 2015 should still be very relevant. That's almost three years ago.
[+] [-] Dowwie|8 years ago|reply