Catch up on stories from the past week (and beyond) at the Slashdot story archive

 



Forgot your password?
typodupeerror
×
Programming

Stack Overflow Investigates Why Developers Love Rust So Much (stackoverflow.blog) 83

This year Stack Overflow's Developer Survey of 65,000 programmers found that Rust was their most-loved programming language -- for the fifth year in a row. To understand why, they interviewed the top contributor to the site's Rust topic. ("The short answer is that Rust solves pain points present in many other languages, providing a solid step forward with a limited number of downsides...") But Stack Overflow also reached out to the Rust core team, including Berlin-based developer Erin Power, asking about any barriers to entry, and why they think Rust was the survey's most-loved language. ("I think it's because Rust makes big promises, and delivers on them...")

And finally, they got responses from Stack Overflow users in their Rust chatroom and forums, noting "Rust users are a passionate bunch, and I got some fascinating insights along with some friendly debates..." Many current programming discussions revolve around whether to use a fast, low-level language that lets you handle memory management or a higher-level language with greater safety precautions. For fans of Rust, they like that it does both.... While some languages just add polish and ease to existing concepts, several users feel that Rust is actually doing new things with a programming language. And it's not doing new things just to be showy; they feel these design choices solve hard problems with modern programming...

Stack Overflow user janriemer: "A quote from Chris Dickinson, engineer at npm, sums it up perfectly for me, because I have thought the same, without knowing the quote at that time: 'My biggest compliment to Rust is that it's boring, and this is an amazing compliment.' Rust is a programming language that looks like it has been developed by user experience designers. They have a clear vision (a why) of the language and carefully choose what to add to the language and what to rework, while listening to what the community really wants. There are no loose ends, it's all a coherent whole that perfectly supports a developer's workflow."

Stack Overflow's post also quotes Jay Oster, a software architect at the infrastructure-as-a-service company PubNub, who argues Rust "ticks all the boxes":
  • Memory safe
  • Type safe
  • Data race-free
  • Ahead-of-time compiled
  • Built on and encourages zero-cost abstractions
  • Minimal runtime (no stop-the-world garbage collection, no JIT compiler, no VM)
  • Low memory footprint (programs run in resource constrained-environments like small microcontrollers)
  • Targets bare-metal (e.g. write an OS kernel or device driver; use Rust as a 'high level assembler')"

He also describes Rust as "akin to wandering around in complete darkness for an entire career, and suddenly being enlightened to two facts:

  • You are not perfect. You will make mistakes. Those mistakes will cause you a lot of problems.
  • It doesn't have to be this way.

This discussion has been archived. No new comments can be posted.

Stack Overflow Investigates Why Developers Love Rust So Much

Comments Filter:
  • I'm quite tired of this. Cargo is a really good tool. I wish I had similar tools in C++. However I really dislike the language syntax. It also has a difficult learning curve and I think poor decisions have been made in the language itself (e.g. using or not using semicolon in the last statement with different meanings). Anyway, everyone else seems to love it.
    • I just looked at the source code for "blink" on the Arduino in Rust:

      https://github.com/avr-rust/bl... [github.com]

      Ewwww! Pass the eye-bleach.

      (and explain all the bugs in it, eg. setting *all* the pins in PORTB to output, not just one of them...)

      Here it is in C++:


      void setup() {
      pinMode(LED_BUILTIN, OUTPUT);
      }

      void loop() {
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      digitalWrite(LED_BUILTIN, LOW);
      delay(1000);
      }

      • Looks like "C". Just sayin.
      • Started out as a C programmer back in the late 80s/early 90s. I remember coming across an article in a Microsoft journal back in the mid/late 90s in which the author wrote and implementation of pong (of some similar game) using C++ in an attempt to demonstrate the superiority of the language and I remember thinking the same thing...
      • I am not sure that these are the same. Does C++ not require some sort of import statement to say where `digitialWrite` and `pinMode` come from? The rust also includes a statement not to include the standard library (i.e. make it extra small for embedded). You can do that in C++ I believe, but the directives need to be somewhere else (i.e. in the compiler command line).

    • by dyfet ( 154716 )

      And let us not forget disjunctive syntax. Traits are not a core part of the syntax, but expressed thru a decorator language. Shades of Objective-C.

      Yes, I love everything about it except the language itself, too. I think for what it is, it needed declarative syntax, and it would have been much better for readibility as an extended Haskell, rather than trying to present itself/wrap itself in C syntax, and then have all these horrible places where it clearly is not and breaks expections horribly.

      • by arglebargle_xiv ( 2212710 ) on Sunday June 07, 2020 @01:20AM (#60155088)

        I fucking hate rust. Hours of work with a grinder and polishing pad to strip the side panels on the 69 Camaro back to the bare metal for a respray, give it a good clean up to get any debris off and the thing fucking flash rusts on me while I have lunch.

        DEATH TO RUST!

      • And let us not forget disjunctive syntax. Traits are not a core part of the syntax, but expressed thru a decorator language

        I think this is wrong. From the documentation:


        pub trait Summary {
                fn summarize(&self) -> String;
        }

        I think you are talking about the `derive` syntax which does use a decorator. This is effectively a macro call. You don't need it, but it saves boilerplate.

    • It also has a difficult learning curve

      For some whom I've talk to about that, I've found because it forces breaking of old habits. Real dirty parallel.

      //C Example
      FILE *fptr;
      fptr = fopen("foo.txt", "r");
      if ( fptr == NULL ) //DO SOMETHING ERROR-ISH

      Now we all agree that checking of the pointer right after open is good coding. However, if you don't have it, your code will compile none-the-less. However, in Rust the file open method returns a std::io::Result, because of that, you must handle the failure condition or your code will not compi

    • by gweihir ( 88907 )

      Anyway, everyone else seems to love it.

      I don't. I could probably not care less about it, but having it shoved in your face like the greatest thing since sliced bread all the time is hugely annoying.

  • My first guess was (Score:4, Interesting)

    by Joe2020 ( 6760092 ) on Saturday June 06, 2020 @02:46PM (#60153590)

    ... they don't have a girlfriend.

    • ... admit that is accurate.
      • This is my comment.

        See what I did? Stop abusing the title/body fields!

        • ...are you so worked up about this?
          • by Euler ( 31942 )

            Because I don't read the title of every comment. So when somebody does this, I'm reading a partial sentence thinking: WTF, is my brain broken or is this person just really bad at English? oh, wait, no they are just doing that thing again... that wasted my time and now I don't care what they were saying, moving on. It seems like some type of clickbait, except probably not that great since the titles are largely ignored.

        • Why do comments have them anyway?

    • It's amazing what a person can accomplish when they stop obsessing over sex and romance. Romantic endeavours tend to claim a tremendous amount of time, energy, and resources in return for dubious gains (at least in the modern day, where infidelity, divorce, and domestic abuse are at an all-time high).

      It only takes an ounce of clarity to realize that one's self-worth has nothing to do with whether or not someone else has an irrational obsession. Then one is free to really focus on one's true passions.

  • It never sleeps.

    Hey hey, my my.
  • *Whispers to Python developer*

    "Hey I heard some Rust guys saying they had better language than Python..."

    *Steps back to watch unfolding chaos*

    • Did someone mention Ruby?

      • by bob4u2c ( 73467 )
        OMG. I remember at my last company they hired a new dev just out of college. Their first week was spent pushing dev and management to re-write the software in Ruby. All 1.5Million lines of it!

        It took a few months but his spirit was eventually broken.
    • They don't compete in the same space. Python is a scripting language used to "glue" libraries written in faster languages.

      Rust seeks to replace C and C++. Major competitors in that race include Go, Swift, etc.--generally, any language that claims to be capable of "systems" programming. Nobody is claiming that you'd want to write an OS kernel in Python.

  • by mykepredko ( 40154 ) on Saturday June 06, 2020 @02:57PM (#60153626) Homepage

    When I look at the methodology used for the survey:

    Respondents were recruited primarily through channels owned by Stack Overflow.

    I don't see any indication that any work was done to prove that StackOverflow users are representative of mainstream programmers - I have no reason to think that they're not but I also have no reason to think that they are.

    This is the problem of the "Most liked Programming Languages" surveys that show up on Slashdot every two weeks or so - the sample population is limited in some way with no indication of whether or not their representative of the *entire* population out there (although I'm more interested in specific segments).

    • by Somervillain ( 4719341 ) on Saturday June 06, 2020 @03:24PM (#60153732)

      I don't see any indication that any work was done to prove that StackOverflow users are representative of mainstream programmers - I have no reason to think that they're not but I also have no reason to think that they are.

      Great point!!! I honestly never thought of that, but I know a lot of people that LOVE Java and C#, the 2 unsexiest languages, and never visit stack overflow. You go to StackOverflow when you're in trouble or new. I go there all the time for JavaScript frameworks and Python, 2 things I don't know much about, but rarely for core Java or SQL because I know those languages so well and have worked with them for so long, I never have to refer to anything but the standard docs (I rarely even have to refer to those these days). I don't think I've ever gone there for HTML oncek, because I've been working with that since the 90s.

      Asking StackOverflow what the best programming language is like asking an ER doctor who makes the best motorcycles. He's only seeing the ones that had accidents...not all the people that operate their vehicles safely and without drama.

      So yeah...StackOverflow is not a representative sample of working professionals. It's a representative sample of enthusiasm and which languages people need the most help with or are getting started with. Don't get me wrong, enthusiasm is a good metric, but not the one I care about. I care more about what people are going to pay me to do, not what is fun to work with. I love to program, but I focus my time on getting paid.

      • by DontBeAMoran ( 4843879 ) on Saturday June 06, 2020 @05:20PM (#60154116)

        StackOverflow is not a representative sample of working professionals. It's a representative sample of enthusiasm and which languages people need the most help with or are getting started with.

        You could even argue that StackOverflow represents the worst and most annoying languages available out there.

      • I have 20-some odd years of professional programming experience and I use StackOverflow as a quick reference. It's a fast site that is indexed well from Google, so it's often the quickest way to find an example to remind me, or give me a clue of how to do something. Sure, there is plenty of junk in there, just like the rest of the internet, and just like many of those "authoritative" books we used to read.

        • I have 20-some odd years of professional programming experience and I use StackOverflow as a quick reference. It's a fast site that is indexed well from Google, so it's often the quickest way to find an example to remind me, or give me a clue of how to do something. Sure, there is plenty of junk in there, just like the rest of the internet, and just like many of those "authoritative" books we used to read.

          Ditto, except I have 30-some odd years of professional programming experience. I use too many languages and toolsets to remember everything all the time, so I hit Google dozens of times per day to look up bits of syntax, libraries, idioms, etc., and an awful lot of those searches send me to StackOverflow... and I often find someone else asking exactly the question I needed to answer, with high-quality responses. It's a very valuable tool. As a way to give back, and for fun, I occasionally answer question

    • Rust most loved among programmers that need a lot of help.

      They're actually using something else. But they imagine themselves using a lower level language in the future, and they imagine it will be rust.

    • by hjf ( 703092 )

      Yes. In all these "surveys" i always read "C is the most used language". And think to myself, WTF? C# isn't even in their radar.
      There are a LOT of .NET programmers out there. I know the loud anti MS crowd hates it, and loves to program JS on a mac, but .NET has a huge user base. And so does Java.

      Maybe SO is relevant because JS is incredibly difficult when it comes to dealing with really large software? And .NET (or any other strongly typed language with good IDE support) makes refactoring a breeze?

      I do both

  • ...can they see why kids love the taste of Cinnamon Toast Crunch?
  • My first thought when I saw that was.

    Hold my beer and watch this.

  • My programming experience goes back to the days of SOAP. In the past few decades, anything I write (nothing major) is Bourne shell, C, or Python (the latest addition to my kit). I leave it to those who are delivering applications in resource-constrained environments to speak up. However, passing popularity is not an indicator of much. Look at music. Remember Tiny Tim?
    • by gweihir ( 88907 )

      However, passing popularity is not an indicator of much. Look at music. Remember Tiny Tim?

      Fortunately not! I do very much agree though. People that are "passionate" for a tool pretty much universally have some shortcoming they hope that tool will fix. Everybody else may find the tool convenient or nice, but "passion" does not come into it.

      • People that are "passionate" for a tool pretty much universally have some shortcoming they hope that tool will fix.

        And yet here you are, on a Sunday, posting the same responses that you post every time Rust comes up.

        Does your logic hold for passionately grumpy as well? What short comings do you have that you are trying to fix?

        • by gweihir ( 88907 )

          Oh, you think I am "passionate"? Whatever gave you that idea? Browsing /. is just something I do for entertainment, as is insulting nil-whits like you.

  • New fad. Programming languages and configuration management tools seem to be the worse. Every few years its something new. They pick some part of the old fad and "fix" it in the new while ignoring the rest. If it catches any ground we have to deal with massive efforts to move infra-n-tooling from the old fad to the new. Rinse-n-Repeat. Every now and then you have a full circle event(c->go). Imagine if all of that effort had gone into improving c over all these years. I don't "c" it going away any
    • Its called C++

      • The makers of go would disagree.
      • Re: (Score:2, Informative)

        Its called C++

        C++ isn't an improvement over C.

        • by gweihir ( 88907 )

          Its called C++

          C++ isn't an improvement over C.

          Not really. It is a mess and was designed by somebody that was not clear on what he wanted to achieve when he designed it. There are whole projects written in OO C (not C++), because C++ really gets it wrong. (Yes, you can do OO in C. It requites understanding what you are doing, but with that it is not hard. Basically it is very similar to the OO model of Python or Lua.)

          • Its called C++

            C++ isn't an improvement over C.

            Not really. It is a mess and was designed by somebody that was not clear on what he wanted to achieve when he designed it. There are whole projects written in OO C (not C++), because C++ really gets it wrong. (Yes, you can do OO in C. It requites understanding what you are doing, but with that it is not hard. Basically it is very similar to the OO model of Python or Lua.)

            The biggest difference between the two languages:

            C: Memorise these 6 independent pitfalls and you won't get into trouble.

            C++: Memorise these 60 pitfalls, and all the ways they can interact, and you won't get into trouble.

          • > It is a mess and was designed by somebody that was not clear on what he wanted to achieve when he designed it.

            Which is more than a little sad, because the uptake was instant and widespread in spite of this being obvious to everyone who actually did to OO programming. But it said AT&T on it, so it must be the Official New C, and if AT&T is blessing OO, then, well, I guess it was a good idea all those years we Real Men were pooh-poohing it and anyone who says it sucks is a luser. And there you ha

    • by gweihir ( 88907 )

      Indeed. There is some evolution in some areas, but this thing is not it. I myself have moved back to C for all heavy lifting after having tried quite a few other things, but having Python as glue on top is nice and convenient.

  • by QuietLagoon ( 813062 ) on Saturday June 06, 2020 @04:34PM (#60153950)
    I wish they hadn't said that. It makes those who use Rust seem more like a cult than developers.
  • Haskell, which couldn't be more high-level, is between C and C++ in terms of speed. If wielded by a competent programmer. Like in C.
    And so is OCAML.
    Showing clearly, that that statement is only a religious belief.

    But Haskell has so many guarantees that others could not even dare to think about. And syntactically, C-likes are butt-ugly compared to it. Not to mention cumbersome and verbose.

    So, sure, if you can only think in C-likes, and thought C or C++ were the epitome of programmig languages, and also loved

    • Just like how to a child raised on frozen pizza, Pizza Hut must be amazing.

      What are you talking about? Pizza Hut is amazing! I mean, cheese inside the crust? That's innovation and courage right there! Take that, Apple!

    • by gweihir ( 88907 )

      Haskell, which couldn't be more high-level, is between C and C++ in terms of speed. If wielded by a competent programmer. Like in C.

      Well, it depends. For some tasks, sure. For others, no chance in hell. A competent programmer would not use it for the second type though or would add a library for the core of that specific task. Or, if small, use inline-C in Haskell. The mere presence of that possibility already marks it as a tool aimed straight at competent people that know what they are doing.

      In the end, there are tools that let competent coders do their thing, and there are tools that try to aid semi-competent and incompetent ones, but

  • by nospam007 ( 722110 ) * on Saturday June 06, 2020 @04:36PM (#60153968)

    "Stack Overflow Investigates Why Developers Love Rust So Much "

    No Stack Overflow?

  • Seriously, can we do something about the name? Some people need to "market" this thing to non-technical people.
  • "It's a fool that looks for logic in the chambers of the human heart."
    -- Joel Coen

  • Whoever was ins a state "akin to wandering around in complete darkness for an entire career" has absolutely no business writing software because of a massive lack of insight. Nobody competent has that problem. Yes, competent coders are a minority, but the others will _not_ be fixed by this magic new religion called "Rust". What they crate will still suck and mess it up and they will just get more dangerous this way.

    It does explain the fanatical admiration though: Finally something that promises to make them

    • Have you really never had the way that you think and you operate challenged by a new piece of technology?

      For me, I can think of it happening several times in my career. Some of these were a long time ago: the first time I saw OO, when I discovered version control, then dependency management tooling and/or repos like CPAN, or maven. More recently, the simplicity of text markup like markdown, and (ironically) a walk away from OO.

       

    • So what you're saying is, Rust programmers are the IT industry's equivalent of ISIS.

      Hmm, I'll have to sit on this for a while.

      • I wonder if comparisons to ISIS should be considered equivalent an extension to Godwin's law.

  • As per other surveys, such as the one in this slashdot story:
    https://developers.slashdot.or... [slashdot.org]
    The vast majority of developers who say they love Rust, don't use it or have never used it (86% of respondents said they love it, only 5% said they use it).

    Maybe Stock Overflow should have focused their investigation on the majority of the people who say they love it. Finding out why do the creators and contributors of the language love it does not answer the question why most people say they love it.

  • When 5 years from now a slightly better language will show up. And in 10 years a massively better one shows up. Undoubtedly interest in Rust is growing. Some of that interest might be better explained by a sociologist than by a computer scientist. Multi-paradigm languages that can list the right marketable set of bullet points are pretty attractive, and can reach multiple industries and markets. It's a weak metric to use, but without actually learning the language it's hard for a person to judge if it is ef

    • Thereâ(TM)s not going to be a jump forward like Rust any time soon. And thatâ(TM)s because of computer science and logics, not sociology. Rust uses a variation of affine logic to prove memory safety and other critical properties at compile time. And relevant logics arenâ(TM)t invented very often at all. The jump from C whose design isnâ(TM)t underpinned this way to Rust is not going to come again. Rust is the first language to bring memory safety without a runtime system to a practical l

    • If you can solve your problem with Python, then you should. Rust is for when you would otherwise have to use C. Until the invention of Rust, there were many situations where you had to use C and, therefore risked security vulnerabilities due to its lack of memory safety. Even today, there are situations where you have to use C.

  • Rust is the very long overdue successor for C we've all been wanting and waiting for. The Mozilla crew finally had enough, put their heads together, went for the long haul, did the hard work and came up with a replacement. We all looked at if and said: "Yup, that's worthwhile learning." and made the move.

    This isn't rocket science. Rust is the breath of fresh air we all needed and it's good enough that we're willing to stick with it.
    C will be around for another few decades, but Rust will be the go-to systems

Thus spake the master programmer: "Time for you to leave." -- Geoffrey James, "The Tao of Programming"

Working...