3 ms·
Scala 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 a
by kaba0 3y ago
Scala 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.