Goal: JavaScript async with minimal plumbing. Status: Using Proxy to make it look like a resolved Promise becomes its settled value.
-
-
Replying to @TimSweeneyEpic
@jlongster Have any tips for@TimSweeneyEpic? I've seen some interesting stuff, especially in WebDev show and tell.2 replies 0 retweets 0 likes -
Replying to @scottmichaud @TimSweeneyEpic
Hardest part is lack of deep yield (pausing multiple frames on stack). JS can only shallow yield
1 reply 0 retweets 2 likes -
Replying to @jlongster @scottmichaud
Shallow yield, immutable Proxy target, and library inflexibility mean there's still significant plumbing.
1 reply 0 retweets 0 likes -
A radical proposal: make every JavaScript value a future, every stack suspendable, for automatic async everything.
1 reply 0 retweets 2 likes -
Replying to @TimSweeneyEpic @scottmichaud
"every stack suspendable" is the key part. I like it. implemented continuations in JS:http://jlongster.com/Whats-in-a-Continuation …
1 reply 0 retweets 2 likes -
Replying to @jlongster @scottmichaud
Wow, awesome! Keep in mind, everything-is-a-future also magically solves recursive initialization problems.
1 reply 0 retweets 2 likes -
E.g. var x=y[0]+1, y=[3,x+1] magically works, and scales to module initialization dependencies.
1 reply 0 retweets 1 like -
Replying to @TimSweeneyEpic @scottmichaud
That seems tricky (what if `x=y[1]`?), but hard to discuss more details over twitter :)
1 reply 0 retweets 0 likes
When the program deadlocks with no external (I/O) dependencies, like var x=x, the runtime produces a nice error.
-
-
Such code is typically wrong anyway, and today's JS code will never suspend on an async VM because it's 100% eager.
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.