Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider dropping the IO capability #219

Closed
adamw opened this issue Sep 19, 2024 · 4 comments · Fixed by #220
Closed

Consider dropping the IO capability #219

adamw opened this issue Sep 19, 2024 · 4 comments · Fixed by #220

Comments

@adamw
Copy link
Member

adamw commented Sep 19, 2024

The IO capability was originally introduced to make signatures more "truthful". It requires any methods that perform I/O directly or indirectly to include IO in scope.

However, after testing this in Bootzooka, I'm not sure it carries its weight. True, the project is small, but even there the necessity to often add using IO was more annoying, than useful. All the places where this was needed where predictable, and it's usually obvious from the method name that I/O is happening anyway.

That's why I propose to remove the feature (along with the compiler plugin) from Ox entirely. Similar functionality might be implemented by a separate project, without the integration e.g. with Ox's streams.

@adamw
Copy link
Member Author

adamw commented Sep 19, 2024

@adamw
Copy link
Member Author

adamw commented Sep 19, 2024

If'd you have some opinion regarding this, a 👍 / 👎 would be great - or a comment even more so :)

@lbialy
Copy link
Contributor

lbialy commented Sep 19, 2024

The correct question in this regard is - what effects are actually worth tracking this way. John De Goes thinks effect tracking is worthless. Martin thinks Async is worth it. My opinion is that for practical purposes well implemented, relatively fast coroutine runtime like Loom or Golang makes it mostly obsolete as to know whether some call will suspend execution brings no value to me - for example: of course grpc call will perform side effects and "suspend" (if that means anything with something like Loom, anyway), that's why I'm performing it! The whole thing boils down to an information about "this method call might be slow(er)". But so can a call to a SAT solver! IO capability is kinda pointless without referential transparency achieved by suspending monad. There are however things that do seem to be worth tracking - resource scopes - and they do, in fact, require capture checking. I'm not sure this is what was what Martin had in mind - to have a Connection "capability" that is tracked so that it can't be mistakenly exfiltrated and used-after-close.

@adamw
Copy link
Member Author

adamw commented Sep 20, 2024

Yes, I agree about suspensions, IO was designed to track I/O only - so side-effecting operations which might fail.

We do have resource scopes which remain unchanged in how they are tracked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants