9 ms·
Last year Rust was a language I badly wanted to learn. I've had many false starts learning a lower level or "systems" language, which I felt would round off my
by Waterluvian 7y ago
Last year Rust was a language I badly wanted to learn. I've had many false starts learning a lower level or "systems" language, which I felt would round off my toolbelt quite well. A lot of principles of CS you don't get exposed to when writing web servers and UIs.
The problem I had was basically the IDE integration in VSCode. RLS was okay but unreliable. And if it only works most of the time, it may as well not work at all. Especially when it only sometimes gave me code completion and type checking (A lot of "unknown" would fill my code).
Then Steve pointed out Rust Analyzer in a previous thread and I was off to the races. Rust Analyzer has gotten _so good_. Having a VSCode setup that gives me immediate feedback for my mistakes and code discovery makes a huge difference (to me at least). Maybe a bit of feedback is that I wish Rust Analyzer hadn't been so hard to discover. Though maybe that's just because it was new.
That, combined with my nightly march through The Rust Book has me well beyond, "I wish I could learn a systems language but !@#$ C and C++ are just so complicated and unforgiving" and into "wow, it's no-longer a matter of _if_ but a matter of how much I want to hone my understanding." Rust is a beautiful language that way. It guides me away from rookie mistakes that would leave me disenchanted after hours of debugging something dumb. (It's hard to be unrelentingly dedicated to learning something new now that I have young kids. When I was a teen it was easy)
I don't want to come off as a Rust fanboy. I have yet to implement much of anything (though hopefully by next year I'll have a Game Boy emulator to show you all). But I want to give thanks and proselytize a little because it has been such an empowering experience.
- ilrwbwrkhv 7y agoI really hope vs code wasn't electron. So that I could use it.
- winrid 7y agoIs there a way to use it with Clion? I didn't find anything right away. Although the Clion/Rust story is already pretty good.
- steveklabnik 7y agoYou can use the intellij rust plugin with clion. Not the same thing but similar.
- throwlaplace 7y agothe rust plugin for intellij is pretty damn good. sometimes it doesn't catch downstream errors when you mess something up but it's on point probably 80% of the time.
- bcrosby95 7y agoI like Rust a lot. And used it for about half a year in my spare time. But in that time, my impression with it is that it is a VERY hard language to be productive in when its something you rarely use. So I wouldn't mind learning it and using it in my dayjob or if I had more free time. But trying to fit it in between work, family, and leisure time didn't work out so well for me.
- jasondclinton 7y agoYea, the survey says that IDE support is the third-highest item for increasing adoption (https://blog.rust-lang.org/2020/04/17/Rust-survey-2019.html#rust-adoption---a-closer-look https://blog.rust-lang.org/2020/04/17/Rust-survey-2019.html#...). Rust users would benefit greatly from the Analyzer work that is in flight. Really looking forward to this becoming stable. The tooling it offers is great.
- dleslie 7y agorust-analyzer is stable enough to use, and it's _awesome_. I wish I had something this slick for Scheme, C, C++ and even C#. Omnisharp is good, but not this good.
- pjmlp 7y agoVC++ analyser + Intellicode (AI driven intelisense) C# Roslyn analysers or StyleCop, also on VS. CheckStyle or PMD for Java, alongside Netbeans, Eclipse or InteliJ. XCode analysers. CLion Inspections.
- dleslie 7y agoI use omnisharp-roslyn, it's not as good as the rust-analyzer integration to lsp. It helps that rust has incredible documentation.
- georgewfraser 7y agoI have used both, and I’ve found rust analyzer to be better but not amazing. It seems it often “gives up” and autocomplete stops working. It is improving over time though.
- Waterluvian 7y agoEven in the past few months alone it feels a lot more reliable.
- GrayShade 7y agoOne of the issues preventing the type inference from working in the presence of associated types was fixed this week, so the next release should be even better.
- jfkebwjsbx 7y agoC complicated? It is a very small, simple language for a system programming one. C++ complicated compared to Rust? They offer roughly the same features and both are complex languages if you want to understand what is really going on. Rust is a very good language that competes with C++. The main feature it brings to the table isn't simplicity (Rust, like C++, isn't simple at all), but the borrow checker. Please avoid making comparisons between languages if you don't know them (as you claim).
- nicoburns 7y agoSome things are a lot simpler in Rust. For example, adding dependencies. And this one thing makes a lot of practical tasks simpler too, because there is a whole swathe of code you simply don't need to implement at all. What's simpler: Implementing a HashMap in C, or `use std::collections::HashMap`? If you really need to understand what's going on under the hood then yes C might be simpler. But when was the last time you needed to inspect the details of your HashMap? There are also things like C's declaration syntax, which is anything but simple. And header files (even for your own code).
- steveklabnik 7y agoOn that “use HashMap” line of thinking... http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performance-of-c-and-rust/ http://dtrace.org/blogs/bmc/2018/09/28/the-relative-performa...
- aportnoy 7y agoWhat a weird article… The instruction count being about the same doesn’t make it the same program… Why isn’t he using -O3?
- throwaway17_17 7y agoIf you don’t need to understand/inspect the details of a HashMap implementation then you are not doing ‘systems programming’. The attitude that ‘someone has done it for me’ and therefore I don’t care about it is not a characteristic of ‘systems programming’. It may be simpler to just use some standard implementation of a data structure, but if that is the case, then you can get by with most of the commonly accepted language paradigms. I’m not saying everyone need to implement a unique hashing algorithm tailored to use case, but that is what systems programming is. System Programming is the custom tailoring of data conditioning to a particular set of circumstances and then taking responsibility for the benefits and consequences of that those choices that differentiates systems programming from the other broad categories of program construction. Rust is a fine language if it fits your use case, and you feel as though the purported benefits of the ‘borrow checker’ assist you in writing quality code, but if you just want a programming language that provides a large library of pre-written solutions, then the difference between language is dependent only on use case and usage requirements. Saying Rust is simpler than C because you can use a pre-written HashMap implementation is ridiculous, because you can do the same thing in C (I mean use someone else’s HashMap). But if ‘systems programming’ is the area of interest, being able to inspect/implement the actual HashMap is a key concern, and just dismissing that aspect is not an acceptable proposition.
- ccktlmazeltov 7y agorust-analyzer doesn't work well for me, I can't click through functions to get to definitions. There's a bunch of things that just stop working. So I'm still on RLS and it's not great.
- dralley 7y agoThat definitely works for me - it's an option under the right-click menu.
- redis_mlc 7y ago> The problem I had was basically the IDE integration in VSCode. I use vi. Works every time.
- echelon 7y ago> I don't want to come off as a Rust fanboy. There's nothing wrong with that. People need to see that everyone around them is catching the Rust bug. I want people to feel like they're missing out so that they too will take the plunge. The sooner everyone knows Rust, the sooner employers will start using it internally.
- xppq 7y agoYou don't need people who are learning their first "systems language" to evangelize. You actually need to convince C and C++ programmers, who are largely put off by the hype. Rust seems to be popular only in the web sphere, where Javascript and Python programmers are tweeting that they now know a "systems language".
- unrealhoang 7y ago> Rust seems to be popular only in the web sphere, where Javascript and Python programmers are tweeting that they now know a "systems language". I see that is the best thing Rust brings to the table, as the scope of learning and using Rust is pretty much “scoped “. Once you are comfortable with the compiler, you can use Rust reliably and deloy code to production. Whereas C/C++ is very “open” to learn, you can learn the syntax and basic in a couple of weeks, but to use it correctly and reliably (to a certain degree) WITHOUT SUPERVISION from another advanced programmers takes years of experience under your belt.
- Waterluvian 7y agoYeah! I'm not about to go acting like I'm a systems programmer. I'm not writing drivers. But there's a lot of CS principles you just don't get exposed to when writing web stuff and that's what I'm after. Just knowing those things better will make be a better programmer, even if I never use rust professionally.
- cercatrova 7y ago>Rust seems to be popular only in the web sphere, where Javascript and Python programmers are tweeting that they now know a "systems language". This is great because now we are starting to get faster, more performant libraries and code. People switching from Node to Rust see huge speedups. Perhaps we'll also switch from JS to rust with WASM. Rust is nice because it's high level enough to write code with algebraic data types, like in TypeScript, so that maintenance is easier. Personally I'd love to see as many people as possible move from JS and Python to Rust.
- green7ea 7y agoAfter reading your comment I tried Rust Analyzer and wow, it makes a huge difference. I was previously using rls and it was misssing a few key features (I didn't even realize it). Thank you for the suggestion :-)