• barsoap@lemm.ee
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    19 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.

    • toastal@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      15 hours ago
      • Can’t do it
      • Requires library, not built-in
      • Can’t do it
      • Can’t do it

      Not sure why Haskell is being invoked—several languages have GADTs & macros.