4 ms·
I get where you're coming from, but it's a real problem that we have const-async-fallible-panicking-allocating combinatorial explosion. An effects system could
by vacuity 3y ago
I get where you're coming from, but it's a real problem that we have const-async-fallible-panicking-allocating combinatorial explosion. An effects system could abstract all of this away except for the base libraries and the application developers. A big goal of Rust is to be accessible, and all these sorts of "function colors" are a hindrance to that goal.
> You have static enforcement of blocking code (aka function coloring) in your language without even having any kind of coroutines.
And now it's annoying to write sync and async Rust.
- littlestymaar 3y ago> it's a real problem that we have const-async-fallible-panicking-allocating combinatorial explosion. True, but there's no free lunch: you either have the ability to express these things in the type system, or you don't. I'm personally very happy rust has `Result` even though it's legitimately much more tedious than having invisible exceptions. > A big goal of Rust is to be accessible, and all these sorts of "function colors" are a hindrance to that goal. It's always a trade-off between usability and expressive power. And not every Rust user have the same priorities. As an application developer, I care less about having allocations expressed in a tractable way than a kernel developer for instance. > An effects system could abstract all of this away Maybe, but it's not clear yet if that's something that could be added at this point. Also it would add yet another layer of complexity which is also a factor that needs to be taken into accounts. > And now it's annoying to write sync and async Rust. Honestly, this is just a matter of tooling: the annotation could/should be transitively added to every caller function (with a boundary at threads spawn) by something like `cargo fix`.