3 ms·
This is a good intro and really highlights how Rust doesn't have a learning curve, it has a cliff. I'm tackling this in my own book [0] because I think the docs
by mprovost 4y ago
This is a good intro and really highlights how Rust doesn't have a learning curve, it has a cliff. I'm tackling this in my own book [0] because I think the docs really throw you in the deep end (mixing metaphors). As this article shows, to implement a "hello world" you have to use a macro, so you can't even look for a function signature in the standard library docs to help. So you can either just say "don't worry about this for now, just trust me" or spend a whole chapter diving into macro syntax. And then it goes into errors, which in this example need to be boxed, so then you can spend a bunch of time explaining unsized types and boxing and memory allocation... or just say that it has to be boxed to keep the compiler happy.
Teaching Rust is basically a giant topological sorting exercise [1] where you're finding the optimal order to introduce syntax so that you steer clear of all of these rabbit holes. Or you just end up drawing the owl.
[0] https://rftgu.rs/ https://rftgu.rs/
[1] https://en.wikipedia.org/wiki/Topological_sorting https://en.wikipedia.org/wiki/Topological_sorting