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

Send ident conflict #4

Open
khionu opened this issue Nov 17, 2024 · 4 comments
Open

Send ident conflict #4

khionu opened this issue Nov 17, 2024 · 4 comments

Comments

@khionu
Copy link

khionu commented Nov 17, 2024

I just hit a problem where I needed to use the std trait Send. A type alias does solve this, however I think this issue might be prevalent enough where it might be best to rename par's Send, and Recv to match.

Some ideas:

  • Tx/Rx
  • In/Out
  • Give/Recv

My preference would be on Tx/Rx, since those have the same meaning as Send/Recv, and Give is a bit passive.

@faiface
Copy link
Owner

faiface commented Nov 17, 2024

The way I solve this in the library is I use marker::Send for the standard trait. When designing the library, I was considering naming it differently, including Give, but nothing evoked the right meaning as much as Send, plus it's consistent with academic literature. I found using marker::Send for the trait to be a better compromise.

@khionu
Copy link
Author

khionu commented Nov 18, 2024

Maybe Sender/Receiver then, in line with channel terminology?

@khionu
Copy link
Author

khionu commented Nov 18, 2024

To elaborate, from the perspective of people whose choice of tools start with Rust, when they pick up Par, I would imagine them to expect Par to not conflict with std types. There's a hierarchy, in a sense, where conflicts with a tool are the responsibility of the tool that depends on the first. The std is here first, even more so here because Send is part of the prelude.

@faiface
Copy link
Owner

faiface commented Nov 18, 2024

Sender/Receiver have the downside of being nouns instead of verbs, which imho would make the session types harder to intuitively understand, since they describe a sequence of operations.

The hierarchy argument makes sense, and I'd be up for changing the names if a good alternative is found. Unfortunately, all alternatives I've seen or considered seemed worse than the marker::Send compromise.

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

No branches or pull requests

2 participants