• Zangoose@lemmy.world
    link
    fedilink
    arrow-up
    199
    arrow-down
    2
    ·
    2 days ago

    The irony of this meme being posted from a platform written in rust is pretty great ngl

  • LordKitsuna@lemmy.world
    link
    fedilink
    arrow-up
    90
    arrow-down
    2
    ·
    2 days ago

    I get the joke, but rust is actually pretty heavily used in the backend of services theae days. Cloudflare, Amazon, Dropbox, just to randomly name a few off the top my head. Have pretty heavily invested it into their back ends for more reliable service.

    • CatLikeLemming@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      28
      arrow-down
      2
      ·
      2 days ago

      Over the last one or two years I feel like Rust haters have gotten even louder than the Rust evangelists. For every person who declares “Rewrite it in Rust!” I see two or three people saying how they hate Rust or how pointless it is and so on.

      • iglou@programming.dev
        link
        fedilink
        arrow-up
        23
        arrow-down
        2
        ·
        2 days ago

        I am convinced Rust haters are simply refusing to learn something new, consciously or not.

      • lad@programming.dev
        link
        fedilink
        English
        arrow-up
        13
        arrow-down
        1
        ·
        2 days ago

        Yeah, this whole meme just looks like ‘I hate Rust and don’t want it anywhere’

        Of course, there is importance in trying it everywhere, because it shows where the language and ecosystem lacks and can evolve; but beside that, I think adoption by big companies wouldn’t happen if it wasn’t any good as some want to believe

  • vga@sopuli.xyz
    link
    fedilink
    arrow-up
    41
    ·
    edit-2
    2 days ago

    Rust is fearlessly upholding the whole thing even without touching it. Incredible!

  • exocortex@discuss.tchncs.de
    link
    fedilink
    arrow-up
    26
    arrow-down
    3
    ·
    2 days ago

    I get the meme (though why was this single unstable point - imagemagick in the original xkcd - removed? To make the left side seem more stable clmpared to the original idea?), it might be trueish atm. But with rust I feel that a lot of projects that are rewritten in rust are quicker arriving at a “finished” (or almost finished) state where they are more or less just tools being used without much discussion anymore. I guess a lot of commonly used tools already use Rust in some way, but i rarely is an issue which makes this discussion-worthy or generates enough conflict in order to raise awareness outside.

    I have a hunch that open-source rust-devopment is less of a hassle as a lot of discussion about code or the quality therof is simply avoided by a stricter compiler. If the code committed compiles with rustc there’s less possibility of it breaking other things in the codebase or containing hidden dangers that need to be discussed. Overall less friction, less overhead and distruction from the actual coding.

    • _stranger_@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      2 days ago

      Old programs everyone agrees do exactly what they should are a perfect target for “black box” porting to a new language, where the only criteria for success are “it should function exactly like before, just more efficiently, while being more maintainable”

  • Simulation6@sopuli.xyz
    link
    fedilink
    arrow-up
    23
    arrow-down
    2
    ·
    2 days ago

    Rust is actually awesome in many ways. No always the right solution, but nice to have in your toolbox.

    • Croquette@sh.itjust.works
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      2 days ago

      Where would you say Rust isn’t the right solution?

      We always hear how great Rust is, but I’d be curious to know where it isn’t.

      • rumba@lemmy.zip
        link
        fedilink
        English
        arrow-up
        11
        ·
        2 days ago

        Rust provides safety and protection.

        Rust isn’t as rapid as other options, has less library support, and porting existing code is relatively difficult.

        IMO because of the workarounds you need to do to handle the memory safety, you end up with a lot more hard to solve bugs than you do with conventional languages. It should be noted however that the bugs don’t end up being security vulnerabilities like they do in conventional systems.

        If you have something that needs to be structurally sound and/or you have enough talented people willing to work on it, it’s a great option. If it needs to be fast and cheap and you don’t have a gaggle of rust developers on hand and it’s already written in another language, it might not be the best solution.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          I come from embedded C, so what you describe doesn’t feel alien to me (minus the security vulnerabilities haha)

          I much prefer working with Rust restrictions than a higher level language without hard types because I am used to it.

        • Limaj@techhub.social
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          2 days ago

          @rumba @Croquette They’re is a lot of people scrambling to rewrite existing c projects in rust for what?
          for example ffmpegs rust rewrite is slower than the c version we need more maintainers rather than creating new rust alternatives that have no purpose

          • rumba@lemmy.zip
            link
            fedilink
            English
            arrow-up
            4
            ·
            2 days ago

            If you want to ignore re-making things out of memory-safe technology as an advancement, we don’t really have anything to talk about here.

          • Croquette@sh.itjust.works
            link
            fedilink
            arrow-up
            1
            ·
            1 day ago

            I know Rust superficially. I use it to create simple tests for my embedded projects, so mostly just serial terminal with keyboard inputs.

            It works a lot better for me than python because Rust is a lot closer to C than python.

            So I cannot comment on Rust shortcomings. I was interested in knowing for what kind of projects Rust wasn’t good.

      • NeatNit@discuss.tchncs.de
        link
        fedilink
        arrow-up
        7
        ·
        2 days ago

        Never used Rust but I’d like to point out the YouTube channel Low Level which covers security vulnerabilities (CVEs). He ends each video with “would Rust have fixed this?” and it’s pretty interesting.

        A very recent one is this: https://youtu.be/BTjj1ILCwRs?t=10m (timestamped to the relevant section)

        According to him, when writing embedded software in Rust (and UEFI is embedded), you have to use Rust in unsafe mode which basically disables all the memory safety features. So in that kind of environment Rust isn’t really better than C, at least when it comes to memory safety.

        That’s not to say Rust isn’t still a good option. It probably is.

        Again, I never used Rust so I’m just parroting stuff I’ve heard, take all of this with a grain of salt.

        • calcopiritus@lemmy.world
          link
          fedilink
          arrow-up
          4
          ·
          1 day ago

          Rust doesn’t have “safe” and “unsafe” modes in the sense your comment alludes to.

          You can just do the little unsafe thing in a function that guarantees its safety, and then the rest of the code is safe.

          For example, using C functions from rust is unsafe, but most of the time a simple wrapper can be made safe.

          Example C function:

          int arraysum(const int *array, int length) {
              int sum = 0;
              while (length > 0) {
                  sum += *array;
                  array++;
                  length--;
             }
          }
          

          In rust, you can call that function safely by just wrapping it with a function that makes sure that length is always the size of array. Such as:

          fn rust_arraysum(array: Vec<i32>) -> i32 {
              unsafe{ arraysum(array.as_ptr(), array.len() as i32)}
          }
          

          Even though unsafe is used, it is perfectly safe to do so. And now we can call rust_arraysum without entering “unsafe mode”

          You could do similar wrappers if you want to write your embedded code. Where only a fraction of the code is potentially unsafe.

          And even in unsafe blocks, you don’t disable all of the rust checks.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          1 day ago

          I am glad for your comment because I work with mcus and embedded solutions in C, so Rust, in that case, wouldn’t be neccesarily safer than C.

          I will have to look into it. I need to do 30h of training every two years, so I will learn Rust regardless, but I was thinking about eventually switching to Rust for embedded projects. Might just keep Rust as my scripting language because it is easier for me than Python

      • brucethemoose@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        1 day ago

        I great example I saw is a dev who was building on a Rust game (with the Bevy engine), and switched to Unity.

        https://deadmoney.gg/news/articles/migrating-away-from-rust

        Collaboration - I started this project with my brother. While he’s sharp and eager, he’s new to coding. Onboarding him directly into game dev while simultaneously navigating Rust’s unique aspects proved challenging. We found ourselves with a steeper learning curve that slowed his ability to contribute effectively to gameplay logic.

        Abstraction - While my initial motivation was the enjoyment of Rust, the project’s bottleneck increasingly became the rapid iteration of higher-level gameplay mechanics. As the codebase grew, we found that translating gameplay ideas into code was less direct than we hoped. Rust’s (powerful) low-level focus didn’t always lend itself to a flexible high-level scripting style needed for rapid prototyping within our specific gameplay architecture. I found that my motivation to build and ship fun gameplay was stronger than my desire to build with Rust.

        Migration - Bevy is young and changes quickly. Each update brought with it incredible features, but also a substantial amount of API thrash. As the project grew in size, the burden of update migration also grew. Minor regressions were common in core Bevy systems (such as sprite rendering), and these led to moments of significant friction and unexpected debugging effort. This came to a head on one specific day where I was frustrated with a sprite rendering issue that had emerged in a new release. Blake had run into the same problem at the same time and our shared frustration boiled over into a kind of table flip moment. He turned to me and said something along the lines of “this shouldn’t happen, this kind of thing should just be solved” and that triggered the conversation that led to a re-evaluation. The point isn’t that specific sprite problem, but that because all systems in Bevy are open to tinkering and improvement, all systems were potentially subject to regressions.

        Learning - Over the past year my workflow has changed immensely, and I regularly use AI to learn new technologies, discuss methods and techniques, review code, etc. The maturity and vast amount of stable historical data for C# and the Unity API mean that tools like Gemini consistently provide highly relevant guidance. While Bevy and Rust evolve rapidly - which is exciting and motivating - the pace means AI knowledge lags behind, reducing the efficiency gains I have come to expect from AI assisted development. This could change with the introduction of more modern tool-enabled models, but I found it to be a distraction and an unexpected additional cost.

        Modding - Modding means a lot to me. I got my start in the industry as a modder and I want my game to be highly moddable. Over time, as I learned more about how to realize this goal, I came to understand many inherent limitations in Rust and Bevy that would make the task more difficult. Lack of a clear solution to scripting and an unstable ABI (application binary interface) raised concerns. I am not an expert in this area, perhaps these are all easily surmounted. I can only say that I did not find a path (after much searching) that I felt confident trusting.

        It sounds like Rust (game engines, and more) could use a higher level scripting language, or integrate an existing one, I guess.

        • Croquette@sh.itjust.works
          link
          fedilink
          arrow-up
          2
          ·
          1 day ago

          I interface with low level communication protocols, mostly uart, so it fits my use case. But it is nice to see the hurdles people encounters. It tells a lot about the language.

          • brucethemoose@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            edit-2
            1 day ago

            Yeah. I wasn’t trying to imply it’s a bad language at all; it just fits certain use cases. They are complex, like people.

            Still, it seems like it’d be cool for engine work, with C# or maybe a subset of typed Python as a scripting language.

  • The Bard in Green@lemmy.starlightkel.xyz
    link
    fedilink
    English
    arrow-up
    35
    arrow-down
    2
    ·
    2 days ago

    I’m working with some Rust right now that is 100% a big mess…

    It’s consistently either the Rust or the Docker components that fail to build. In fairness, it’s a VERY big and complex application.

    • lad@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 days ago

      We had to use Nix to build Rust services and make containers of them. It works pretty well, except with Nix 2.29 and 2.30 where it is broken for some reason

    • GreenKnight23@lemmy.world
      link
      fedilink
      arrow-up
      8
      arrow-down
      21
      ·
      2 days ago

      docker doesn’t really fail to build unless something upstream fails, like lib builds that don’t have the proper dependencies installed. I’d still count those failures as rust fails 😂

      that said, I worked with a kid that was trolling rust package managers hard by squatting on common library names because they refused to resolve the issues of squatting. dick move but clearly educated me on the toxicity of the rust community and why I should avoid it.

      • Ephera@lemmy.ml
        link
        fedilink
        English
        arrow-up
        12
        ·
        2 days ago

        In my experience, the Rust community is pretty welcoming. Like, it’s actually a meme that trans women code in Rust for that reason.

        • GreenKnight23@lemmy.world
          link
          fedilink
          arrow-up
          5
          ·
          2 days ago

          just because they are accepting of people based on gender identity doesn’t mean toxicity cannot exist.

          terfs are a great example of that.

          • Ephera@lemmy.ml
            link
            fedilink
            English
            arrow-up
            3
            ·
            2 days ago

            Sure, but I’m saying in general. I don’t know why you’re so convinced of your position from the one experience you had.

            • GreenKnight23@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              1 day ago

              a community that allows squatting to happen and does nothing to resolve the issue is going to be plagued with chaos in the future. it opens an attack vector for supply chain attacks and altogether breeds distrust in the platform entirely.

              on the flip-side, a developer that squats on common library names in an attempt to garner support to resolve an issue and is ignored tells me two things;

              1. this is normal enough that the community doesn’t feel the need to address the toxic behavior
              2. the issue of squatting isn’t perceived as a high enough threat and they will take no action

              in my case both of those observations tell me the community at large isn’t mature enough or forward thinking enough to allow me to use it as a solution. it also forces me to assume that the matter of toxic behavior will only continue to fester unchecked within the community.

    • Ephera@lemmy.ml
      link
      fedilink
      English
      arrow-up
      11
      ·
      2 days ago

      Yeah, in particular, you can write libraries in Rust, which can be used in virtually any other programming language, similar to how you can do in C and C++. And given that not a ton of young kids learn C/C++, there’s a chance that the majority of important cross-language libraries (like OpenSSL, SQLite etc.) are written in Rust in a decade or two.

  • okamiueru@lemmy.world
    link
    fedilink
    arrow-up
    10
    arrow-down
    2
    ·
    2 days ago

    Considering that FFI is very much a thing, I’m finding it difficulty to understand the point it’s trying to make.

  • pheggs@feddit.org
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    7
    ·
    2 days ago

    not a big fan of rust personally. I think it would be much smarter to bring borrow checking to C through annotations. That way we would not have to rewrite the whole world

    • originaltnavn@lemmy.zip
      link
      fedilink
      arrow-up
      12
      ·
      2 days ago

      While I agree that would solve much of the motivation behind rewriting in rust, I don’t think it would bring many of the rust-enthusiasts over to C. For me at least, the killer feature of rust is having a modern tooling and language with proper library management, functional stuff in the language and one language standard everyone agrees upon.

      • Kushan@lemmy.world
        link
        fedilink
        English
        arrow-up
        13
        ·
        2 days ago

        I don’t think it’s about bringing rust enthusiasts to C, it’s about the fastest way to bring more safety to the entire ecosystem.

        I’m not convinced it’s possible with just annotations, mind.

        • pheggs@feddit.org
          link
          fedilink
          English
          arrow-up
          2
          arrow-down
          2
          ·
          2 days ago

          It is possible, it would bring in quite a few restrictions though. The bigger problem I see is that it wouldn’t be entirely clear as an end user whether a program is memory safe or not. However, this isn’t the case with rust neither. Maybe some kind of certification would help

      • pheggs@feddit.org
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        1
        ·
        2 days ago

        Yeah, I don’t think there’s anything wrong with coding in rust for people who like it. But I do think it’s quite a bit of useless work that could be spent more wisely on new products instead of rewriting things that we already have

    • stingpie@lemmy.world
      link
      fedilink
      arrow-up
      10
      arrow-down
      1
      ·
      edit-2
      2 days ago

      I struggle to learn rust because the semantics and syntax are just so awful. I would love to be enthusiastic about rust, since every seems to love it, but I can’t get over that hurdle. Backporting the features into C, or even just making a transpiler from C to rust that uses annotations would be great for me. But the rust community really does not seem interested in making stepping stones from other languages to rust.

      • pheggs@feddit.org
        link
        fedilink
        English
        arrow-up
        7
        ·
        2 days ago

        I learned a bit of rust and I think it’s just about getting used to it. It’s fairly subjective, and people say the same about C++. I also prefer the C syntax because I find it’s simplicity extremely elegant and prefer it to have fewer features. And I like it for it’s consistency, on linux the FHS is based up on C, and it just somewhat feels ugly to break that consistency.

        But I also acknowledge the advantages of rust.

      • banshee@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2 days ago

        I’ve personally become pretty fond of the syntax and incorporation of FP features. In all fairness though, I haven’t written much C or C++ for the last two decades.

        Rust incorporates some of my favorite features from FP with handy green thread ergonomics. I’m not a fan of Go, so this gives me a great option for microservices when I can avoid Node.js.

    • jkercher@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      2 days ago

      I don’t think you would get much traction on C developers’ existing projects. C gives you the option to do everything your way. If the developer’s paradigm doesn’t agree with the borrow checker, it could become a rewrite anyway.

      Most projects don’t use the newer c standards. The language just doesn’t change much, and C devs like that. This might get a better response from the modern C++ crowd, but then you are missing a large chunk of the world.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      3
      arrow-down
      1
      ·
      2 days ago

      C++ already has much more of the required language constructs, which is why there is already an attempt to add borrow checking to C++ called circle. Until that standardizes, I wouldn’t expect it in C.