-
Notifications
You must be signed in to change notification settings - Fork 3
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
Naming #4
Comments
Awaitable is fine for me too (besides Promise), but I dislike Whenable. |
Where |
@WyriHaximus FWIW it's just the same as |
Thenable feels IMHO awkward too… |
Promise (in this context) is a noun, and await is a verb. "This promise is awaitable" is fine and doesn't invent any new words or turn any words into things they aren't already. Source: I am a native English speaker and a really annoying pedant |
@DaveRandom If we care about nouns and verbs, we should probably make the method a verb as well, uggestions? |
@kelunik I had no strong opinions about it the other day, but that it a solid argument for
But also, |
|
@DaveRandom You're not annoying :-P |
Awaitable doesn't make sense to me because it only describes one action you can take using the placeholder value for which an async lib has promised future resolution. Semantically it's not a good description of the essence of the thing. More thoughts on that here: http://chat.stackoverflow.com/transcript/11/2016/5/15 Also: @DaveRandom you're pedantry is hilarious and makes it easier to wake up in the morning. |
ping @jsor |
It says Awaitable, so you don't have to wait for it. I just think But I'd be fine with both. |
I'm not really a fan of
If |
Haha, funny that you propose Future … https://github.com/amphp/amp/blob/v0.15.0/lib/Future.php That was actually the original name we had used in Amp … I obviously don't object - we actually had moved the name to Promise as this was more commonly known [mainly from people coming from JS]. I'm fine with Future too. [Delayed is a bit too generic and I don't immediately recognize its role.] |
Yes, but not for |
@kelunik not exactly, we had Future implementing both Promise and Promisor. |
hmm … actually … In different programming languages Future, Promise etc. are used for different things :-/ … |
@bwoebi |
I prefer I don't prefer
I don't like |
What bothers me is that you don't really await it, you just register a callback to its resolution event. "Wait" has some sort of blocking association. |
See also https://en.wikipedia.org/wiki/Futures_and_promises. It's an old term, it's not coupled to a specific API like My very minor issue with |
That's why Future should be the name of the Promisor: the Instance promising future resolution of the Promise. |
Correct, |
I tried to summarize, I might be wrong with If you change your opinion or aren't in there yet, just ping me. |
Set me as -1 on Future (for Promise). I'm +1 for it as Promisor class name, but that's out of scope here. |
HHVM also uses If we're going to use |
I updated my draft to use |
@kelunik actually, it seems like we have the least opposition and most in favor for |
There seems to be general consensus around the implementations of thenable and whenable, but not the names of the interfaces; maybe you guys should take a vote on the names or set a date by which you think that should happen, since it's quite a subjective issue? Just a suggestion. |
@joshdifabio We will eventually, but I think we can defer that until we have the event loop ready. There's still discussion and changing votes for it currently. @bwoebi: @rdlowrey's feeling about Awaitable is much better if we have @jsor How do you feel about Awaitable if you think about it's usage in combination with @joshdifabio What's your preference? I'd be happy to add it to the table. |
@trowski: I think the important assumption of |
@kelunik |
Even if we'll have await, it still sounds logical to me to await a Promises resolution. @kelunik yeah, Amp Promises are chainable, i.e. they return themselves on when(). Maybe we shall require this here too? |
Not in the same way that Promises/A+ promises are chainable. I think that what @kelunik is saying is that people tend to assume Promises/A+ when they hear promise.
It's so subjective that I don't think I can add anything here. It's worth considering that the naming issue only exists because there are two rival promise implementations being proposed. If these interfaces were merged (the pragmatic solution) or one was favoured (probably a question of who can shout the loudest) we'd get around the whole naming issue, since we could simply define a single |
@joshdifabio The implementation is clearly Amp's, but people don't seem to agree on Amp's name for it. So that doesn't bring us anything. We have two issues: A name and the implementation. |
If you are saying that thenable will be dropped in favour of whenable then I would say whenable should be named |
@joshdifabio: @rdlowrey suggested that too some minutes ago. I hope |
I absolutely prefer to use coroutines as well. If everyone here agreed on that point then I suppose it would make everything a bit simpler, but if that doesn't happen then what's the next best thing? Maybe it is to keep them separate, but maybe it's not.
Such implementations would have to specify their own classes or interfaces as return types, instead of the interop interfaces. I don't think that's what anyone wants. |
There is absolutely no problem with return typing your specific interface/class. |
We we don't target PHP 7, you don't have a return type declaration anyway. Covariance is perfectly fine. @bwoebi We really need covariant return types. |
This seems like quite an arbitrary and unscientific claim. A utility function for converting promises can clearly be used to solve the promise interoperability issue at any level, whether that be the application level or the library level. The issue is that it's a suboptimal solution which results in a lot of boilerplate code and wasted CPU cycles. That doesn't stop being the case at the application level. |
@joshdifabio I think you missed the point. Usually
It can also be used now, sure, but currently you have n different implementations which you have to convert to the one you want. If we have |
@joshdifabio I don't think it makes much sense to include |
It appears after all this discussion that we are back where we started with Hack uses @joshdifabio The intention is to drop the proposal for any "thenable" object with a |
Seems like we don't have a single voice against I'll post the link again here: Ratings. If nobody raises a voice against it, I'll close this issue tomorrow and merge the PR @trowski provided. |
@kelunik I'm convinced now: you can change my vote to |
I still prefer
Promise
overWhenable
. It will be the name that's used in type declarations where multiple implementations may occur. Everyone familiar with these things knows what a promise is. I think the name expresses more a concept than a particular API, so it's perfectly fine to use it withwhen
even if Promises/A+ hasthen
.The text was updated successfully, but these errors were encountered: