• nitrolife@rekabu.ru
    link
    fedilink
    arrow-up
    3
    ·
    1 day 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
      ·
      24 hours 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
      5
      ·
      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.