Slide with text: “Rust teams at Google are as productive as ones using Go, and more than twice as productive as teams using C++.”

In small print it says the data is collected over 2022 and 2023.

      • dustyData@lemmy.world
        link
        fedilink
        arrow-up
        20
        ·
        6 months ago

        If that’s the measure then I’m more productive than all of Google combined. Nowhere in the definition says the project has to work as intended or even compile.

        • LeFantome@programming.dev
          link
          fedilink
          arrow-up
          8
          arrow-down
          1
          ·
          6 months ago

          I know you are joking but needing to compile is probably one of the reasons “teams” are more productive in Rust.

          You cannot check something into the build system unless you can build. Once Rust is compiling, you have eliminate scores of problems that may still be in equivalent C++ code.

          Rust works to limit the damage one dev can do to the codebase.

          • sugar_in_your_tea@sh.itjust.works
            link
            fedilink
            arrow-up
            5
            ·
            6 months ago

            I take that as a challenge. :)

            But yes, that compiler checks and awesome linter is one of the main reasons I use Rust. I like working with concurrent and parallel code, and Rust makes that really safe.

          • bluGill@kbin.social
            link
            fedilink
            arrow-up
            2
            ·
            6 months ago

            my python doesn’t need to parse to pass cI, at least to long as I don’t write tests that run that code section. Checkmate all languages that have to compile. /s

        • XTL@sopuli.xyz
          link
          fedilink
          arrow-up
          1
          ·
          6 months ago

          Maybe that counts technically, but it’s just not the same if the project doesn’t have a solid user base when it gets killed.

          • dustyData@lemmy.world
            link
            fedilink
            English
            arrow-up
            1
            ·
            6 months ago

            I am the user base and, despite my best effort, have not yet turned into a liquid. If I kill my project, does it count? Can I be Alphabet now?

      • ikidd@lemmy.world
        link
        fedilink
        English
        arrow-up
        13
        ·
        6 months ago

        “We’re abandoning projects at an unprecedented rate, proving our commitment to the bottom line.”

    • offbyone@reddthat.com
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      6 months ago

      It seems likely biased as well unfortunately if they let teams decide on their own what to use. I would wager that teams who on their own switched to Rust are probably teams that were already productive.

  • bluGill@kbin.social
    link
    fedilink
    arrow-up
    62
    arrow-down
    1
    ·
    6 months ago

    I was a lot more productive in C++ 15 years ago when the current project was 100% greenfield. Now that the code is 15 years old I’m much less productive because over the years we have discovered mistakes we made. I suspect I’m still more productive than the average C++ programmer because 15 years ago modern C++ was known (c++11 was still a couple years away though) and so we didn’t do a lot of the mess that people hate on C++ for.

    Which is to say I want to know how productive those programmers will be in 15 years when the shiny of rust has warn off and they are looking at years of what seemed like a good design but current requirements just don’t fit.

    • orclev@lemmy.world
      link
      fedilink
      English
      arrow-up
      26
      arrow-down
      3
      ·
      6 months ago

      I suspect a large part of that will depend on how well Rust keeps the feature creep in check. C++ was a bit of a language design magpie. Pretty much any language design idea anyone had ever got pulled into the language and it turned into a real mess. Many of those features are incompatible with each other as well, so once you use one feature, you’re no longer able to use one of the competing ones, which has lead to partial fragmentation of the ecosystem (interestingly enough D who set out to be a “better” C++, also ran into a similar but far worse situation). Many of those features have also been found to be problematic in various ways and have fallen out of favor recently and so are viewed as warts on the language, or failed experiments.

      Rust is still young, so there aren’t very many competing features, and none that I’m aware of that are considered things to avoid. If it can manage to keep it’s feature set under control by actively deprecating and removing features that are problematic, and being more judicious than C++ was in pulling in new ones it should be able to avoid the same fate as C++. Time will tell I suppose.

    • ulterno@lemmy.kde.social
      link
      fedilink
      English
      arrow-up
      3
      ·
      edit-2
      6 months ago

      I feel like I work well even without the new C++ features smart pointer stuff, simply because:

      1. Most of my projects are solo and I keep all flows in my mind
      2. I started programming with C, then understood memory on systems as well as I could and then came to C++
  • EnderMB@lemmy.world
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    edit-2
    6 months ago

    I’d love to know how they measured this, because if they just took two Jira boards for two projects, compared the ticket times, and said “yep, Rust is good” that’s both insane and completely expected by some big tech managers.

    I don’t deny it, it’s just nice to see reasoning with a headline, so that I could take it to another team and say “let’s try Rust because…”

    • ulterno@lemmy.kde.social
      link
      fedilink
      English
      arrow-up
      0
      arrow-down
      2
      ·
      6 months ago

      Yeah, it’s different projects, most probably on different levels.
      And considering recent layoffs, having different calibre of programmers on each.

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    27
    arrow-down
    3
    ·
    6 months ago

    Is it because c++ devs need half their day for recovering from the trauma of reading and writing c++? /s

  • Kissaki@programming.dev
    link
    fedilink
    English
    arrow-up
    17
    ·
    6 months ago

    Commenter on Reddit (OP there) gives a talk link and summarization:

    In the talk, Lars mentions that they often rely on self-reported anonymous data. But in this case, Google is large enough that teams have developed similar systems and/or literally re-written things, and so this claim comes from analyzing projects before and after these re-writes, so you’re comparing like teams and like projects. Timestamped: https://youtu.be/6mZRWFQRvmw?t=27012

    Some additional context on these two specific claims:

    Google found that porting Go to Rust “it takes about the same sized team about the same time to build it, so that’s no loss of productivity” and “we do see some benefits from it, we see reduced memory usage […] and we also see a decreased defect rate over time”

    On re-writing C++ into Rust: “in every case, we’ve seen a decrease by more than 2x in the amount of effort required to both build the services written in Rust, as well as maintain and update those services. […] C++ is very expensive for us to maintain.”

  • M500@lemmy.ml
    link
    fedilink
    English
    arrow-up
    12
    ·
    6 months ago

    That’s pretty cool. I’m not advanced enough to really understand all the ways rust is better but I read nothing but good things about it. It seems pretty universally loved.

    • orclev@lemmy.world
      link
      fedilink
      arrow-up
      18
      arrow-down
      3
      ·
      6 months ago

      Basically modern language with modern tooling. It’s what C++ would look like if it had been designed today. The big thing though is the abstraction of ownership and lifetimes which took C++ ideas of scopes, smart pointers, and destructors and polished them into something much more powerful. Simply put it’s possible to design APIs in Rust that are literally impossible to express in any other language, and that’s a big deal.

      Added on top of that is a modern dependency management system that is severely needed in languages like C and C++, and a very powerful meta programming system that enables compile time code generation and feature selection that’s much safer and powerful than C and C++ fairly primitive pre-processor (although C++ STL does come close).

      • TrickDacy@lemmy.world
        link
        fedilink
        arrow-up
        10
        arrow-down
        2
        ·
        6 months ago

        it’s possible to design APIs in Rust that are literally impossible to express in any other language

        This sort of violates what I’ve always heard about computer science. I’ve always heard logic is logic.

        • orclev@lemmy.world
          link
          fedilink
          arrow-up
          12
          ·
          6 months ago

          Hmm, yes and no. You can express a program that does anything in any language, but API design is as much about what can’t be expressed (with that API) as what can. A well designed API lets you do the things that are desirable while making it impossible to do things that aren’t. You can of course bypass APIs to do anything the language allows, even in Rust if you break out the unsafe blocks and functions there’s pretty much nothing you can’t bypass with enough effort, but you very much have to set out to not use the API to do that.

          • pooberbee (any)@lemmy.ml
            link
            fedilink
            arrow-up
            4
            arrow-down
            1
            ·
            6 months ago

            I think your quantifier of “any other language” is the issue. There are certainly languages with far more powerful type systems than Rust, such as Coq or Lean.

            • orclev@lemmy.world
              link
              fedilink
              English
              arrow-up
              7
              arrow-down
              1
              ·
              6 months ago

              Maybe, although I’m not aware of any other language that has the same abstraction around ownership and lifetimes. Most other languages I’m aware of that have more (or equivalently) powerful type systems are also GCed languages that don’t let you directly control whether something gets stack or heap allocated. Nor due they allow you to guarantee that a variable is entirely consumed by some operation and no dangling references remain. While at a high level you can write something that accomplishes a similar result in other higher level languages, you can not express exactly the same thing due to not having direct access to the lower level memory management details.

          • lolcatnip@reddthat.com
            link
            fedilink
            English
            arrow-up
            6
            ·
            6 months ago

            You can leak memory in Rust if you want to (and it’s occasionally desirable). What the type system prevents is mainly accessing memory that has been deallocated. The prevention of memory leaks uses RAII just like C++. The main difference related to allocation is that there’s no “new” operator; you can pretty much only allocate memory through the initialization of a smart pointer type.

            • orclev@lemmy.world
              link
              fedilink
              English
              arrow-up
              4
              ·
              6 months ago

              I’d argue it also prevents you from accidentally leaking memory. You have to be pretty explicit about what you’re doing. That’s true for pretty much anything in Rust, every bad thing from C/C++ is possible in Rust, you just have to tell the compiler “yes, I REALLY want to do this”. The fact that most of the really dangerous things are locked behind unsafe blocks and you can set the feature flag to disable unsafe from being used in your code goes a long way towards preventing more accidents though.

              • lolcatnip@reddthat.com
                link
                fedilink
                English
                arrow-up
                5
                ·
                6 months ago

                I agree Rust makes it virtually impossible to leak memory by accident. The difference I wanted to point out is that leaking memory is explicitly not considered unsafe, and types like Box have a safe “leak” method. Most “naughty” things you can do in Rust require using the “unsafe” keyword, but leaking memory does not.

                • tatterdemalion@programming.dev
                  link
                  fedilink
                  arrow-up
                  3
                  ·
                  edit-2
                  6 months ago

                  Cyclic reference-counted pointers are the most probable way to accidentally leak memory. But it’s a pretty well known anti-pattern that is not hard to avoid.

        • orclev@lemmy.world
          link
          fedilink
          English
          arrow-up
          4
          ·
          6 months ago

          So, it’s C#?

          No, that’s what Java would look like today if designed by a giant evil megacorp… or was that J++. Eh, same difference. /s

          This did make me laugh though. Anyone else remember that brief period in the mid-90s when MS released Visual J++ aka Alpha C#? Of course then Sun sued them into the ground and they ended up abandoning that for a little while until they were ready to release the rebranded version in 2000.

      • bluGill@kbin.social
        link
        fedilink
        arrow-up
        4
        arrow-down
        5
        ·
        6 months ago

        Added on top of that is a modern dependency management system that is severely needed in languages like C and C++

        I won’t disagree, but what Rust did is not the correct answer. Better than C++ perhaps, but not good enough. In the real world my code is more than Rust. I’m having trouble using rust because all my existing code is C++ and the dependency management does not work well with my existing build system and dependency management. If you want a dependency manager it needs to cover all languages and be easy to plug in whatever I’m doing currently. This is NOT an easy problem (it might not even be possible to solve!), but if you fail you are useless for all the times where dependency management is hard.

        • orclev@lemmy.world
          link
          fedilink
          English
          arrow-up
          5
          arrow-down
          2
          ·
          edit-2
          6 months ago

          I won’t disagree, but what Rust did is not the correct answer.

          It’s hard to say that what Rust did was not correct when it’s better than what C++ has (nothing, or rather it punts to the OS and user to handle it). I agree it’s far from perfect but it’s as good as pretty much any other languages dependency management system that I’m aware of. If you know a better one I’d love to hear about it because yes, there are still gaps and pain points. I’d argue many of those gaps and pain points are a legacy of C and C++ though. The fact that C/C++ never had an actual dependency management system meant that the OS had to provide one, and every OS more or less went about it in an entirely different fashion (and even worse in the case of Linux, every distro went about it in a different fashion). This has massively complicated things because there is a HUGE body of C/C++ libraries that are very desirable to use with absolutely no consistent way to do so. It’s not as simple as just adding the ability to pull from the C/C++ repo for any of those dependencies, because there is no such thing.

          • 2xsaiko@discuss.tchncs.de
            link
            fedilink
            arrow-up
            4
            ·
            6 months ago

            If you know a better one I’d love to hear about it

            OCaml’s OPAM. They actually took into account that it could be desirable to use software written in other languages in your OCaml project. It even has a bunch of stuff packaged that’s written in Rust. Imagine that the other way around. It only has stub packages for compilers like gcc but I assume that’s likely because they don’t want to have people spend hours building the whole thing themselves when there’s a perfectly good one on their system, rather than it not being possible to do.

            I love Rust but I will die on this hill that combining package manager and build system like Cargo does and then only making it work for a single language is a lot worse than what C++ does, because if it doesn’t work for your project you’re screwed. Everything expects you to use Cargo, especially if you intend to publish a library, with C++ you can at least pretty much always get the build setup to do what you need, and you can import whatever as long as it comes with a pkg-config file.

            Added on top of that is a modern dependency management system that is severely needed in languages like C and C++

            You’re looking for Nix (unless you’re a Windows developer, work on getting that to work is ongoing). There’s very likely other good ones too, but this is the one I like and am familiar with. The difference is that it’s not a package manager for C++, but a package manager that also packages C++ packages. Which makes it so much more versatile than something like Cargo, because you can accurately represent dependency chains regardless of what language each package is written in. My Nix + CMake projects will build consistently on every Linux or Mac computer (you can’t say the same for Rust crates because they will look for stuff in system directories because Cargo can’t package anything that isn’t Rust), and you can depend on them similarly to how you would a Rust crate, with the difference that you can depend on them not only in another C++ project, but also in a Python package, a Go package, or whatever else that can be packaged with Nix. And if you can’t use Nix, then you can always build the CMake project directly, package it somewhere else maybe, because the two parts are not coupled together at all.

            • orclev@lemmy.world
              link
              fedilink
              English
              arrow-up
              2
              ·
              edit-2
              6 months ago

              I’ll look into OPAM, it sounds interesting.

              I disagree that combining build and package management is a mistake, although I also agree that it would be ideal for a build/package management system to be able to manage other dependencies.

              A big chunk of the problem is how libraries are handled, particularly shared libraries. Nix sidesteps the problem by using a complex system of symlinks to avoid DLL hell, but I’m sure a big part of why the Windows work is still ongoing is because Windows doesn’t resemble a Linux/Unix system in the way that OS X and (obviously) Linux do. Its approach to library management is entirely different because once again there was no standard for how to handle that in C/C++ and so each OS came up with their own solution.

              On Unix (and by extension Linux, and then later OS X), it was via special system include and lib folders in canonical locations. On Windows it was via dumping everything into C:\Windows (and a lovely mess that has made [made somehow even worse by mingw/Cygwin then layering in Linux style conventions that are only followed by mingw/Cygwin built binaries]). Into this mix you have the various compilers and linkers that all either expect the given OSes conventions to be followed, or else define their own OS independent conventions. The problem is of course now we have a second layer of divergence with languages that follow different conventions struggling to work together. This isn’t even a purely Rust problem, other languages also struggle with this. Generally most languages that interop with C/C++ in any fashion do so by just expecting C/C++ libraries to be installed in the canonical locations for that OS, as that’s the closest thing to an agreed upon convention in the C/C++ world, and this is in fact what Rust does as well.

              In an ideal world, there would be an actual agreed upon C/C++ repository that all the C/C++ devs used and uploaded their various libraries to, with an API that build tools could use to download those libraries like Rust does with crates.io. If that was the case it would be fairly trivial to add support to cargo or any other build tool to fetch C/C++ dependencies and link them into projects. Because that doesn’t exist, instead there are various ad-hoc repositories where mostly users and occasionally project members upload their libraries, but it’s a crap-shoot as to whether any given library will exist on any given repository. Even Nix only has a tiny subset of all the C/C++ libraries on it.

          • bluGill@kbin.social
            link
            fedilink
            arrow-up
            2
            ·
            6 months ago

            Dependency management has to deal with the real world where what we didn’t know in 1970 hurts us.

            • orclev@lemmy.world
              link
              fedilink
              English
              arrow-up
              4
              ·
              6 months ago

              Dependency management has to deal with the real world where what we didn’t know in 1970 hurts us.

              I’m having trouble understanding the point you’re trying to make here. You seem to be angry at the Rust dependency manager for not being perfect, but also admit that it’s better than C++. Is there some dependency manager you like more than what Rust provides? Do you have any suggestions for how Rust could improve its dependency management?

              • bluGill@kbin.social
                link
                fedilink
                arrow-up
                2
                ·
                6 months ago

                I said this is a hard problem and might not even be solvable.

                rust is not better than C++ if you are in any of those cases where rust doesn’t work. Not really worse, but not better either. If it works for you great, but it is worse for me as rust fight our homegrown system (which has a lot of warts )

                • orclev@lemmy.world
                  link
                  fedilink
                  English
                  arrow-up
                  3
                  ·
                  6 months ago

                  So you’re point is that your custom home grown workaround to a failure of C++ doesn’t play well with Rusts official solution to the same problem? And therefore Rusts solution isn’t better than C++ lack of a solution?

                  While that is unfortunate for you and you certainly seem to have tech-debted yourself into a particularly nasty corner, I’m not sure that logic follows.

    • asdfasdfasdf@lemmy.world
      link
      fedilink
      arrow-up
      6
      ·
      6 months ago

      A lot of it is about moving problems from runtime to compile time. JS, for example, has most problems live in runtime.

      Imagine you’re hiring an event planner for your wedding. It’s an important day, and you want it to go well and focus on the things that matter to you. Would you rather hire an even planner that barely interacts with you up until the wedding because they’re so “easy to work with”? Or one that gets a ton of info and meets with you to make sure they can get everything they need as early as possible?

      Rust is like the latter. JS is like an even planner who is just lazy and says “we’ll cross that bridge when we come to it” all the time.

      C++ is like a meth addict.

  • tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    6 months ago

    They should compare defect rate with the Go teams. I’m curious if the advertised benefits of Rust’s type system give some practical advantage.

    EDIT: Just watched the actual talk. Apparently they did this comparison, and found that Rust has fewer defects when compared to Go.

  • ulterno@lemmy.kde.social
    link
    fedilink
    English
    arrow-up
    10
    arrow-down
    1
    ·
    6 months ago

    I feel like they are just trying to Subliminally push Go and failing at the Subliminal part.

    • swordsmanluke@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      6 months ago

      Google: It’s a three-pronged attack: sub-liminal, liminal and super-liminal.

      Lisa: Superliminal?

      Google: I’ll show you. (leans out of window) Hey, you! Code in Golang!

      Carl: Uh, yeah, all right. Lenny: I’m in.