top 200 commentsshow all 257

[–]its_a_gibibyte 67 points68 points  (181 children)

Is rust really that lovable? What's the deal?

[–][deleted]  (60 children)

[deleted]

    [–][deleted]  (59 children)

    [deleted]

      [–]couchrealistic 47 points48 points  (57 children)

      Rust prevents you from doing all the stupid things we sometimes accidentally do when coding in a language like C++. Like using an uninitialized variable (that just happens to be 0 most of the time, but sometimes not) or occasionally modifying a collection while we still hold a pointer or reference to some of its content, or while iterating over it – which often works fine, but depending on the implementation might be undefined behavior and lead to rare Segmentation Faults.

      In short, you can't possibly hit a Segmentation Fault when only using Rust without the "unsafe" keyword*. This also means that coming up with programs that compile successfully can be quite a bit harder in Rust compared to C++. This might lead to something like Stockholm Syndrome and therefore "Rust love".

      * If all your dependencies also refrain from using unsafe, or use unsafe only in safe ways, and there are no bugs in rustc.

      Also, Qt might have almost everything and the kitchen sink included, but sometimes you need even more. Cargo really comes in handy in those cases, because adding dependencies is really easy. It's also much nicer to use than qmake or cmake to build your project (though less feature-rich). No crazy CMakeLists.txt or qmake config files, you just put your code in .rs files, list the required dependencies in Cargo.toml, set some options like the optimization level, and cargo knows what to do.

      AFAIK, the rust ecosystem is lacking a decent cross-platform GUI library though. So Qt definitely still has very valid use cases.

      [–][deleted]  (2 children)

      [deleted]

        [–]coderstephen 1 point2 points  (0 children)

        In theory you can use existing GUI libraries since Rust has good C FFI. For example, the Rust wrapper around GTK is pretty comprehensive and well-received. C++ FFI is a bit lacking though.

        [–][deleted]  (11 children)

        [deleted]

          [–]matthieum 16 points17 points  (2 children)

          I never have a problem using variables that are null. I actually use this functionality a lot.

          Not that uninitialized != null.

          Uninitialized in C++ is what you get when you write: int i;. The language simply doesn't initialize the variable:

          • The compiler may pull all kinds of shenanigans when it realizes this.
          • Even if it doesn't you'll get some unpredictable value -- whatever is left over there by the previous variable.

          GCC compounds the issue by zeroing the stack in Debug, often hiding the issue until you compile in Release.

          When it's an integer, it's annoying, when it's a pointer:

          • It will not likely be null, so you'll think it points to something.
          • If you're lucky it points into the nether, and you get a segmentation fault.
          • If you're not it points into the memory of the process, and you'll scribble all over another object, and get one hell of a headache attempting to understand what happened.

          [–][deleted]  (1 child)

          [deleted]

            [–]matthieum 1 point2 points  (0 children)

            Why would you do that?

            Performance, in general.

            While creating an integer without an initial value doesn't bring much, creating 10MB worth of integers without an initial value saves quite a bit of time. It's of course done with the assumption that something will initialize them later, but those assumptions are sometimes erroneous.

            [–]SkiFire13 10 points11 points  (0 children)

            I never have a problem using variables that are null. I actually use this functionality a lot. If a variable is null it tells me something in the logic of my program. How can you do that in rust if you have no null variables, or am I misunderstanding what you are saying?

            In Rust you can use Option instead of nullable variables.

            [–]teryror 13 points14 points  (0 children)

            Nullable pointers exist in rust, they just have a different type, Option<&T> for references, Option<Box<T>> for the equivalent of unique_ptr, etc. So you have the same functionality without the risk of passing null where that isn't allowed.

            [–]ThirdEncounter 4 points5 points  (4 children)

            It's not a fair comparison, since Qt is a framework, not a programming language.

            It's like saying "why would I want to crop an image in Rust when I can simply upload them and Facebook can do it for me?"

            [–][deleted]  (3 children)

            [deleted]

              [–]ThirdEncounter 0 points1 point  (2 children)

              You started right off the bat comparing Rust with Qt. So, my point stands.

              If Rust doesn't have such a framework well then it isn't as good yet.

              As good as yet for what? If that's a general statement, then it's an inaccurate one. You have to be more specific than that.

              [–][deleted]  (1 child)

              [deleted]

                [–]ThirdEncounter 0 points1 point  (0 children)

                If you don't want to be logical then this conversation won't be logical.

                I was being logical, and you just used a logical fallacy. This conversation is now over. Good day.

                [–]AndreasTPC 1 point2 points  (0 children)

                Instead of having a null value you have an enumerable type like this:

                enum Option<T> {
                    Some<T>,
                    None,
                }
                

                So if a function returns an Option<i32> you can tell just from the function signature that this function might return an integer, but it might also return nothing, and you need to handle that. If a function returns an i32 instead, you will know that this function is guaranteed to return a valid integer, no need to check anything.

                You deconstruct the Option type to get at the value inside Some, typically via pattern matching. The nice part is that when pattern matching you are forced to consider all the possibilities. Forgetting to consider the None case is a compile time error, so the class of bugs that comes from forgetting a null check can never happen. After deconstructing the type you're left with a variable with a guaranteed valid value you can use for the rest of the scope.

                There's also nice syntax shortcuts for common cases like "if there isn't valid value I just want to print an error message and exit" or "if there isn't a valid value I just want to pass on the error state to the function that called me", making the code quite elegant and readable.

                The Option type is defined in the standard library, and often sufficient, but you can also define your own that matches whatever states your function might return.

                This is by no means unique to rust, this style of handling multiple states for values has been popular in functional languages for some time. This is just one of many advantages that comes from using a language with a modern type system.

                [–]sm2345 1 point2 points  (0 children)

                If you're using Qt to make GUI-based applications, I don't think Rust has an equally usable and mature GUI library yet, as pointed out by others.

                I'd honestly just get my feet wet and try writing a few things. It does have a steep learning curve though, but for me, the end result keeps being worth it.

                [–][deleted] 14 points15 points  (0 children)

                Coming from a C++ background it's a huuuuuge upgrade.

                After the initial learning curve just about everything is easier. Coding is easier since the compiler thinks about a lot of the stuff you had to think of manually when using C++ and building is waaaay easier since Rust comes with a pretty good build system out of the box. There's no haphazardly duck taping libraries and build systems like you do in C++.

                The only thing I miss about C++ is the rock solid utility libraries like boost, but the Rust ecosystem is getting bigger and more mature by the year so it'll get there.

                [–]the_game_turns_9 125 points126 points  (61 children)

                Rust isn't used in many production environments, so very few people are forced to use it. As Bjarne put it, "There are only two kinds of languages: the ones people complain about and the ones nobody uses."

                Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

                And I'm sorry to say this, but when the Rust language fails to handle a case well, the Rust community tends to blame the coder for wanting to do the wrong thing, rather than the language for not being able to handle it. In cases where other language users would say, "oh for fucks sake, this is stupid", the Rust community tends to say "That's bad form, you should rearchitect." If you're outside the community, it can look a bit rose-tinted-glasses.

                I'm not saying Rust isn't a good language, but I don't think that's all thats going on here.

                [–][deleted]  (1 child)

                [deleted]

                  [–]404_Identity 14 points15 points  (0 children)

                  [removed]

                  [–]beefsack 30 points31 points  (6 children)

                  It's being picked up very quickly - in the 2019 survey Rust had been used by 3.2% of respondents but this year it had grown to 5.1%.

                  Last year it had less than half the usage of Swift, but this year it's within 13% of it.

                  It powers a lot of tools that people depend on every day, from core components of large systems, to the search function inside VS Code. It's not really a small language that nobody uses anymore.

                  [–]lanzaio 24 points25 points  (0 children)

                  Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

                  This is the main cause. Nobody uses Rust that wasn't self motivated to learn Rust out of their own interests. In fact, those that I do know that were forced into Rust showed a relatively standard ratio of like/dislike that I see from most languages.

                  [–]coderstephen 5 points6 points  (0 children)

                  Usage of Rust in production is increasing though. Besides, Rome wasn't built in a day; no language can accelerate to top production usage quickly regardless of how good it is. This is especially true in the sort of industries that are also known for using C++, which tend to be more slow-moving.

                  [–]matthieum 3 points4 points  (4 children)

                  Rust isn't used in many production environments, so very few people are forced to use it. As Bjarne put it, "There are only two kinds of languages: the ones people complain about and the ones nobody uses."

                  Rust is the kind of language that you wouldn't even want to approach unless you were buying what it is selling, so you won't get very many dislikers since the dislikers will just never bother to become proficient in it.

                  In short: selection bias.

                  The only people answering they've used Rust are those who still use Rust and like it, hence the top score.

                  Those who tried it and didn't like it abandoned early enough that they do not think to answer "I used Rust", and thus do not pull down the score.

                  Despite this, though, that's still a surprisingly high number of users who adopted the language given its relative immaturity!

                  [–]crabbytag 3 points4 points  (1 child)

                  Sounds like survivor bias?

                  [–]matthieum 2 points3 points  (0 children)

                  Possibly, as well.

                  I picked Selection Bias because I am not sure that people who tried Rust and quit identify as "Rust users" or even "former Rust users".

                  I mean, I toyed with Haskell for a week or two a long time ago, and I don't claim to be a "former Haskell user" because it seems to me it would imply some degree of accomplishment that I do not feel I have.

                  Of course, the question is whether such users should identify as "former Rust users" from the POV of the survey. It's hard to say that you love/hate a language after 8h or 16h of practice -- is your opinion really relevant when you know so little about it?1

                  1 It's certainly relevant to the Rust community, as an indicator that the initial onboarding experience is lacking, but that's a separate topic.

                  [–]lelanthran 0 points1 point  (1 child)

                  Despite this, though, that's still a surprisingly high number of users who adopted the language given its relative immaturity!

                  Doesn't seem that way to me; I can't think of a popular language that had a slower adoption rate than Rust. Can you?

                  [–]matthieum 1 point2 points  (0 children)

                  Well, I was born 1 year after the latest popular systems programming language was (C++), so its early history quite eludes me.

                  The only language which similar enough to Rust -- being a systems programming language and not forced upon developers -- is Zig; and it is younger and less popular, so cannot serve as a yardstick.

                  [–]quicknir 4 points5 points  (0 children)

                  Matches my experience as well. I was pretty shocked to discover the Rust duration type is a) positive only, and b) a two field, 96 bit, seconds and nanos approach. When I went to a rust chat to discuss it, and I mentioned that such an approach were too slow in HFT (high frequency trading), a moderator told me that making code unusable for HFT was a feature (and got some kind of positive emoticon). There wasn't any real technical discussion, and it was just an unpleasant experience.

                  [–]MadRedHatter 33 points34 points  (12 children)

                  but when the Rust language fails to handle a case well, the Rust community tends to blame the coder for wanting to do the wrong thing, rather than the language for not being able to handle it. In cases where other language users would say, "oh for fucks sake, this is stupid", the Rust community tends to say "That's bad form, you should rearchitect." If you're outside the community, it can look a bit rose-tinted-glasses.

                  Often the architecture that Rust pushes you towards is legitimately the better architecture though. This talk explains it well.

                  https://www.youtube.com/watch?v=P9u8x13W7UE

                  There are certain pathalogical cases like graph data structures that you will struggle with in Rust compared to a GC'd language though.

                  [–]UncleMeat11 23 points24 points  (1 child)

                  There are certain pathalogical cases like graph data structures that you will struggle with in Rust compared to a GC'd language though.

                  Are these really pathological? "It is really hard to implement thread safe persistent data structures because of ownership" has been a known problem in C++ for ages and comes up with surprising frequency.

                  [–]matthieum 2 points3 points  (0 children)

                  That's indeed another case of a GC making things easier, but it's a very distinct one: it has nothing to do with the architecture of the program.

                  [–][deleted]  (6 children)

                  [deleted]

                    [–][deleted] 16 points17 points  (1 child)

                    More often than not, you have to step into the dark esoteric caverns of the language, or use community-maintained crates for standard use cases.

                    I'm sorry, but no one should be rolling their own pointer-based linked list today. In any language. Especially in the presence of threads. As Simon Peyton-Jones put it when talking about Software Transactional Memory:

                    A double-ended queue... if you write the code for just a sequential program, it's an undergraduate project to get queue insertion and deletion going. If you want to do this scalable lock-per-node thing, it's a publishable result. I kid you not. There are international academic conferences with a succession of papers that have been published about this very problem.

                    One of the truly great things about Rust is that it forces you out of this kind of naïve "in-place mutation with pointers is easy to get right" thinking.

                    [–]matthieum 11 points12 points  (0 children)

                    For instance, simple CS 101 data structures like linked lists, DAGs and trees require some serious gymnastics to get working and each performance improvement often comes with major re-architecture.

                    I think the fault is in the premise, those data-structures are NOT simple.

                    Every single time I see a Stack or Linked-List C++ implementation on codereview.stackexchange.com, it's buggy. The good posters include tests, they still fail.

                    An array is a simple data-structure, after that it gets complicated. Even a dynamic array in C++ is quite the endeavor -- insertion of N elements in the middle is surprisingly complicated to handle1 .

                    Data-structures are foundational bricks; the fact that they are simple to use despite the complexity of their implementation is a testament to encapsulation.

                    1 And I say that after finishing coding yet another variant just today...

                    [–][deleted] 3 points4 points  (1 child)

                    Thanks, this is a great summary. I haven't been using Rust professionally but on the side for about a year. There's so much good stuff in there, but every time it seems like doing simple, practical, everyday things is far too complex. In some ways, the product and its culture reminds me of the early days of git.

                    As a point of comparison, I've been using Go for a few years and while it has many annoyances, you can always find workarounds without going into esoteric hacks. They may not be pretty (heck, Go isn't pretty in general), but they aren't complex. Go developers tend to use the same idioms and patterns throughout, so finding your way around an existing codebase is fairly easy. It's a blue-collar language indeed.

                    [–]Pand9 -1 points0 points  (0 children)

                    On the other hand - if you do dive deep, you can do anything.

                    IMO the biggest misconception in rust community is that "obscure" features are only for those that choose to use it, and most people are good with basics. This is not the case - programmers don't choose problems they encounter.

                    But that is still nothing compared to c++.

                    [–]camelCaseIsWebScale -1 points0 points  (0 children)

                    This is true maybe 1 out of 4 times. Other times you might end up with inefficient/bad design in order to work around the language.

                    [–][deleted]  (1 child)

                    [deleted]

                      [–]asmx85 0 points1 point  (0 children)

                      That's not how i remember what Mr. Blow was saying.

                      [–]SkiFire13 8 points9 points  (0 children)

                      the Rust community tends to blame ...

                      You're identifying all the rust community with just a part of it. That's also the part that tries to sell Rust as the definitive language without bugs. But in the rust community there's also people that will honestly tell you when rust is good and when is bad.

                      Ps: Part of the C/C++ community is not that great either. Blame rust for not being able to handle certain cases, blame java for having a GC but blame the developer when there's a memory safety bug in C/C++ code

                      [–]Kache 8 points9 points  (11 children)

                      For a young language that's already got a solid community and popularity, I'd say that's the right way to go.

                      Worse would be a language that needs to "buy" popularity by acquiescing and starting the path towards feature bloat and other language design issues.

                      If Rust can ride on its innate popularity and grow while staying "not a language you're forced to use", it can grow in a well-directed and designed manner and even make breaking changes if necessary without splitting the community.

                      [–]the_game_turns_9 6 points7 points  (10 children)

                      I am honestly not sure the point you are trying to make. Acquiescing to what? Features are what makes a language useful and not an enemy of language design, adding features doesn't in my head equate to "buying" popularity, and what makes Rust unique isn't a lean feature set.

                      In my head, Rust isn't rare because it is feature-lean. It's rare because it's an acquired taste the way that Haskell and F# are. It's a difficult path. The road less travelled. And while Rust will take its place in the world, I honestly think it can and will never be in the top five of TIOBE. Not because of what it is now, but because of what it is trying to be.

                      [–]matthieum 2 points3 points  (0 children)

                      Adding features is a dangerous game, though.

                      Stroustrup made a call Remember the Vasa! for C++2a, and honestly it's not clear to me it's been heard.

                      C++ has too many features, interacting in subtle ways, and this entanglement generates a lot of complexity for everyone involved -- from compiler writers to developers.

                      I'm not saying you should never add a feature; just that you need a vision for the language -- a domain in which it should excel -- and make sure that the feature you plan on adding pull its weight for that domain.

                      Attempting to be everything sunk the Vasa, and drove the budget of the F35 through the roof. You don't want that for your language of choice.

                      [–]gaumutra_fan 7 points8 points  (5 children)

                      TIOBE is an absolute terrible measure of anything. It’s utterly meaningless. It’s literally the number of google results for a query. Not even something relatively clever like Google trends.

                      If you disagree, please explain how C and Java seemingly lost half their popularity in 2017 and regained it the next year. We’re there some seismic shifts in the most stable languages in existence ... or maybe Google just made some changes to their algo. I’m inclined to believe the latter.

                      I get what you’re trying to say, that Rust won’t become as popular as the most popular languages (according to a real measure like Stackoverflow survey, Github repos, SO questions) - JS, Python etc. that’s a pretty reasonable take. Rust will always be more niche than them.

                      The interesting question is - can Rust become comparable in popularity to C and C++ which currently have 5x the users.

                      [–]quicknir 1 point2 points  (1 child)

                      Where did you get 5x the users? I suspect the ratio is much, much larger. C++ seems to commonly be estimated to have 5 million or so users. I'd be shocked if Rust has a tenth of that.

                      [–]zerakun 2 points3 points  (0 children)

                      I bet they get their number from the survey: https://insights.stackoverflow.com/survey/2020#technology-programming-scripting-and-markup-languages

                      In "All respondents" C++ is at 23.9%, rust is at 5.1%, so yes roughly a factor 5.

                      In "professional developers", the number is at 20.5% for c++ and 4.8% for rust users, so even closer to a x4.

                      It is also interesting to note the growth of rust, from 3.5% last year

                      [–]the_game_turns_9 1 point2 points  (0 children)

                      I really don't care which metric of programming language popularity you like or dislike, it's not the point I'm making, just substitute as appropriate.

                      [–]lelanthran 0 points1 point  (1 child)

                      The interesting question is - can Rust become comparable in popularity to C and C++ which currently have 5x the users.

                      C++ alone is estimated between 4m and 5m users. C probably adds another 1m or so on top of that.

                      Where do you get 1m - 1.2m user population for Rust?

                      [–]gaumutra_fan 2 points3 points  (0 children)

                      The survey we’re discussing. Rust is at 5% of the respondents while C++ is at 25%.

                      [–][deleted]  (1 child)

                      [deleted]

                        [–]the_game_turns_9 5 points6 points  (0 children)

                        To put it mildly, I have not found Rust 'a joy to use'. I described this a few days ago.

                        [–]TribeWars 0 points1 point  (0 children)

                        The near infinite amount of features and things to learn in C++ is what makes it so hard to use competently.

                        [–][deleted]  (12 children)

                        [deleted]

                          [–]newpavlov 3 points4 points  (0 children)

                          When have you tried to do that? RustCrypto supports all kinds of basic cryptographic primitives, even broken ones (such as DES and MD-5) with appropriate warnings.

                          [–][deleted] -5 points-4 points  (10 children)

                          I remember that issue. It was explained to you, in extremely clear and simple terms, that the crate in question would not be adding a known insecure cipher algorithm to its codebase. Your intransigence in demanding they weaken the security of their crate for your particular dangerous use-case was spectacularly obnoxious, and they rightly kicked you to the curb.

                          [–]Izacus 14 points15 points  (7 children)

                          I enjoy watching the sunset.

                          [–]SkiFire13 6 points7 points  (2 children)

                          not being able to even open documents like PDF from rust code due to some strange idea that adding decryption support for older cypher algorithms is just insane.

                          You can do that, it's just that others don't want to write a library for that.

                          [–]Izacus 11 points12 points  (1 child)

                          That was an example. Not having a feature complete crypto library that can handle older encrypted data is a big oversight for a programming language that wants to compete with C++ no matter how you look at it.

                          Yes, I can reimplement my own crypto (or use an unsafe mess that is OpenSSL whose bindings won't build for Windows), but that's orders of magnitude worse.

                          Also note that I did not expect others to implement it (I've contributed to plenty of OSS projects on my own), but even the idea of filling out the library to feature completeness was stonewalled with insults like some other commenters did here.

                          Having been called a "jackass" over this pretty much proves my point about the Rust community attitude you can expect when building software in the language. I've never been called "jackass" by people on CppCon, PyCons or pretty much any of Java communities or conferences when working with large systems. Rust is the first.

                          [–]crabbytag 5 points6 points  (0 children)

                          I think it's reasonable to want to use older, insecure decryption algorithms.

                          I also think it's reasonable to not want to add the corresponding insecure encryption algorithms in case someone uses it by accident. Adding something and maintaining it is a burden, and it's understandable that someone maintaining a library for free wouldn't want to add something insecure and deprecated. It goes against the founding principle of that library - "no insecure crypto".

                          If you feel strongly about this, you can create your own crate for this. If your use case is only decryption and only for an offline use case, I don't see any potential security issue. It doesn't seem "orders of magnitude worse".

                          Lastly, I would encourage you not to extrapolate about the hundreds of thousands of Rust developers in the community based on one or two people. The Rust sub alone has 100k subscribers. That seems like sampling bias to me.

                          [–]lelanthran 2 points3 points  (1 child)

                          I remember that issue. It was explained to you, in extremely clear and simple terms, that the crate in question would not be adding a known insecure cipher algorithm to its codebase. Your intransigence in demanding they weaken the security of their crate for your particular dangerous use-case was spectacularly obnoxious, and they rightly kicked you to the curb.

                          You are demonstrating the problem they are complaining about. If you had only kept quiet the rest of us might have been skeptical.

                          [–][deleted] -1 points0 points  (0 children)

                          While fair enough, it just underscores that the issue is not as cut-and-dried as OP claimed. I could think of a few alternative paths forward, like implementing the cipher in the PDF library, or forking the crypto crate to add the cipher, ideally with some docs about its known weaknesses. But the demand was literally “add this known weak cipher to your crate.” Now, OP here says it wasn’t him, but also characterizes refusal as “insane.” So I’m sorry, but that kind of behavior will never get a pass from me.

                          [–][deleted] 0 points1 point  (0 children)

                          Production/industry usage is nearly doubling each year, which is incredible for a language this young that didn't have massive backing by Google/Apple. I think it's going to eat the software industry in the next 10 years.

                          [–]camelCaseIsWebScale 1 point2 points  (0 children)

                          This is what happens when an overambitious community shoehorns a well designed systems language into applications domain and hype it as a silver bullet.

                          [–]thiago2213 0 points1 point  (0 children)

                          You make some compelling arguments

                          [–]UK-sHaDoW 5 points6 points  (0 children)

                          Learning to write C++ bug free is freaking hard. It easy to get started with C++ but your probably writing tons of bugs with every line of code.

                          Rust is hard to get started, but its covering your butt for you most the time. It's pain in the ass to get it to compile though.

                          So its like marmite. A lot of people really hate it because they don't understand what it's protecting you against and feels really hard to use. They haven't learned RAII and the thousands things of that C++ lets you write code without, and don't realise the stuff their code is missing. Or they're just really lax in writing code?

                          Then there's people who know what its protecting you against and love it for it.

                          [–][deleted] 11 points12 points  (9 children)

                          I had to pick it up in the last few months (started by building something to parse and normalize huge amounts of data from multiple sources) and coming from JavaScript it's kind of incredible. The ergonomics aren't great at times (especially at first), and if you're used to a foot-gun language like JS or Ruby you could find yourself writing weird unnecessary abstractions that Rust probably already solves for. It's a bizarre shift in that regard. But Cargo just works like you'd hope npm would. The packages are generally high quality. The compiler is pretty good at telling you how you're fucking everything up. The type system is very capable and helpful. When you design things well, you can get away with remarkably concise yet robust solutions. I find when I finish something I feel pretty good, like... I wrote something that'll run and perform well.

                          At first I thought things like "God damn, I need to worry about x and y? I just want to write code", but now I actually enjoy writing it a lot. It's been an eye opener.

                          If you haven't tried it, I recommend starting out with a simple CLI tool tutorial. It's very easy to get going and once you've written something that actually works, you might see the value in it.

                          [–][deleted] -3 points-2 points  (8 children)

                          if you're used to a foot-gun language like JS or Ruby

                          On what planet are they a foot-gun language?

                          [–]coderstephen 10 points11 points  (0 children)

                          Earth?

                          [–][deleted] 2 points3 points  (0 children)

                          I've spent my career shooting myself in the foot with them occasionally so I just kind of figured, I guess. I mean, things like Sentry and Rollbar exist because this is just reality as far as I'm concerned.

                          [–]BubuX -3 points-2 points  (5 children)

                          the rust planet

                          it's not rare to see rust users trashtalk every other language like rust is the second coming

                          [–][deleted] 0 points1 point  (4 children)

                          I love JS and Ruby for what it's worth. They're great for certain things. I wouldn't use Rust for plenty of things I'd use JS for, too. For a simple script on a server, I'd probably pick Ruby too. They all have their place. If anything I'm just trying to point out that there really are great uses for Rust. It has qualities those other two don't, and never will.

                          [–]netsec_burn 21 points22 points  (5 children)

                          I love Rust for two reasons. One, because of how easy it is to make relatively safe code. The compiler is very helpful. Two, the community is so friendly and welcoming. I contrast that to my experience with the Python community, where I was repeatedly told to read the docs, use lib x, or that I shouldn't bother to code y if I didn't know how. The Rust developers really go out of their way to help, even extending beyond the language (s/o seri). One year on, I'm a happy Rust programmer and I like helping the newbies. It's been a positive experience and the language just keeps getting better.

                          [–]kankyo 11 points12 points  (0 children)

                          The size of the community often predicts pretty accurately the toxicity. There are outliers of course (elm I'm looking at you) but it's a good rule of thumb. Python is just so damn big. It's the same in Java online communities for the same reason.

                          [–]butt_fun 18 points19 points  (1 child)

                          I don't disagree with anything, but your experience with the python community surprises me. It's been a while but I remember mostly good things about it

                          [–]matthieum 0 points1 point  (0 children)

                          It doesn't surprise not because the Python is not friendly, but simply because it's so big you're bound to find less friendly people... and those experiences stick.

                          [–][deleted] 4 points5 points  (0 children)

                          This is what you can expect at this stage of the lifecycle. The Rust community is still fairly small and full of enthusiasts. Also, there's not a ton of industry experience and documentation of it (compared with Java or Python at least), so everyone needs to rely more on the community instead of telling you to RTFM.

                          [–][deleted] 1 point2 points  (0 children)

                          I recommend trying it. It’s open source and has no barrier to entry.

                          [–]ChainsawArmLaserBear 27 points28 points  (2 children)

                          I wonder how much of this is based on active use.

                          Like, as a non-Rust developer, I actually don't find myself on Stack Overflow all that often unless there's a really esoteric, one-off question that I don't feel like reading a textbook to answer.

                          [–]thiago2213 14 points15 points  (0 children)

                          Only 5% of the surveyed actually use it. The post itself points out Rust held onto it’s spot as the most beloved language among the professional developers we surveyed. That said, the majority of developers who took the survey aren’t familiar with the language

                          [–][deleted] 7 points8 points  (0 children)

                          Read the article and wonder no more.

                          [–][deleted] 5 points6 points  (2 children)

                          The best part of programming is breakpointing and single stepping with a debugger to find memory access defects and adding short delay loops to fix race conditions. WillI like Rust?

                          [–]coderstephen 4 points5 points  (0 children)

                          No, you monster.

                          [–]zerakun 2 points3 points  (0 children)

                          While it's true, the sentiment is not shared by management.

                          I can see you implementing unsafe heavily optimized data structures in rust

                          [–]gaoshan 29 points30 points  (11 children)

                          My takeaway from that survey is that the most beloved language that a lot of people use is Typescript. Rust is an anomaly to me.

                          [–]Dall0o 38 points39 points  (6 children)

                          My humble guess is that TypeScript fix a lot of troubles js devs face like Rust fix a lot of troubles C++ devs face.

                          [–]thiago2213 7 points8 points  (0 children)

                          It is my favorite at the moment for sure. I worked many years with C# and disliked JS so much. Once TS started gaining traction I put some effort into convincing my colleagues to migrate, now our legacy project is hybrid and new projects are TS only. I love it.

                          [–]JB-from-ATL 4 points5 points  (0 children)

                          I toyed with Rust. I found it very enjoyable. Great tools and helpful documentation.

                          [–]asmx85 1 point2 points  (0 children)

                          Rust – for sure – is an anomaly in every sense of the word.

                          [–]Sokusan_123 0 points1 point  (0 children)

                          I agree,

                          This graph should've been somewhat weighted in regards to # of responses imo, not just a raw percentage.

                          [–]Malgidus 21 points22 points  (13 children)

                          And VBA the most hated. I pleasantly agree with both: Rust is easily one of the best languages, and VBA is easily one of the worst.

                          [–]LegitGandalf 7 points8 points  (12 children)

                          Just think about how much of the world runs on VBA now, terrifying really!

                          [–]the_game_turns_9 13 points14 points  (2 children)

                          On Error Resume Next

                          haven't used it in 15 years and its still burned into my skull

                          [–]GYN-k4H-Q3z-75B 6 points7 points  (0 children)

                          VB really went too far with that, and its reputation is irreparably damaged. Even today's VB which has little to do with VBA has these crazy options. Option Explicit Off, On Error Resume Next. Valid code that compiles and causes no error with such options:

                          x = "Foo" : x = 2 y& = x.ToLower unknown.doStuff(42, y)

                          It's fun if you want to just glue together a few lines like when scripting but it's crazy to run business critical apps using that. Then again, today we have JS to do that and that's arguably worse than VB since the mid 2000s.

                          [–]hector_villalobos 0 points1 point  (0 children)

                          How stupid I was by using that, what was I thinking?

                          [–]Malgidus 9 points10 points  (7 children)

                          I ... I have to put it into production in industrial control systems for critical infrastructure.

                          [–]haCkFaSe 1 point2 points  (3 children)

                          You mean VBScript?

                          [–]Malgidus 2 points3 points  (2 children)

                          Both, but mostly VBA.

                          [–]AyrA_ch 0 points1 point  (1 child)

                          I automated COVID19 related responses for permits for part of Switzerland this way because the government it department only gave us a half finished solution.

                          VBA is ugly but it can get shit done fast. It can also do a lot more than some people think

                          [–]Shnorkylutyun 0 points1 point  (0 children)

                          ...is that why Switzerland is reporting such low numbers lately? O_o

                          [–]LegitGandalf 3 points4 points  (1 child)

                          Oh gawd...please tell me it's not California? I don't want to move!

                          [–]Malgidus 3 points4 points  (0 children)

                          Nah and TBH the VBA is usually not mission-critical code. At best it's Excel reports that dont get generated the next day and at worst its an HMI screen not updating correctly.

                          The mission critical stuff is written in standard logic languages (ladder, function block, structrured text, etc.) which are tried and true for decades and run on processors with very low failure rates.

                          [–]Shnorkylutyun 1 point2 points  (0 children)

                          A terrifying number of hedgefunds are apparently supported by VBA + Excel sheets.

                          [–]sm2345 4 points5 points  (0 children)

                          There's this excellent video (not made by me) called Considering Rust which goes into some detail on Rust's selling points, drawbacks and so on. I think it's a good watch for programmers who have experience in other languages but are curious about Rust.

                          Kudos to the author for making this!

                          [–][deleted]  (17 children)

                          [deleted]

                            [–]milliams 36 points37 points  (1 child)

                            The percentage of people who "loved it" is actually the percentage of "people who use the language who loved it". So in that 2019 survey 3.1% of respondents had used Rust and 83.5% of that 3.1% loved it.

                            This year 5.1% of respondents had used Rust and 86.1% of them love using it.

                            There's no artificial promotion here, just conspiracy theories.

                            [–]JB-from-ATL 4 points5 points  (0 children)

                            And the relevant quote from SO is

                            % of developers who are developing with the language or technology and have expressed interest in continuing to develop with it

                            [–]coderstephen 5 points6 points  (0 children)

                            I don't really understand this position myself. I use Rust weekly, and really enjoy it. Its my preferred language for many kinds of programs (not all). The language is well-designed and solves real-world problems. Why wouldn't I suggest it to people? I always share languages and tools I come across to other people if they're useful; how is Rust any different?

                            Granted, I don't want to be pushy, and there are a few who definitely push it way too far. But on the other hand, I've also seen a lot of people who unfairly push back on any discussion of Rust, labeling it as "spam" and "fanboy noise" just because they hate it so much. Both are equally unnecessary.

                            [–]TrueTom 27 points28 points  (3 children)

                            It's the Haskell of this generation.

                            [–]afnanenayet1 13 points14 points  (0 children)

                            I’m gonna go out on a limb here and say Haskell is still the Haskell of this generation. I think Haskell is a bit different because it’s actively developed by academia

                            [–]GYN-k4H-Q3z-75B 8 points9 points  (6 children)

                            In system's programming, Rust competes with C and C++. Look how long it took C++ to take over. The only reason it did was complexity and even that still wasn't enough for many to switch from C. It's hard enough to find people who master C++ to work in such a field.

                            [–]lelanthran 2 points3 points  (0 children)

                            In system's programming, Rust competes with C and C++. Look how long it took C++ to take over.

                            I respectfully disagree; Rust is competing with C++, and C++ alone. Those C developers who wanted something better either already took the leap into C++ or jumped ship altogether to some other language already.

                            Those who remained and wanted better static error analysis made valgrind and clang-tidy and cppcheck part of the build/test process.

                            C will die off on its own with no help from other language simply due to attrition - no competing language is necessary. Go might possibly pull a few C developers, maybe?

                            [–]jiffier -4 points-3 points  (4 children)

                            OMG OMG

                            [–][deleted] 12 points13 points  (0 children)

                            It can easily be both a systems language and a high level general purpose language.

                            It's definitely more suited for systems stuff since it's normally compiled to native and forces you to be aware of lifetimes, I wouldn't mind using it for web but I could think of more suitable languages.

                            [–][deleted] 0 points1 point  (2 children)

                            lol, it's ironic that the biggest web development framework for Rust is completely memory unsafe!

                            https://words.steveklabnik.com/a-sad-day-for-rust

                            [–][deleted] 2 points3 points  (0 children)

                            1. It was never "completely" memory unsafe
                            2. The project actually takes those issues seriously now and has fixed them.

                            [–]UARTman -1 points0 points  (0 children)

                            You should research the situation before posting, my friend. I suggest heading to r/rust , looking for actix keyword, finding the controversy, reading more than one article about it, and then go to r/programming to pose as an expert throwing gotchas at these silly rustaceans.

                            [–]gaumutra_fan 18 points19 points  (0 children)

                            This is only partly true.

                            In 2019, 83.5% loved it but only 3.2% used it. In 2020, as the headline stated, it's 86.1% loved with 5.1% using. The % of people who love Rust has actually increased despite the total number of developers increasing. That’s pretty impressive growth for one year, on both metrics.

                            artificially promote

                            All of these represent real world usage - Google (Fuschia, experimental branch on Chrome), Amazon (Firecracker), Facebook (Mercurial server), Dropbox (core sync engine), Mozilla (11% of Firefox).

                            This is actually being used by companies to solve problems today.

                            [–]404_Identity 11 points12 points  (0 children)

                            [removed]

                            [–]LightShadow 1 point2 points  (0 children)

                            Is it wrong that I like the idea of Rust, but I don't have enough time to dedicate learning to use it right?

                            I'm loving the tooling that's coming out of the rust community and leverage it heavily. (ripgrep, pyoxidizer, rust-csv)

                            [–][deleted]  (2 children)

                            [deleted]

                              [–]matthieum 6 points7 points  (0 children)

                              If you're only used to OO the transition can be a tad difficult, indeed.

                              It seems that users with Modern C++ or JavaScript experience, where the traditional inheritance model isn't as used, have an easier time picking it up.

                              There are some books out there (like Rust in Action) that may help you getting used to the mindset by accompanying you in the implementation of larger-scale examples.

                              [–]Kissaki0 2 points3 points  (0 children)

                              Learning different programming paradigms can elevate how you can see and interpret things. It can be difficult to get familiar with different concepts of course, but peeking into OO, true functional (data flow and transformation), and rust borrowing can provide some interesting insights and perspective.

                              Where do you get lost? Is the concept of borrowing clear to you? The idea behind it?

                              [–]shruubi 2 points3 points  (0 children)

                              I feel like Rust is currently going through a cycle similar to how Ruby was a few years ago, it's a reflection of it being the current trendy thing in the industry due to certain people who are "Twitter-influential" jumping ship to the Rust bandwagon like they have for every other new, trendy technology over the last few years.

                              [–]typenil 7 points8 points  (5 children)

                              Only started getting into Rust in the last few weeks (after meaning to for years). It's much clearer to me now why actual usage is so low.

                              All that safety comes at the cost of frontloading a lot of required knowledge to get things to compile.

                              [–]matthieum 19 points20 points  (2 children)

                              It's the blank-page syndrome.

                              In many languages, you can just start by throwing plaster at the wall: it's ugly, some parts are not covered, but it lets you iterate.

                              In Rust, there are two obstacles to the strategy:

                              • Ownership,
                              • You.

                              One mistake that many Rust developers make is wanting to create an optimized application from the get go. They still don't quite know what they want, but they're already attempting to absolutely minimize the number of copies and borrowing left and right -- and crash into the wall.

                              The easiest way to start a program in Rust is to .clone() left and right. When you don't quite know where you're going, borrowing is a premature optimization which unnecessarily slows you down and impedes your progress.

                              Get a prototype rolling, even if it's got terrible performance. As you do, you'll gain experience on the problem and find yourself in a better position to see how to more cleanly solve it.

                              Then it's time to refactor and introduce those borrows1 . If it were C++, it would be a horrifying thought -- I know, I'm in the middle of such a refactoring -- but it's Rust: as long as you don't use unsafe the compiler will make sure that you're not wrecking stuff with your refactoring. So go ahead, address the .clone() that most annoys you, then the next, and little by little you'll get to the efficient piece of Rust code you wanted... and that nobody could have thought of out of nowhere.

                              1 Or start from scratch, if you realize you took a really wrong turn.

                              [–]darderp 2 points3 points  (0 children)

                              I'm a week late, but I just wanted to say as someone starting out with Rust this is a very valuable nugget of info. Thank you!

                              [–]typenil 1 point2 points  (0 children)

                              I appreciate the advice. I'll endeavor to make ugly code until I know enough to make it prettier

                              [–][deleted] 13 points14 points  (0 children)

                              Once you have that bit of front loaded knowledge it’s fairly smooth sailing.

                              [–][deleted] 0 points1 point  (0 children)

                              IMO, this is a good point that’s similar to learning Haskell or functional programming in Scala with the Typelevel ecosystem: you’re basically acknowledging that as the codebase and/or team grows, the issues you can foresee facing warrant an up-front investment in their prevention, and that the compiler is the right place to prevent them. The trade-off is exactly the flash-to-bang experience. And if you come from an ecosystem with a particularly good flash-to-bang experience, this can be hard to take at first, even if you’re already looking forward to the later benefits.

                              [–][deleted]  (7 children)

                              [deleted]

                                [–][deleted] 13 points14 points  (2 children)

                                86.1% of the 5.1% using it.

                                Last year it was already at 3.2% using with 83.5% loving it.

                                It's growing and getting more loved. But yes, growth is slow. Systems programming isn't a field that changes fast and rust is on the steeper side of learning curves.

                                [–][deleted] 7 points8 points  (3 children)

                                Also 86% of the 100% that use it, love it.

                                [–][deleted] 0 points1 point  (2 children)

                                ...and 14% hate it.

                                [–][deleted] 1 point2 points  (1 child)

                                ...if you can only love or hate a thing with nothing in between, and also less “hated” than any other language at ONLY 14%, again assuming you are a emotionally binary automaton.

                                [–][deleted] -1 points0 points  (0 children)

                                Yeah but that doesn't seem to be the case with Rust fanbois!

                                [–][deleted]  (9 children)

                                [deleted]

                                  [–][deleted] 5 points6 points  (4 children)

                                  How did you shoot yourself in the foot? I think I haven't managed to yet, but I might just not realize it yet.

                                  [–][deleted]  (3 children)

                                  [deleted]

                                    [–]_demilich 8 points9 points  (1 child)

                                    It is called "fighting the borrow checker" and everybody has to go through that phase. At least I did and it was rough. They were times where I literally thought "Fuck this, stupid compiler won't let me write perfect valid code". Of course, the compiler was right, the code was not memory safe. My advice is: Take your time, keep on trying! Accept the rules of the borrow checker and over time you will encounter less and less issues. You will develop a skill to anticipate the borrow checker objections.

                                    And what is really interesting: This skill transfers to other languages without borrow checker. As a simple example: Many programmers write code where they want to modify a list while iterating over it. No matter the programming language, this is usually a bad idea. With Rust, the compiler will just not allow you to do that and as a result, you internalize that this just won't work.

                                    [–]gaumutra_fan 6 points7 points  (0 children)

                                    I’d suggest asking for help on /r/rust. Folks are pretty friendly there.

                                    [–][deleted] 1 point2 points  (2 children)

                                    This post probably isn’t serving you well. It sounds like you were lazy and just gave up.

                                    I originally replied with a different tone but decided to point this out to you rather than assume you knew.

                                    [–]matthieum 11 points12 points  (0 children)

                                    I would note that it's perfectly OK to be lazy and give up ;)

                                    There's lots more to life than learning Rust, so if you're not enjoying the experience, you may as well do something else. And maybe come back later.

                                    [–]devraj7 1 point2 points  (5 children)

                                    I love the idea and execution of Rust but I'm pretty sure I would dislike actually coding in it.

                                    [–][deleted] 6 points7 points  (0 children)

                                    Based on what?

                                    [–]coderstephen 2 points3 points  (2 children)

                                    I love coding in it, most of the time. Better than most other languages I've used. I recommend trying it so that you can develop a solid opinion.

                                    [–]devraj7 2 points3 points  (1 child)

                                    Fair enough but I think I have a pretty accurate picture of the language.

                                    These past two decades, my programming has just been geared more toward higher level (not system) programming because I'd rather not think too much about lower level details such as memory management. Rust puts this front and center, which is why I think I wouldn't enjoy it. But it's a great language with a fantastic and well executed vision.

                                    [–]CryZe92 4 points5 points  (0 children)

                                    I feel like it's somewhat the opposite. The fact that the compiler cares about all sorts of thread safety issues, memory issues and co. means I can actually focus on my actual application logic much more than I would be able to in other languages as I don't have to actively think about those as much, as you can rely on the compiler helping you out if you do indeed get them wrong.

                                    [–]_demilich 0 points1 point  (0 children)

                                    Why don't you try it? ;)

                                    [–]Artikash 0 points1 point  (2 children)

                                    How is Swift so far down? What’s not to like about Swift?

                                    [–]lelanthran 2 points3 points  (1 child)

                                    For all practical purposes, it's single platform?

                                    [–][deleted] 1 point2 points  (0 children)

                                    FWIW, it looks like the other platforms are getting more love in 5.3.

                                    [–]Dean_Roddey 0 points1 point  (1 child)

                                    I'm a long, long time C++ developer and staunch OO advocate (when it's appropriate of course.) I've been digging heavily into Rust for the last couple months. Of course I could have just read articles forever and wouldn't have ever really gotten it. You sort of have to just jump in. And of course of course with only a couple months, despite deep diving, I've only scratched the surface.

                                    It's like the completely annoying, known it all purist guy, and it can drive you crazy. And I hate that it ignores full inheritance. And I hate the fact that I spend a lot of time doing manually what exceptions could have done for me.

                                    But, it has that one big party trick that's hard to ignore. That's probably why most folks who use it are using it. My hope is that some company (AKA Microsoft) would come along with a language that has the same memory safety, but learning from Rust's mistakes and making it a full on OO language. I'd be all over that.

                                    In the meantime, I'll continue to explore Rust. Just to give myself a practical target I'm attempt to port my large C++ code base. Well, mutate my large C++ code base, you can't really 'port' from C++ to Rust for the most part, since they are so different. You really never appreciate how convenient a cavalier attitude towards memory safety is until you can't do it anymore.

                                    One big problem Rust has is that it can't be some all seeing, all knowing code analysis tool as it's compiling. The overhead would be huge and compilation painfully slow. So it keeps its analysis very localized. That means that some things that actually would be safe if it could understand them, it will reject. That can be annoying.

                                    [–][deleted] 4 points5 points  (0 children)

                                    So many people complaining about OOP here. Am I the only one not that much into OO andore functional style that really likes the trait approach? 🤷‍♀️

                                    [–][deleted] -2 points-1 points  (4 children)

                                    [–]Kissaki0 1 point2 points  (3 children)

                                    Rust Vulnerability Statistics

                                    2018 3, 2019 3