• toastal
    link
    fedilink
    arrow-up
    7
    arrow-down
    1
    ·
    23 hours ago

    Rust is not the only systems language with “memory safety”. Some even have better type systems (linear types, refinement types, GADTs) & tools for proving code correct. What grinds my gears is this “C is has problems, therefore you must use Rust” flawed mentality.

    • barsoap@lemm.ee
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      3 hours ago

      Rust has affine types and gets close to linear when you include #[must_use] (you can still let _ = foo but at least it won’t be an accident, also, drop code isn’t guaranteed to run and there’s good reasons for that), refinement types there’s a library for that. GADTs… I mean sure trait magic can get annoying and coming from Haskell you’d want to do more in the type system but in the end the idiomatic rust way to do many of those things is with macros. Which, unlike Haskell, Rust actually is really good at. Really good. Tack refinement types onto the language kind of good.

      Proving tools, honestly, there’s only one piece of actually proven software (SeL4) and the only language it’s really written in is Coq. Which Rust will never, ever, compete with on its home turf.

    • I agree but in terms of the features, momentum, and community around rust I think it’s the most promising option for memory safe language. But you’re right that it’s not the only option, I should say that they should be more welcoming to mixed language development with memory safe languages in general