Checked exceptions
are an exact analog for result types. If you have an `int parseInt(String s) throws ParseException` function it is basically equivalent to `parseInt(s: String): Result<Integer, ParseError>`. Hell, if anything, it is better — it is automatically “unboxed” for you, and in case of an error you get the sane default choice of bubbling said exception up (rust’s ? macro does the same, but it is much less ergonomic). It has the added benefit of
including stack traces, which makes it actually possible to do anything with unhandled error cases and is of utmost importance.
I’m not claiming that Java’s execution of checked exceptions is good, it unfortunately does have a few inconsistencies (lambdas don’t operate well with them, also inheritance is not a good match for exceptions), but it was pretty universally ditched and I think it very well deserves another chance.