One other thing: although there are some things (like the bug I cited) that could be fixed, the other aspect of exception handling cannot be fixed without breaking core.async, which, by design, swallows exceptions on the producer side. David Nolen has a proposal for the <? operator, but that requires the producer to cooperate (and still doesn't help when something like not= or JSON.parse throws an exception you weren't expecting, unless you write the code very carefully). Promise code just doesn't have this problem because there's a built in error channel that will catch any uncaught exception--and that makes debugging much easier.
On Thu, May 24, 2018 at 5:02 PM Shaun LeBron <shaunewilli...@gmail.com> wrote: > good point about the IIFEs, added some notes on what to fixl: > > > https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#blockers > > > [core.async] is a much more powerful abstraction which can do a lot of > things async/await can't and anything that does can easily be achieved with > core.async and a few helper functions/macros > > not quite! core.async doesn't allow you to cancel a go-block (to my > knowledge), which JS allows. I added a section on this: > > > https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript#coreasync > > On Thursday, May 24, 2018 at 4:44:29 PM UTC-5, Thomas Heller wrote: >> >> I'm generally in favor of "embracing the host" but both generators and >> async/await would probably require substantial rewrites of core parts of >> the compiler. It it not just about adding a small *** or *async* keyword >> somewhere. The compiler will generally emit anonymous functions at various >> places to ensure proper scoping and this can pretty easily break >> async/generator functions. Given that you'd emitting ES6+ anways however >> you could replace those with proper block-scoped lets though. Of course >> that is not a reason to not do it, just don't underestimate how much work >> this would be. >> >> I certainly looks like the JS world is adopting async/await but given the >> rate of change in that ecosystem that might change again when the next >> thing comes along. Given that the React folks decided to implement a pretty >> substantial feature based on throwing promises I guess they are here to >> stay for a while though. >> >> I do not think that this compares in any way to core.async however. It is >> a much more powerful abstraction which can do a lot of things async/await >> can't and anything that does can easily be achieved with core.async and a >> few helper functions/macros. Yes, core.async is not perfect either but >> someone could work on fixing the kinks. >> >> I guess I agree that we should eventually support async/await + >> generators for the sake of full interop but not because of "issues" with >> core.async. >> >> >> On Thursday, May 24, 2018 at 6:58:38 PM UTC+2, Shaun LeBron wrote: >>> >>> thanks for posting this question. I asked about it a few months ago on >>> slack and apparently it has come up a few times. There is resistance (for >>> good reason), but here's a proposal I put together that might get >>> discussion going: >>> >>> >>> https://beta.observablehq.com/@shaunlebron/proposal-generators-and-async-functions-in-clojurescript >>> >>> in summary, core.async doesn't solve all the problems, can be harder to >>> debug, and using the promise api directly can be unwieldy. but there are >>> arguments against including the extra syntax. >>> >>> feedback appreciated! >>> >>> >>> On Wednesday, May 23, 2018 at 11:44:06 PM UTC-5, Philos Kim wrote: >>>> >>>> I wonder when the async/await feature in ES8 will be introduced in >>>> ClojureScript. >>>> >>>> Of course, I know there is core.async in ClojureScript but I hope that >>>> the async/await feature in ES8 will be supported in ClojureScript as soon >>>> as possible. >>>> >>>> Does anyone know when it will be supported? >>>> >>> -- > Note that posts from new members are moderated - please be patient with > your first post. > --- > You received this message because you are subscribed to the Google Groups > "ClojureScript" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojurescript+unsubscr...@googlegroups.com. > To post to this group, send email to clojurescript@googlegroups.com. > Visit this group at https://groups.google.com/group/clojurescript. > -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojurescript+unsubscr...@googlegroups.com. To post to this group, send email to clojurescript@googlegroups.com. Visit this group at https://groups.google.com/group/clojurescript.