7 ms·
Am I just not "with it?" I don't see the appeal of Rust, but it gets the hottest talk in HN-town. Maybe it's just because I haven't worked long enough with C o
by andrewmcwatters 6y ago
Am I just not "with it?" I don't see the appeal of Rust, but it gets the hottest talk in HN-town.
Maybe it's just because I haven't worked long enough with C or C++ to complain about them (only about a decade or so), but I don't have any issues with those languages. And I find it wholly unappealing to abandon the existing corpus of literal decades of knowledge having been poured into those language ecosystems all in the name of whatever it is that Rust delivers on. I just have too much experience in the industry to throw away my time and experiment with something I can't take off the shelf and be productive with from day one.
I've also mentioned I just can't stand the way the language looks. It's ugly as sin, and I know I'm not alone in that opinion.
I made some crude comments in a previous thread here on HN about Servo, but still came away with the feeling there was literally no one using Servo, the site didn't tell you how to actually use it, and no one cared, but the hype was unreal because it was web tech written in Rust.
Edit: The points on this post are fluctuating wildly. If you're interested in Rust, could you share your knowledge with some of us who are on the fence like me instead of downvoting? It doesn't actually help me understand anything about the language or community other than I shouldn't criticize Rust because its users will downvote you.
- ForHackernews 6y agoI haven't used it myself, but my understanding as an outsider is that a lot of the excitement around Rust is that it's bringing a new model of memory safety: with the borrow-checker, you can avoid the performance penalties of garbage collection, while also avoiding the bugs and security risks seen in C. People who care about such things are really hyped because it's a truly new idea in a mainstream(ish) language. https://willcrichton.net/notes/rust-memory-safety/ https://willcrichton.net/notes/rust-memory-safety/
- wwright 6y ago> but still came away with the feeling there was literally no one using Servo Code from Servo is in every single copy of Firefox, so it's pretty popular as code goes. > And I find it wholly unappealing to abandon the existing corpus of literal decades of knowledge having been poured into those language ecosystems all in the name of whatever it is that Rust delivers on. I just have too much experience in the industry to throw away my time and play with toys. Rust doesn't throw away that corpus. Rust draws heavily on that corpus. It leverages LLVM (used to compile C/C++), integrates with C libraries, integrates with GDB, draws a ton of design decisions from actual experience using C++, and so on. It's a tool that runs inside Firefox, AWS, Microsoft, and a lot of other high-reliability, high-performance areas. It may be young, but it's quickly building (IMO compelling) evidence that it's very much not a "toy." ;)
- andrewmcwatters 6y ago> Code from Servo is in every single copy of Firefox, so it's pretty popular as code goes. This is akin to saying the DWM is in every copy of Windows so it's the most popular graphical compositor of all time.
- gpm 6y agoIt really isn't. The entire purpose of servo was to be a vehicle for r&d with the eventual goal of merging code back to firefox. It succeeded. No one used it because that really wasn't the point.
- andrewmcwatters 6y agoI think you're right in that that was the original sell, but it's not how they sell it today. "Servo’s mission is to provide an independent, modular, embeddable web engine, which allows developers to deliver content and applications using web standards." So maybe they're just not there yet? But in my opinion, if you create popular software and no one uses it, it's not popular from its adoption, it's popular for some other reason. I can't point to any one using Servo and figure out how they use it, because I don't know of any companies or products actually using it besides Mozilla. And I embed web tech, so I've spent a lot of time in that particular field. I just don't see it actually being used outside of Mozilla projects, like it was originally conceptually sold.
- adwn 6y ago> I embed web tech Wait, you're working with web tech – probably the most archetypal field where preventing security vulnerabilities is the top priority – and you don't see the benefit of using Rust instead of C?
- andrewmcwatters 6y agoIt’s definitely a major focus, but from where I operate I have to trust the embedded library to address a lot of those concerns. There’s usually very limited exposure offscreen embedders have to see to. If Servo is any lighter than CEF, I absolutely want it to be the solution I use. So I’m very interested in its development.
- __0x01 6y agoYou are not alone. I think the use of method chaining especially takes away from the aesthetic of newer programming languages.
- piercebot 6y agoOne of the reasons it's so enchanting is how it manages memory without the use of a garbage collector thanks to the magic of lifetimes. Couple that with performance that's on par with C/C++ and design choices that encourage testing and documentation... there are a lot of technical reasons to love Rust. The welcoming community is another great reason, but I'll let community leaders speak to that point. In terms of how the language looks... the important thing is that `rustfmt` standardizes this, so you only have to learn how to read one style, and not a different style for every developer you work with.
- adkadskhj 6y agoYup - it drew me in as a Go programmer, entirely replacing my Go stack with Rust. It offers me so many of the joys of Go with more power. Some negatives too of course, but a big boon for me in learning Rust was realizing i didn't always have to reach for the biggest tool. Sometimes a simple Clone or [A]rc was perfectly okay, especially when comparing it to Go - my benchmark. Rust became as developer efficient for me as Go was, and then more so when i leveraged the huge surplus of code locality tools like Iterators and various functional patterns (.map, etc). Plus, now i get to play with new toys like WASM without a GC or game engines! I miss almost nothing from Go and gained so much power when i want to reach for things. Most of which, like Iterators, are power with little to no cost. I've been a Rust fanatic for a couple years now, and C/C++ were not even in my toolbox. I think Rust can hit a lot of sweet spots for a very very wide range of people, eg non-C/C++ domains. Which isn't an argument for its usage, but an explanation for its popularity.
- ngrilly 6y agoI mostly use Go. But I've been keeping an eye on Rust because I like the language expressiveness, the safety provided by the stronger type system, the smoother integration with C calling conventions, the generics, the error handling. But I'm hesitant to switch to it because it feels like the learning curve is steeper in Rust than Go, and that's important for my team where we want to be able to onboard new engineers quickly. What's your experience in that regard?
- adwn 6y ago> [...] to throw away my time and play with toys. Rust is not a toy. It's possible that your prejudice stops you from seeing Rust's benefits. It's also possible that you're working in a niche where Rust's advantage compared to C or C++ isn't as great as for most other areas of software development. And that's okay, Rust isn't quite there yet. For some very small niches, it might never be. > [...] existing corpus of literal decades of knowledge having been poured into those language ecosystems [...] Frankly, even with those "decades of knowledge", C programs and libraries are still full of security vulnerabilities caused by C's limitations and memory handling. How many more decades will it take? How many more thousands of vulnerabilities?
- joseluisq 6y agoThat's the question, how many UBs and how long more?
- cogman10 6y agoI can give you a few reason you might like rust. - Instant boot time. Because rust is statically compiled, there's no runtime startup or anything involved with it. From dead to alive is pretty much instant. - Low memory footprint. Because rust does not use a GC, it doesn't need all the bits and pieces of memory storage that modern GCs require. The memory allocated is (close to) the minimal memory needed to run the application. Further, due to it's low level nature, it's a lot easier to avoid heap allocations all together and instead focus on stack allocations. - It's safe to deploy and expose to the internet. You'd be a fool to setup a public facing C++/or C application. That memory model is simply too expensive to safely do even if you did want all the benefits of using a system language. Not so with rust. Client facing rust services or even just backends that may see client data are safe to push out. - It's fast. Rust has no startup or warmup time. From boot it is running just as fast as it ever will be. This means you don't have to have a warmup period or periods of slow runtime as you scale out rust applications. That consistent performance is easy to plan for. That speed and low memory usage have the added bonus of making rust really good if you are trying to optimize operation costs. You can use smaller or less instances to get the same amount of work done. - The model model not only makes memory safe, it prevents different types of concurrency bugs. While rust won't prevent ALL classes of concurrency issues, it will prevent several of them. That makes it easier to write parallel applications. Certainly, if none of those things are issues for you, then there's no reason to give rust a second glance. However, I personally see rust as super exciting because of all of those aspects.
- brandmeyer 6y ago> Instant boot time. Because rust is statically compiled, there's no runtime startup or anything involved with it. From dead to alive is pretty much instant. Dynamic linkage is not the slow part of application startup. The slow part (for applications which are slow) is almost always the gathering of non-compiled assets from disk. IMO, the lack of dynamic linkage is Rust's #2 weak point, second only to slow build times.
- cogman10 6y agoSorry, that wasn't a dynamic linking dig, but more of a JIT dig. I agree that rust would be better with dynamic linking. It sucks that you have to build everything when you build one thing :(. The issue I was specifically thinking of is how slow an untuned JVM can be for startup times and to get to peak performance (It HAS gotten better, but is nowhere near as fast as rust or even python). The default for these JITed languages is to pass everything through a non-optimized code path and only optimize later when the various methods are exercised enough. Rust has an advantage here in that it doesn't do any sort of runtime analysis to improve performance. It simply is as fast as it always will be.
- m463 6y agoI kind of think it's ugly too. But I think back many years, when I was put on a project written in Perl. At first I balked at the syntax. I can see $foo on the right of the equals sign, but on the left? And $_ and @_ and regular expressions everywhere like line noise. But working with it for a bit... and all of that just disappeared as I became fluent. They just started becoming idioms in my head. And after a while, I found Perl the most expressive language I've ever worked with. So, maybe you just have to get over the hump? (But yeah, I thought python was too ordered, but I switched and it's pretty much my favorite language presently)
- proverbialbunny 6y agoPerl was great. I miss Perl. v_v
- andrewmcwatters 6y agoYeah, sounds like I just need to get over some syntactical hangups.
- andrewmcwatters 6y agoTo those taking the time to sell me on it, thank you. I really appreciate you all sharing why Rust is important. I value a lot of the mentioned benefits listed below, specifically wrt speed, but I'm not finding the trade-off there yet. I work with codebases and projects where the expense of time is far too high to justify its usage, especially in existing designs where there is no meaningful way to extend the codebase with Rust. Believe it or not, but there really are a lot of us out there who just do not have memory (safety, ownership, or otherwise) problems with C or C++. It sort of feels like the argument people make with static typing vs dynamic typing. It's just not a concern I have. Perhaps with enough time and coercion I'll find a reason to use it.
- AlisdairO 6y agoFWIW I expect you're getting downvoted for tone. In particular: > I just have too much experience in the industry to throw away my time and play with toys. Implication: Rust is just a toy, people who use it have too much time on their hands, and they're not experienced enough to have good judgement. IMO if you're interested in a productive conversation you'd probably have better luck if you simply omitted content like the above: it doesn't add to the conversation, and is inevitably going to raise hackles among those who disagree with you.
- andrewmcwatters 6y agoOK, good point. Removing it.
- fastasucan 6y agoMaybe consider this as well: >It's just not a concern I have. Perhaps with enough time and coercion I'll find a reason to use it. Or just don't? Its like the validity of Rust is dependent on wether you use it or not. Try a different tone, and change a mindset from where yourself have to acknowledge/use/like something for it to be valid. If a fact based discussion about this is to be had you need to stop shoving your anecdotes and personal likings in the way. Its impossible for people to know whether Rust is right for you, and thats a pretty boring discussion by itself. I've never moved past reading the rust docs, but I understand why people react on your comments.
- layoutIfNeeded 6y agoWell, if you hadn’t noticed it’s mostly the same dozen of users upvoting and commenting every Rust-related article on HN.
- tomjakubowski 6y agoShort, incomplete list of reasons I prefer Rust, speaking from about five years experience with C++: * Real pattern matching and sum types. std::variant doesn't cut the mustard * Traits and derivable impls, rather than obscure operator overloads with fussy cv-qualified signatures * No iterator invalidation bugs (among the worst C++ issues to debug, IME); no inheritance or need to care about "virtual destructors"; no "object slicing"; no crazy interactions between overloads and templates which require an IDE to determine which function you are actually calling * Way better compiler error messages than clang or gcc Each of those "no"s is something I've spent days if not weeks of my C++ career debugging.
- dagmx 6y ago> I haven't worked long enough with C or C++ to complain about them (only about a decade or so), but I don't have any issues with those languages This may be part of the reason. Rust improves on those languages in many ways including better safety, package and build setups as well as doc setups. It's genuinely a breath of fresh air setting up and maintaining rust projects versus C++ or even Python. > I find it wholly unappealing to abandon the existing corpus of literal decades of knowledge having been poured into those language ecosystems Rust builds on these ecosystems. It uses LLVM as its backend compiler, much like clang does for C++. Additionally it has great support for CFFI so it can integrate very well into existing codebases with other languages. > I just have too much experience in the industry to throw away my time and play with toys. I read this as prejudice. Rust isn't a toy as can be seen by the large number of companies and projects that are putting significant efforts into it. Conversely, perhaps having entrenched experience in the industry means you're predisposed to approaching new paradigms in the field with higher cynicism than may be warranted? > It's ugly as sin, and I know I'm not alone in that opinion. I think that's very much subjective. I do know many programmers who find it ugly, but many like myself who find it write clean to read. Certainly I find it significantly easier to grok than C++ or Objective C for example. It's possible to write very elegant rust code that can verge on being Pythonic in nature. It's also possible to write very ugly code too. > there was literally no one using Servo, the site didn't tell you how to actually use it Servo is a research project from which portions have been taken and integrated into Firefox. That means a lot of people are using servo whether directly or indirectly.
- andrewmcwatters 6y agoI've noticed that Rust uses LLVM as well, but aren't there some significant compile time differences or am I recalling that from Go? I do definitely wish there was an easier way to go about Rust's C FFI, though. LuaJIT has spoiled me. All you do is preprocess headers and then you have access to all of the exports without having to do any work whatsoever.
- steveklabnik 6y agoGo is the language with very fast compile times; Rust's aren't particularly good, and, depending on the exact details, maybe slower than C++'s. It's pretty variable. We've been working on it but it's non-trivial. There are tons of tools in Rust to preprocess headers, and do even more fun things like https://github.com/Hywan/inline-c-rs https://github.com/Hywan/inline-c-rs (which is obviously not a general solution to this problem but is interesting)
- k__ 6y agoThe Rust community alone is so much better than anything I've seen in my 15 year programming career. The communities of statically typed programming languages were especially elitist and gatekeeping. The Rust community is welcoming.
- andrewmcwatters 6y agoI've basically had nothing but downvotes from the Rust community because any time I point something out about my thoughts on the language, I'm wrong and can't have those thoughts. Some one here in a separate thread said, "I don't understand your hate," and I'm like, what hate? It's a programming language. I don't hate it, I just don't yet find a reason to use it, but maybe I'm missing something really big. It's not really welcoming at all in my opinion. It carries all of the familiar facets of being a hyped product that people love, and if you question it you're not only wrong, you should be torn down because of your opinion.
- proverbialbunny 6y ago>I'm wrong and can't have those thoughts. There is a difference between facts and opinions, yah?
- andrewmcwatters 6y agoI'm not trying really hard to argue facts or even talking about performance numbers or anything of the sort. There are people who really, really love Rust, and I'd love to better understand how some developers arrived at their opinions of the software. If there's a killer reason outside of memory safety and ownership, like compiler speed or something, I'd love to hear more about it from first hand accounts rather than someone's blog article about how great Rust is... and oh by the way we sell some product written in Rust, check it out! You know?
- steveklabnik 6y agoI hear what you're saying in this sub-thread. I will say that your "toy" comment didn't make it seem like you were interested in having a real discussion, but mostly just throwing shade, as they say. The whole comment has this vague undertone of "I am above this whole thing." This is probably why you're running into some difficulty. There's not just the crew that loves Rust, but also a very, very dedicated set of Rust haters, and it's really easy to bucket someone, incorrectly, into one or the other, based on initial impression. One interesting thing in this comment, and why I chose to respond to it though, is it seems like what you want isn't just a description, but a specific kind of description from a specific kind of person. That is, it has to be "first-hand" but also not from someone who "sell[s] some product written in Rust." How can you get first-hand knowledge without building something? How can you demonstrate that that knowledge is legitimate without also letting people know that you have done that work? It seems impossible to me.
- renewiltord 6y agoThere's lots of articles for the advantages of Rust. Consider just searching for some of them on Google since they will, in general, be written in a more considered fashion than a response to your comment. In an effort to be transparent, I will downvote your comment because I like novelty and interesting new things, not the nth version of a BSD is dead or Vim v Emacs discussion, which is what you're spawning.
- andrewmcwatters 6y agoIt really sucks on HN that users like you who get past a particular karma threshold hold down users who have legitimate curious questions. It incentivizes not having unpopular discussions, and really turns me off to the site entirely. So could you please not? This isn't a facetious statement. I'm trying to keep this on topic: AWS loves Rust, so maybe I should, too. Could we have a discussion about why? The mechanism you're using is probably one of the most irritating features on HN and Reddit to me.
- renewiltord 6y agoSorry, legitimate curiosity is too low a threshold for me. If you want to chat further about this POV, happy to discuss over email (in profile). Would rather not pollute this thread.
- andrewmcwatters 6y agoIf discussions on a forum are pollution to you, then I don't know what to say. People discuss things. Communication is a part of learning. Sorry that's beneath you? Sorry I didn't discuss things the way you wanted? I mean, not really, but you have leverage on the forum, and you're making it a really undesirable place to reply in.
- nothowthisworks 6y agoMate, you are the absolute worst type of person to try to have a constructive conversation with. You have turned nearly every reply into a combat. Each one a chance for you to claim you were slighted by big bad bullies. And rather than taking the explicit feedback you've gotten, instead you've imagined some sort of conspiracy against you. >> I just have too much experience in the industry to throw away my time and play with toys. Seriously, get out of here trying to gaslight everyone by acting like you came into this thread with a genuine sense of curiosity. I hope you seek out an external perspective on how you appear in this thread.
- woah 6y agoThere's this odd genre of comment where people sound personally threatened by a language. Why?
- andrewmcwatters 6y agoWhy would a person be threatened by a language? I'm asking the HN community why I should reconsider and to share their thoughts on having used Rust. The world isn't made up of people who either love or are threatened by things. Could you not use this language?
- Jtsummers 6y agoIt has C and C++'s performance without a lot of the footguns. A better type system. The trait system is a nicer way to extend types than C++'s class system (IMO). Generics from the start, instead of absent (C) or added on and still not fully utilized by practitioners (C++, some practitioners get the value, other offices bar using them). The ownership model means that using the lower level concurrency primitives is less likely to have the subtle issues of C and C++. It also means they could avoid encoding a specific concurrency model into the language (like Go or Erlang) and let those be libraries. Cargo as a standard build system, package manager, and test runner. This makes for a much more coherent development environment than the tire fire that is C and C++'s build, test, and package management story. Developing tests is much easier than in C and C++, which means many of the packages are actually reasonably well tested (maybe not perfect, but better than the average C or C++ package you might want to incorporate into a project). Rust has a pretty good module system. C has nothing of the sort, and C++ has a mix of things that can be used similarly (classes, namespaces) and only recently got modules proper in C++20. This helps a lot with organizing your code into a modular structure and then sharing that code with other projects. Rust can call and be called from C, so there is no tossing anything out. You can integrate Rust into an existing project one file at a time. Move your more critical code into it, and let other code call it. Going back to concurrency, put the part that generates and manages workers (as an example of one model) in Rust and leave the rest of the logic in C or C++. Gradually migrate the worker logic into Rust, or not. Perhaps it's a library that you don't control or don't want to change. Some things aren't pretty or aren't clear. For instance, str and String are pretty confusing for new users. But the compiler will catch these for you. Speaking of, actually decent compiler warnings and errors. Often with potential fixes included, which usually do what you want. In summary: Fewer footguns, better quality of life components, better language features in some areas (type system, modules, in particular), no performance hit (or no major performance hit) compared to other options for languages attempting to offer improved safety (where safety could be along many dimensions).
- andrewmcwatters 6y agoIs it possible to use Rust without much necessary usage of generics?
- jayd16 6y ago>Am I just not "with it?" >all in the name of whatever it is that Rust delivers on If you haven't bothered to groc the purported benefits and you have not decided to reject them on their own merits then yeah, I'd say you're just being a grump. Feel free to not like Rust but your complaints don't show a lot of effort in trying to understand it. As far as what you lose when you try new languages, you really shouldn't worry so much. A vast majority of your skills as a programmer are portable.
- aliceryhl 6y agoThe primary reason why I love Rust is that the compiler catches most of my bugs at compile time. For example, I recently spent three full days on writing code without running it at all — I just made sure it compiled as I went along. Afterwards when it was time to run it, there were a few mistakes not caught by the compiler, but I was able to fix all of them in 30 minutes. That program has been running in production without any issues since then. We use PHP for most other projects at work. I can assure you that this kind of thing is not possible with PHP. So in short, Rust forces me to think about every edge case and error path, so I can feel confident that my code really works, even in the face of obscure situations. In fact, this is also the first line in the AWS article in question: > One of the most exciting things about the Rust programming language is that it makes infrastructure incredibly boring. That’s not a bad thing, in this case. The only language I've had a similar experience from is Typescript. That it's fast or uses only a little memory is just a bonus for me.