• Euphoma@lemmy.ml
    link
    fedilink
    English
    arrow-up
    22
    arrow-down
    1
    ·
    2 days ago

    This is why its generally better to only write new code in more memory safe langs instead of rewriting everything

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

      The counterpoint is that, especially with FOSS that does not receive much (if any) corporate backing, developer retention and interest is an important factor.

      If I’m donating some of my free time to a FOSS project I’d rather not slug through awful build systems, arcane mailing lists, and memory unsafe languages which may or may not use halfway decent - often homebrew - manual memory management patterns. If the project is written in Rust, it’s a pretty clear indicator that the code will be easily readable, compilable, and safer to modify.

      • nitrolife@rekabu.ru
        link
        fedilink
        arrow-up
        3
        ·
        2 days ago

        But why the rust? there are quite a large variety of languages with memory protection (for example Java), and freely compiled (for example golang), but for some reason they persistently try to rewrite the whole “world” into rust. I’m not against rust, I’m really curious.

        • KubeRoot@discuss.tchncs.de
          link
          fedilink
          English
          arrow-up
          6
          ·
          1 day ago

          Both java and go seem excessively complex at runtime for fundamental system utilities, featuring garbage collection. Rust, on the other hand, keeps the complexity in the compiler and source, keeping the runtime code simpler. And of course it’s doing that while trying to make it easier to manage memory and harder to make mistakes, without forcing extra runtime logic on you.

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

          For systems programming it makes the most sense out of the languages you mentioned. Languages requiring a runtime (Java/Python) do not fill the bill for system tools IMO. Golang is more arguable, but its memory safety comes through GC which many systems programmers aren’t fans of for a variety of technical and personal reasons.

          Rust is meant to be what C++ would be if it were designed today by opiniated system developers and didn’t have to be backwards-compatible.

          Those are the technical arguments I would use in a corporate setting.

          All that aside, there’s personal preference, and my point is that for FOSS projects that matters too. Rust is fun in a brain-teasy kind of way in the same way that writing C is fun, but without nearly as many footguns. Golang is practical but arguably not as fun. That’s the same logic that draws many programmers to write Haskell projects.

          The story of the Fish shell illustrates it quite well; the project gained a lot of development attention and contributions when they decided to rewrite from C++ to Rust, where they achieved a stable release with feature-parity a few months ago. It would have been a remarkably dumb decision for a private company to make, but makes perfect sense when you are trying to attract free talent.

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

      I do think there are long-term benefits in many cases, it just depends on available resources. There are plenty of projects that desperately need a rewrite for maintenance reasons alone so you might as well examine if language switch is worth it. It’s not like there aren’t a lot of success stories, even if there’s projects like sudo-rs where we’re, at best, not sure if there’s tangible benefits.