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

Summit topic: Promises #86

Closed
MayaLekova opened this issue May 29, 2018 · 28 comments
Closed

Summit topic: Promises #86

MayaLekova opened this issue May 29, 2018 · 28 comments

Comments

@MayaLekova
Copy link

Creating this issue in attempt to gather links and offline discussion relevant to what's happening around the Promises topic.

Motivation:

Make promises and other asynchronous primitives competitive performance-wise to traditional callback-oriented programming and easier to trace and debug.

Events:

Resources:

// Please add whatever you feel contributes to the discussion
// Talk slides to be linked here

@benjamingr
Copy link

benjamingr commented May 29, 2018

Hey @MayaLekova thank you for opening this :) Looking forward to your workshop about promise performance!

A couple of us have written user use-cases with promises in: https://github.com/nodejs/promise-use-cases and what userland libraries currently do better.

Namely, after doing a community survey, going over code on GitHub and asking around and also based on my own intuition being involved with bluebird and other promise libraries for a while and answering 700 SO questions - what I saw most and intend to discuss written here is:

I don't want to suggest any actions but rather bring the issues up and discuss them and see what the people attending the workshop think about any of these. My personal feeling is that people I talked to felt the most strongly about testing async functions being hard and stack traces - but I hope to get some interesting discussion going :)

@bmeurer
Copy link

bmeurer commented May 29, 2018

Woah. Thanks @MayaLekova for kicking this off, and thanks @benjamingr for this nicely structured list of use cases! Looks like there's a lot to discuss for us. 👍

@benjamingr
Copy link

benjamingr commented May 29, 2018

I think it's perhaps worth setting out goals for the workshop and align expectations.

My personal goals for the promise workshop at the summit are:

  • Discuss the community use cases we gathered (big props and acknowledgements to @MadaraUchiha @getify @spion @bjouhier and @itaysabato as well as others for help with that and the repo).
  • Figure out what features these use cases translate to, prioritise them together and see what is actionable and what some tradeoffs might be.
  • Come up with a plan for continuing these discussion and maybe a process for soliciting more community feedback.
  • Learn more about how promises work in V8.

I don't think we'll get concrete solutions or features since there is a lot of discussion to be had. I hope to learn a lot from the experience of others, meet interesting people who share a passion for making developers' debugging experience better and add a perspective on user debugging experience.

@bmeurer
Copy link

bmeurer commented May 29, 2018

@benjamingr That matches my expectations. We hope to develop a better understanding of the needs of developers specifically on the Node side, so that we can drive future work on V8 in the right direction. 👍

@MayaLekova
Copy link
Author

Being pretty new to this topic, my expectations are also around listening to what's important for the community, so we can better focus our efforts in V8.
Thank you for structuring this use cases so well!

@benjamingr
Copy link

Hey, really nice talk @MayaLekova and @bmeurer !

Some discussion points:

  • We've had the same issues with monitoring and setScheduler in bluebird where the scheduling bypass interfered with change detection people used in Angular
  • I'd love to see some performance measures of coroutines as async/await vs. async/await and how important the actual ability to hook on microtick scheduling semantics.
  • I'd love to talk about why the spec works this way, the whole "delaying a microtick" issue was due to a real concern (avoiding zalgo) but there is no reason I can think of that the spec couldn't/shouldn't allow elision of promises in that scenario - have you considered bringing it up with TC39?

@JiaLiPassion
Copy link

@benjamingr ,for the bluebird angular issue, it has been resolved in zone.js, the document can be found here, https://github.com/angular/zone.js/blob/master/NON-STANDARD-APIS.md (search bluebird).

@bmeurer And I want to know current ES2017 native async/await use native promise which can not intercepted, in nodejs , we can use asynchooks and PromiseHooks, but in browser, currently we can not do anything about it. Is PromiseHooks or AsyncHooks javascript API for in the future plan?

Thank you.

@benjamingr
Copy link

@JiaLiPassion Zones are a no-go for Node.js at the moment due to the error handling issues, which is sort of a shame since a lot of us are using promises now (and the issue is basically about nested callbacks).

@bmeurer
Copy link

bmeurer commented May 31, 2018

@JiaLiPassion that's something to discuss with @domenic and @benlesh

@benjamingr
Copy link

Interesting discussion in the Diagnostics session about zones and async_hooks - I think the current PoV is that Node.js needs to figure out async_hooks error handling before we unblock zones.

@JiaLiPassion
Copy link

@benjamingr , @bmeurer , got it, thank you!

@benjamingr
Copy link

@JiaLiPassion see the discussion in domenic/zones#9 (comment)

The part that changed since 2 years ago is that async/await has risen a lot in popularity and it doesn't suffer from the same problem. Then again for async/await zones are probably less important than being to hook into just the scheduling.

@JiaLiPassion
Copy link

@benjamingr , yeah, currently the issue is in angular and rxjs test, in the near future , if user want to compile typescript codeintoES2017 targetwithasync/await, zone.jscan't control thenative promise. So user will need to handle change detectionandasync test` themselves.

@benjamingr
Copy link

benjamingr commented May 31, 2018

@JiaLiPassion IIRC Ben Lesh said "IE11 is saving the internet". :D

This is something I plan to bring up in the second session - but TC39 is going to need to solve this for async functions and not Node.js. Feel free to open an issue in https://github.com/nodejs/promise-use-cases

@JiaLiPassion
Copy link

@benjamingr , got it, I will!

@mcollina
Copy link
Member

mcollina commented May 31, 2018

Join from PC, Mac, Linux, iOS or Android: https://zoom.us/j/903800260

Or iPhone one-tap :
US: +16465588656,,903800260# or +16699006833,,903800260#
Or Telephone:
Dial(for higher quality, dial a number based on your current location):
US: +1 646 558 8656 or +1 669 900 6833 or +1 855 880 1246 (Toll Free) or +1 877 369 0926 (Toll Free)
Meeting ID: 903 800 260
International numbers available: https://zoom.us/u/dBA97SNb0

@benjamingr
Copy link

@MayaLekova can you post the meeting notes :)?

@MayaLekova
Copy link
Author

Here are the meeting notes
The #number in the notes reference slide titles from @benjamingr slides (if you can share them as well would be awesome!).

@benjamingr
Copy link

https://docs.google.com/presentation/d/16WYzlvvDm85IruD3jkH2nTwTkTUa6YSPtDF0VQ4g4Hk/edit?usp=sharing

@benjamingr
Copy link

@MayaLekova
Copy link
Author

Takeaways

@benjamingr
Copy link

@bmeurer @MayaLekova two questions:

  • Can we close this issue? (Or do you want to do another session today?)
  • Can/should we schedule a follow-up meeting online on this in a month (two?)?

@bmeurer
Copy link

bmeurer commented Jun 1, 2018

I have to leave early today, but I'm happy to talk about promises in the morning. I'd say we can close this.

@benjamingr
Copy link

@benjamingr
Copy link

Thanks for participating everything I learned a lot and I think a lot of good progress was made. Please consider filling the doodle above if you haven't already. Also pinging @BridgeAR @addaleax @littledan in case either of them would like to also participate in the follow up discussion.

@littledan
Copy link
Contributor

@benjamingr Apologies for my delay; I've filled out the doodle.

@BridgeAR
Copy link

The same here.

@benjamingr
Copy link

Great, thanks for the update - going to wait for another day or two to see if anyone else wants to participate -the most likely candidate is Thu, Jul 12 @ 3:30 PM UTC unless we can figure out something that also works for @ljharb

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

No branches or pull requests

8 participants