12 ms·
Rust Survey 2019 Results
- Waterluvian 7y agoLast 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 :-)
- k__ 7y agoAbout the docs. They are better than most docs, but sometimes they have gaps in their sample apps. The WASM book, for example, goes from "hello world" straight to "game of life". It's certainly an interesting algorithim and probably hits a sweetspot because its computation heavy(?), but at least for me it was too much noise around actually learning Rust and WASM.
- lucasyvas 7y agoI'm so happy you mentioned this. I went through the same process and "noped" out. Now, I've stuck with Rust, but I laughed out loud at that leap.
- steveklabnik 7y agoI am also happy you both mentioned this, because I've never heard anyone say this before! Good to know!
- k__ 7y agoYes, I'm a frontend dev. I know my todo list examples, haha.
- praveenperera 7y agoI did the same! Eventually I found a simple CLI idea I wanted to implement and decided to learn enough rust to do so. Glad I stuck with it. Still haven’t gotten around to doing anything with Rust and WASM yet tho.
- jasondclinton 7y agoI was surprised to see the title "System Architect" was the second most-common job title among respondents. Use of that phrase is culturally taboo within Google. Are there regions in the world where its common to use that title? I see that the respondents were from all over the world in 14 languages.
- enitihas 7y agoMany senior Engineers I know willingly use that title externally, even though their title internally is something different and simple.
- Liru 7y agoWhy is it considered culturally taboo within Google?
- jasondclinton 7y agoJust answering the question, not saying that it's true: it's seen as describing someone who has opinions about how to develop software or design systems without having the engineering expertise to back up those opinions.
- hinkley 7y agoWhether they have the chops or not, the Architect role has little to no skin in the game. The half-life for their knowledge of the system is on the order of a year, and it's a role you want some longevity in. I've had better luck splitting architecture up between three or five leads (not four).
- nevi-me 7y agoThis is usually the problem, especially with Java architects. The many that I've encountered are often using dated methodologies/tooling that have been eclipsed by something else. The challenge is often keeping up with what's changed in the last x years, which has little incentive if one does not program much if at all.
- Scarbutt 7y agoSurprised to see backend web apps as top use of rust by a large margin. I guess many take the common opportunity(web dev) to learn the language?
- jasondclinton 7y agoI think that its a reflection of where much of the market's jobs are: "backend web app" might as just well be replaced with "thing moving data around with RPCs" which is what so much of the value software provides in the economy is tied up, these days. Also, for startups who live-or-die by their cloud hosting costs, reducing CPU utilization by 2x and MEM utilization by 5x versus GC'd languages, the value proposition is real.
- Thaxll 7y agoThat's not how it works, since most startup run python / ruby / nodes code, the cost of your app is definitely not a big concern, especially since you can have performat code in any language, you don't need rust speed in 99.9% of the cases.
- steveklabnik 7y agoIt’s not always about performance. Memory usage matters too. And reliability. We’ve heard all of these things from folks switching.
- nicoburns 7y agoSometimes performance matters. At my previous company we settled on a Rust solution for one component (ingesting analytics data) after cycling through python and node prototypes that were just too slow (we had 100+ GB of data to process, and the node.js app was taking 15 minutes to process one 500mb file). And once the data processing code was in Rust, it made sense to have the endpoint that collected the data in Rust too. It would probably have been possible to optimise the node/python versions. But it was easier to write it in Rust that is designed for these high-performance scenarios. An unexpected bonus was just how reliable our Rust code turned out to be. I'd definitely consider Rust for non-performance critical code on that basis.
- pornel 7y agoNetworking in Rust has gotten _so much_ better this year. My old server needed nested callbacks, wrapping everything in refcounting, loops via recursion, and Either for control flow. Still easier than C, but not pretty. Now it's just `do_this().await.do_that().await` and I'm done! Huge congratulations on shipping that.
- zelly 7y agoYou need a standard web/networking framework. Built in to the standard library, like in Golang. That will speed up adoption. Rust's competitor is C++. C++'s biggest weakness is build tooling, which Rust is demonstrably better at with cargo. C++'s second biggest weakness is poor networking support. Rust isn't any better. That's driving away the JavaScript/RoR/hipster crowd which is the lifeblood of Rust's adoption.
- gamegoblin 7y agoI believe the strong build tooling you mention is what makes it much less painful to have things like high-level networking frameworks in 3rd party packages.
- snazz 7y agoI think that networking frameworks go out of date much more quickly than base languages (see Python for an example). By not including it in the standard library, the recommended Rust library for web and network programming can change over time.
- zelly 7y agoUDP is a spec. TCP is a spec. HTTP 1..3 is a spec. There are only a few ways to implement it.
- nicoburns 7y agoRust already has synchronous TCP and UDP in the standard library (https://doc.rust-lang.org/std/net/index.html https://doc.rust-lang.org/std/net/index.html). But most people want to use async versions, at which point there very much isn't one way to implement it. Once you get to higher level protocols like HTTP, you also have questions like "should HTTP header be strings or encoded as types. There very much isn't just one way to implement it.
- bsder 7y agoDo you do it with callbacks or polling? That's pretty fundamental and completely changes your API. And, before you reply, you might want to know that while the majority of things do it with callbacks, both the lowest embedded AND highest custom networking systems implement networking with polling (for different reasons).
- steveklabnik 7y agoPlease don’t forget that the survey closed in December last year, so it’s pretty close but may not reflect rust actually today. In particular the IDE landscape has been changing rapidly.
- mkl 7y agoHi Steve, I spotted a typo: "By are the most common" should be "far" instead of "are". BTW the (3d!) pie charts are far less clear or informative than the nice simple bar charts, which could be used for everything here.
- steveklabnik 7y agoThanks! I didn't write this post, but I'll pass it along.
- toby 7y agoQuick plug, my company released a lot of Rust code on Wednesday: https://github.com/mobilecoinofficial/mobilecoin https://github.com/mobilecoinofficial/mobilecoin The SGX and no_std support might be of particular interest to some of you.
- justin66 7y agoI was hoping for a question like "Should we all stop bringing up Rust in message threads about something else entirely?" with answers like "yes," "hell yes," "a thousand times yes," "motherfucker yes!," and "hellz yeah."
- snazz 7y agoI get the feeling that it isn't the main Rust community that does that kind of thing. Most of the actual library authors and major Rust users I've interacted with and seen in the community seem to be very level-headed about it and don't think that it is a panacea.
- m-hilgendorf 7y agoWhen people want better docs, do they mean better doc tooling or better doc writing? Because personally, I'm a huge fan of cargo-doc and its integration to the ecosystem. Just yesterday I found out about #![deny(missing_docs)] - which combined with executing code snippets in cargo test - enforces really good documentation discipline and ensuring that everything is doc'd, and that docs don't become stale.
- steveklabnik 7y agoI didn’t tread the raw results, but I believe it’s “more docs,” not the tooling.
- memco 7y agoHaving not used Rust at all, I'm impressed with its momentum. I know every language has their issues, but Rust seems to have a strong community, is well organized and seems to have good tools available: all things that make me believe that I would be able to use it effectively were I ever to work with it. I've been watching Gamozo on Twitch use it to build a hypervisor kernel and I really enjoy seeing how the language works for him.
- ridhwaan 7y agoAsk HN: Do you recommend learning C++ first then Rust? My logic is that learning C++ and navigating its pitfalls would lead to a better understand of Rust and the underlying reason behind certain design decisions.
- steveklabnik 7y agoThat is one argument. The other argument is that learning Rust first teaches you modern C++ well. I’m not sure which is correct.
- neutronicus 7y agoThere's definitely a dialog between Move semantics in C++ and Rust's ownership model. If I weren't a C++ programmer first, I don't know that I would really grok the value proposition of Rust (not dealing with Move Constructors) or the trade-offs (library code has to provide differently-named functions that trash resources as an optimization, rather than just providing an overload that eats temporaries).
- O_H_E 7y agoI too am in that position right now.
- Koshkin 7y agoBeware the possibility of falling in love with C++.
- nicoburns 7y agoI recommend learning Rust first on the basis: 1. The learning materials are much better. The official Rust book is excellent. And it doesn't take long to do a first run through it. 2. You'll learn much quicker with Rust. With C++ it could take you years of experience to gain a full appreciation of the pitfalls because they're often not apparent when you first write the code, only when you actually run into the bug further down the line. With Rust, you'll get a compile error and enlightenment is quick google and a reading of a blog post away. 3. Some parts of Rust only seems to be difficult for C/C++ programmers who have learnt the C(++) way of doing things and expect that to translate into Rust. They get frustrated when Rust doesn't let you use certain patterns. However as C++ is generally less strict, if you learn the Rust way first, then you'll generally be able to translate that fairly directly into C++.
- decafbad 7y agoAnyone else asks for REPL? I like to have a REPL.
- steveklabnik 7y agoSometimes folks do. There even was a limited one, long ago. It’s just not simple.
- pimeys 7y agoHere is one from Google I use sometimes https://github.com/google/evcxr/ https://github.com/google/evcxr/
- vertak 7y agoThank you for this! I've been looking for a decent REPL to use since rusti was deprecated.
- riquito 7y agoThe industry chart need some love, the number of lines is twice the labels, making it quite misleading
- blondin 7y agorust has an awful readability issue. its syntax is too irregular and permissive. (too much ruby?) people tend to disagree, but syntax is very important. that is, in fact, why python has won the scientific community. we don't wanna be spending brain cycles deciphering syntax. as a side note, we blamed java for being verbose for years. in retrospective, java was right. i have never seen a piece of java that i couldn't understand. i may not know why the code is doing what it's doing, but i always know what the code is doing. java has stellar readability! with rust, only time will tell. my gut feeling is that the readability will not help the language when programs get old.
- saghm 7y agoCan you elaborate on what exactly you don't like about Rust's syntax? I'm always surprised when I hear this, because a lot of the things that get pointed out tend to have good reasons for the way they are.
- steveklabnik 7y agoRust takes inspiration from several disparate sources. There’s something for everyone to find a bit alien. (That’s my working theory at least)
- Koshkin 7y agoPL/I has done it, famously, and just as famously the language has turned out horribly misdesigned and complex, and it also has missed out on most new ideas. (Still in use though.)
- edflsafoiewq 7y agoBut it doesn't matter. If the language is unreadable, even if every syntactic decision followed by necessity alone from a set of first principles, it wouldn't prove the language was readable. It would only prove the selected principles necessitate an unreadable language. Compare [x for x, y in v] to v.iter().map(|&(x,y)| x).collect::<Vec<_>>(). There is a good reason for every bit of ugliness, but that does not change the fact that it is ugly.
- jeddy3 7y ago"If you summed the size of all Rust projects you work in, how big would it be?" (emphasis mine) Then: "The majority of Rust projects (43%) are 1,000-10,000 lines of code." Am I reading this wrong somehow? I've been rereading it a couple of times, and feel like you can't draw that conclusion.
- EugeneOZ 7y agoI'll use this post to say "Thank you!" to developers of the IntelliJ IDEA Rust plugin. For those who didn't try: this plugin works even in the Community Edition of IntelliJ IDEA.
- mesaframe 7y agoRegarding learning Rust, As a intermediate level developer. I find literature for learning, and working with Rust quite lacking. On the other hand C++ has some huge array of books. All of the them being top notch.
- justwalt 7y agoIs the Rust book not enough? I found it to be pretty great.
- mesaframe 7y agoIt is good enough for introduction but not much more. What I meant to say is, there are no books that teaches you how to create programs using Rust. Patterns and stuff...
- timClicks 7y agoI am very curious about what you think about Rust in Action https://www.manning.com/books/rust-in-action?a_aid=rust&a_bid=0367c58f&chan=hn https://www.manning.com/books/rust-in-action?a_aid=rust&a_bi.... It wont describe higher level patterns, but does walk you through dozens of example programs. Projects include: - a CPU emulator - a fully functional NTP client - a skeleton grep implementation - how decimal numbers are represented in Rust - developing your own format for representing numbers - a memory scanner so you can learn how game cheaters cheat - handling UNIX signals - inspecting binary files for hidden patterns - an OS kernel + bootloader - an L-Systems implementation
- mesaframe 7y agoCan only tell after reading the book.
- jeswin 7y agoI started learning and coding Rust full-time over the last couple of months. I expected a learning curve, but boy what a steep curve it was. Simple things are simple enough, but for experienced programmers porting your patterns (especially functional programming patterns) can be challenging and interesting at the same time. For instance, I wanted to return a function (async) from a function. A seemingly simple task, but I couldn't figure it out and I had to ask on Stack Overflow. https://stackoverflow.com/questions/61167939/return-an-async-function-from-a-function-in-rust https://stackoverflow.com/questions/61167939/return-an-async... The answer is obvious only if you know a fair deal of Rust. Thanks to the Rust team's amazing momentum I am sure the compiler will improve over time, but for now I found passing functions and closures around a bit harder than I expected. Totally loving the language though.
- Dowwie 7y agoThe learning curve is misleading. You can achieve parity with a higher level language by copying and pasting solutions such as the one in your stack overflow post. Yet, unlike in other languages, an opportunity presents itself to learn far more about the underlying tooling used to create such a solution.
- timClicks 7y agoReally interesting to see data science so prominent. Encouraging to see, from my personal perspective.
- Dowwie 7y agoRust offers complete control over asynchronous streams of data with uncompromising safety. I believe that this will make Rust a contender for the Golden standard in data engineering, which supports data science. The survey category may need to distinguish the two or data science will include it.
- DeathArrow 7y agoNPM rewrote one of their services in Rust. It took them one hour to rewrite it in Javascript , two days to rewrite it in Go and one week to rewrite it in Rust. Even if we account 90% of that time to the lack of experience in Rust, it still feels like a massive productivity hit. So unless you absolutely need to squeeze the most performance you can from the hardware it might not be the best choice. https://www.rust-lang.org/static/pdfs/Rust-npm-Whitepaper.pdf https://www.rust-lang.org/static/pdfs/Rust-npm-Whitepaper.pd...
- siscia 7y agoIt is kinda unfair to compare the time of writing a service in go and rust if your team already work with JavaScript. Go was designed to be extremely simple (simplicistic, if you want to be ugly with terms) while rust was designed with very different goals in mind. Moreover the mental model of JavaScript is much closer to the one of go than the one of Rust. If you are learning rust and you are not from C/C++ or similar low level languages you are basically re-learning how computers works. Usually on go you don't really care of the difference between the stack and the heap, in rust you have to. Said so, it is really true that rust has a steep learning curve, however once you get over it the productivity is at least as high as go especially in the long term. For one off script of ~100 lines I would pick go as well.
- IshKebab 7y agoSure but it's worth noting that they went with the Rust implementation in the end even though it took the longest to write. Their reasons appear to have been that Rust code has fewer bugs (who cares if you get your JS code done in an hour if you spend a week fixing trivial runtime bugs?), had better performance, and they didn't like Go's dependency system. I definitely have noticed when writing Rust code I spend way more time getting it to compile, but I also have that "wait it worked first time? Impossible, I must have done something wrong" feeling waaaay more in Rust than I ever did with C++ or Typescript. I'm even starting to get used to it and think "sure it worked first time, it compiled after all!". I wonder how their opinions on Go would change though, given that it now has arguably the best designed dependency system of any language.
- SCdF 7y ago
- FrankenApps 7y agoThe text in the last survey question (target platform) seems wrong (or the graphic is wrong).
- codesections 7y ago> As for platforms that users develop on - Linux and Windows continue to dominate. That seems like a very odd way to characterize the results (55% Linux, 24% Windows, 23% mocOS). Why draw the line between the two platforms that are 1% apart instead of between the two that are 31% apart?