Effect polymorphism fixes dependency inversion

submited by
Style Pass
2024-10-06 18:30:01

TL;DR: Local programmer is inconvenienced by error-handling boiler plate, writes uninformed article about experimental programming language features. More at 11.

I've encountered lots of pain points when dependency-inverting things, especially when working with combinators. Most recently, I've been thinking about how I might expose Python bindings for a half-baked motion planning library I'm building. The chief problem is that I want users to provide their own configuration spaces, samplers, robots, and collision checkers. If those are implemented in Python, they can throw an exception at any time, yielding an error in the corresponding PyO3 API. The problem is that all of my functions which might call into that behavior don't return an error - what am I to do?

I'm not the only one with this sort of problem! boats has been writing about this for nearly five years, and handling iterators of results is still a pain. As the async story for Rust has improved, we've seen similar results on the pain (or lack thereof) of function coloring in Rust. In short, crossing control-flow boundaries in statically typed languages is painful and difficult.

Leave a Comment