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

Behaviour call syntax #163

Closed
wants to merge 3 commits into from
Closed

Behaviour call syntax #163

wants to merge 3 commits into from

Conversation

Theodus
Copy link
Contributor

@Theodus Theodus commented Apr 28, 2020

Please see #156 for prior discussion

Rendered

@Theodus Theodus added the status - final comment period The RFC is finalized. Waiting for final comments. label Apr 28, 2020
@Theodus Theodus mentioned this pull request Apr 28, 2020
@SeanTAllen
Copy link
Member

SeanTAllen commented May 7, 2020

I discussed with Sylvan today. Some takeaways (many from Sylvan, a couple from me).

be is currently a subtype of fun tag.

To change the call site signature is to create a bifurcation in the type system. This would have a large impact on the codebase. You need two sets of subtyping to handle the bifurcation.

Essentially what the RFC is suggesting is to incorporate async/sync distinction into the type system. However, because async doesn't propogate up a call stack. It fails to achieve that end. This was brought up in discussions already as...

"well, I can have a fun I call sync and then it can just be wrapping an async be".

It isn't like when we introduced ? because errors do propagate so the change made sense and provided real benefit. Because async doesn't propagate, we'd be making the type system more complicated and not really achieving what I think is the real goal of the RFC (async/sync as part of type system).

Sylvan mentioned that a few years ago, early on in the Pony days, he built a stream handling library that allows you to switch dynamically between async or sync interactions because of the current type system and it was hugely valuable. He said he would try to find as one of our points of conversation was "we don't see value in this, because we haven't really seen be/fun tag relationship being used".

I think our goals are laudable, particularly, providing a better end user experience at the call site. However, i think that the trade-offs aren't worth it. I'm withdrawing my support from the RFC.

Sylvan is also against the RFC for the reasons above.

@Theodus Theodus removed the status - final comment period The RFC is finalized. Waiting for final comments. label May 7, 2020
@Theodus
Copy link
Contributor Author

Theodus commented May 7, 2020

I agree that a bifurcation of the type system around sync/async is not worth the benefit of the call site visibility.

@Theodus Theodus closed this May 7, 2020
@Theodus Theodus deleted the behaviour-call-syntax branch May 7, 2020 17:09
@SeanTAllen
Copy link
Member

I think we can address the problem with actors that take notifiers by being better about our APIs.

For any actor that takes a notifier we should:

have ever be call immediately into a corresponding fun. Then callers from within should be calling the fun to get sync behavior unless they specifically want async behavior with the be.

TCPConnection does a particularly bad job of this and is where most of the problems in the past have arisen.

@Theodus
Copy link
Contributor Author

Theodus commented May 7, 2020

@SeanTAllen should that be translated into an issue for an RFC to improve APIs in that way?

@SeanTAllen
Copy link
Member

@Theodus I think we need a review of the various notifier having actors in the standard library and see how they fair on this front. TCPConnection definitely needs improvement. That was one of the alternatives we discussed during some sync call when discussing the general issue.

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 this pull request may close these issues.

None yet

2 participants