6 ms·
I might be wrong but one possible explanation is that the language is so hard to learn that people would need tools to help in the beginning. Within Mozilla, t
by xuejie 10y ago
I might be wrong but one possible explanation is that the language is so hard to learn that people would need tools to help in the beginning.
Within Mozilla, they can use servo as a selling point or turn to creators for help, but from the outside world, we've got so many languages available, while some might not be good when the software grow big, they are more beginner-friendly than Rust. Hence Rust needs all those tooling from the very start.
- leshow 10y agoIt'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.
- steveklabnik 10y agoWe've actually heard from production users over the last year or two that the compiler itself helps you learn the language; it's been compared to a pair at times. And that was long before new errors... That said, there are more tools to be built to make it even better. https://internals.rust-lang.org/t/borrow-visualizer-for-the-rust-language-service/4187 https://internals.rust-lang.org/t/borrow-visualizer-for-the-... is one extension I'm very interested in seeing.
- xuejie 10y agoI definitely agree! While I was reading about Rust couple of weeks ago I was thinking maybe exposing the compiler's detail would help refactoring and diagnosing bugs here. It's so awesome that you guys have already think of this! Really awesome work! Again, just want to mention that my point is simply that Rust needs more tooling to overcome its learning hurdles, and to me this is not a bad thing. Because once we have tools solving the learning curve problem, we can enjoy all the benefits Rust provides :)
- steveklabnik 10y agoFor sure; the curve can always be lower. :)
- pjmlp 10y agoThe borrow visualizer idea is great! It would help a lot in regards to language productivity.
- imh 10y agoI don't know. I love haskell, but it fits the bill of a language so hard to learn that people need tools to help in the beginning. Yet haskell tooling isn't that great. I'd guess that it's a question of priorities.
- wtallis 10y agoI suspect haskell might be in a difficulty class beyond rust, where really good tooling still wouldn't be enough to make it significantly more accessible. The things rust requires a C++ programmer to learn also seem to be relatively amenable to mechanical assistance.
- imh 10y agoIf haskell is that much harder, it should benefit from better tooling that much more. I think there really is a big difference in the priorities. I've never played around with GHC, so I have no idea how hard tooling is, but I know some good old humans are at least able to contribute (https://izbicki.me/blog/error-messages-in-ghc-vs-g%2B%2B.html https://izbicki.me/blog/error-messages-in-ghc-vs-g%2B%2B.htm...). edit: It looks like the error message changes may have been reverted (https://phabricator.haskell.org/rGHC92c924e07dfef327509555c27a5478d9851ec9fa https://phabricator.haskell.org/rGHC92c924e07dfef327509555c2...) :( Sad that they reverted it instead of fixed it.
- iopq 10y agoWriting Rust code is more difficult than writing Haskell code. Haskell is more than okay with taking a performance hit for convenience. Rust APIs actually have you pass in references to buffers where you want your data to end up. Rust doesn't use GC and tries to focus on pay-as-you-use abstractions. That's a lot more control, but also more verbosity.