My last point on Results vs checked exceptions because I don’t want to derail the topic any longer .
(Depending on details, yes, even stackless exceptions can be more expensive than passing back an allocated error type. But, anyway, you did specifically ask how Rust improved over something like Java’s checked exceptions, and one of the big advantages is performance, even if Scala cannot fully recapture the same advantage. I was just answering your question!)
I understand what you are saying, what I’m trying to say is that, linguistically, rust Result and .? macro is essentially the same linguistic tool that java has, with the same language semantics, as in when the compiler forces you to handle, exhaustiveness, and how it propagates in signatures (let’s forget for a second that unchecked exceptions exists), in java you can even have a list of disjoint exceptions which rust doesn’t, but you already know all of this.
As language tools, I don’t find rust’s Result to be different from checked exceptions, and just like with checked exceptions in java where follow up languages decided to forgo, I think the problem here is the same. Rust gets away with it because the entire language was modeled with it from scratch, while java sadly has unchecked exceptions plus clumsy ergonomics around exceptions.
My hopes right now are in CanThrows+capabilities thing, plus erased
being added as non-experimental.