I answered on the GitHub discussions but I'll also explain here - in the past, I did make an experiment about awaiting promises in SCI (nbb) by changing the way SCI evals things. It made everything way slower, because basically the idea was to "bubble" promises until it hit the top-level form, and then await for that promise before evaluating the next top-form. So it is doable, the only question is that if it's worth it :D
@mauricio.szabo I think it's interesting but I have a few concerns:
1. it is not standard CLJS so people might be confused by it - if CLJS will ever support await, then we would have a good implementation reference to compare against
2. performance :) but I think we could look into making it much faster, if we e.g. don't overload deref. In nbb I chose to use nbb.core/await and use a counter to check if it has been called, so I don't have to do anything if the counter stays the same.
3. it might not be necessary since with promesa you can handle "inner" promises sufficiently well, that's why I chose to only support the top level await in nbb with much less complex logic
4. if this would be supported in SCI, then I'd have to maintain it forever and I'm not sure if that would get me into a rabbit hole, as I haven't looked into the implementation deeply enough.
Yet, I do appreciate that you've investigated this hack and we might revisit it in the future :-D
Yes, I agree with all your points π. As for performance, it may be possible to make it faster, but I believe not by much - the trouble is that for this hack to work, it needs to "bubble up" the promise so every form evaluated may pay the performance price... And I also don't think it should be supported in SCI at all π
but if you don't use the cljs.dialect/await form, then you should not have to do anything
Idea for a video. We convince @danielamber2 to record a Joyride video with the three of us, Daniel, @borkdude and me. We tunnel out the REPL connection to Borkdude who insists on using Emacs and is Joyriding my or Daniel's editor from Emacs. No clue what else we would be doing in the video, but I'm sure we can figure something out. π
Yes! Lets do this! π i've been very quiet recently! We're about to have a baby so time has been tight! But I think I can do this at the end of June if you guys don't mind waiting π otherwise might be best to do this without me?
Unless we think of something we can do quickly? Maybe we can chat about this on Thursday?
@danielamber2 Let's take our time. End of June is fine with me, then we have more time to mature joyride a bit :)
Awesome π
Oh, wow
A baby! That's wonderful!
Congrats!
hahaha sure
Daniel already uses VSCode / Calva so he would be a good user to test this and make a video about it, while we're in the backseat giving him instructions ;)
And I kill the electron process from emacs occasionally
Giving his REPL server βinstructionsβ π