toot.yosh.is is one of the many independent Mastodon servers you can use to participate in the fediverse.

Administered by:

Server stats:

1
active users

I think I’ve previously stated that I don’t believe Rust’s built-in math operators (Div, Add, Mul, etc) should be effectful.

Reading a paper right now where they did *exactly* that (Lutze, Madsen, 2024), and swapping out panics for concrete errors is super useful!:

- division by zero for floats results in NaN, which means Div for floats can be marked as Pure.
- checked integers return concrete errors rather than panic on overflow. This essentially swaps a “panic” effect for a “try” effect.

Ok ok ok, at least the paper authors and I agree that traits for equality and ordering shouldn’t be generic over effects. Phew, haha.

yosh

Finished reading the paper! This paper is really cool, and is right now probably the closest published resource there is for the work we’ve been doing on effect generics for Rust.

The most notable difference is that our design basically functions as a subset of what the authors describe here. We’re at least intentionally starting with a constrained design to target the 80% use case. That makes it less powerful, but also means not introducing an effect algebra ^^

dl.acm.org/doi/pdf/10.1145/365

We’re also doing some things differently wrt how effects are threaded through. I need to re-read it; section 5.9 in the paper discusses that a little.

Notably the authors also haven’t yet figured out how to thread through async as an effect yet where we have. (Not in the paper, but they told me that directly.)

I’m so happy about this paper :D

@yosh “not introducing an effects algebra” is one of those things that makes me simultaneously really sad but also delighted

@steve hah, yeah same. We probably need it if we ever want to tackle XOR effects, for things like “try XOR panic”.

My hope is that we can make the simpler / more declarative system forward-compatible with a more involved system. That way we keep the design space open if we need it, but we don't front-load a whole lot of extensions in one go.