4 ms·
It's really not that hard. I think it depends where you are approaching it from.
by leshow 10y ago
It's really not that hard. I think it depends where you are approaching it from.
- xuejie 10y agoI actually agree, it's not that hard, yes one can definitely grasp that with some efforts. But my point really is: the time from start learning Rust till when you can deliver your project is definitely longer than many other languages out there. So Rust needs more tooling than many other languages out there, which is not a bad thing considering all the merits in Rust. That's why we are seeing tooling growing very rapidly in this space.
- mgattozzi 10y agoI think it's more because we like making development easier and having tools to do that is great because it means I can spend more time with the compiler telling me I coded something wrong.
- mycall 10y agoIt would be great if Rust Language Server supports Language Server Protocol.
- steveklabnik 10y ago(As mentioned below, it's the default protocol it uses)
- kibwen 10y agoI agree that it depends on where you approach it from (my very first question for tutoring any new Rust user is "what languages have you used previously?"), but I'm afraid that saying "it's really not that hard" glosses over the experience of a large number of potential users. I don't consider Rust to be a particularly complex language--I put it on par with Python--but unlike Python the learning curve for Rust is remarkably steep, which is enough for me to classify Rust as a hard language to learn. A foreknowledge of pointers helps, but for anyone for whom Rust is their first systems language, it's going to be Rust's task to teach them e.g. the stack/heap distinction, or what "aliasing" means, or why there are two string types (let's hope they're already versed in Unicode...), or how to design a system in the absence of pure OO.
- pjmlp 10y agoRegarding pointers, I think a good way would be to teach them both visually and without many C style tricks. C style pointer tricks are better left for level two, so to speak. Probably a good approach teach Rust's OO way is to introduce traits as kind of extensible modules that can be composed and go from there. It is not 100% correct, but I guess it is easier to teach than going full theory with traits being a kind of type classes and do on.
- iopq 10y ago> I don't consider Rust to be a particularly complex language > I put it on par with Python Python doesn't have complicated lifetime errors, confusing trait not being satisfied errors. Python function declarations don't need three lines of code. I mean wtf is this? fn accumulate<'a, T: Monoid>(tuples: &[(&'a str, &Fn(i32) -> bool)], i: i32) -> Option<T> where T: From<&'a str> there's about ten language features in these lines of code that Python doesn't have
- fredsir 10y agoI only have very little Rust experience, and would like to hear from a Rust veteran - as much as one can be - if that is considered good Rust, or if it's just an example of how bad Rust can be if you don't know what you're doing, or are trying to showcase bad Rust. I would think it's the latter, but I don't know, to be honest.
- iopq 10y agoYou could write <'a, T: Monoid + From<&'a str>> and omit the where clause, but that seems even less readable to me. The rest basically has to be there for the function to do what it does.
- Manishearth 10y agoIt's basically an example of what happens when you try to use Haskell concepts in Rust; the type parameters explode quickly. Most rust functions are not like that. Some are. It's not exactly bad rust to have functions like that, but such functions should probably be uncommon in your codebase.