4 ms·
> Why on earth would you try to rewrite python CRUD apps in Rust? Because Rust has a lot of incredibly helpful features that make bigger systems far less of a
by LinXitoW 3y ago
> Why on earth would you try to rewrite python CRUD apps in Rust?
Because Rust has a lot of incredibly helpful features that make bigger systems far less of a pain to maintain. I work in Java/Kotlin, and my entirely gut-based estimate is that 66% of problems wouldn't happen in Rust.
My big favorites are:
- Sane, well-defined, enforced, opt-out error handling
- Sane, well-defined, enforced, opt-out handling of "missing" values
- Exhaustive switching
- WITH usable ADTs (enums) for encoding valid state
None of the web languages I know have all of that.
- kaba0 3y agoScala has all of that and predates Rust by far. But even Java is pretty much there: checked exceptions are available (and imo superior), but Optional is also an.. option. Kotlin/scala can handle nulls, but java can also statically analyse every usage with annotations. switch expressions are exhaustive in java over enums and sealed ADTs. (Rust has a misnomer, their enums are ADTs, java has both real enums and ADTs now).
- pitaj 3y agoRust enums cover both ADTs and enums.
- marcosdumay 3y agoSo... Haskell, OCaml, F#, Elm?