Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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).



Rust enums cover both ADTs and enums.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: