Bruce Pascoe
Bruce Pascoe
Does ES6 (or later) have anything to say about the engine's responsibility w.r.t. timing of job processing?
Having started taking advantage of ES6 modules in minisphere through Babel, I have to say I really like the import/export syntax. It's very direct, as compared to the more passive...
You need one additional piece of puzzle compared to generators: `Promise`. An async function returns a promise; `await` basically just says, "when this promise is fulfilled, `resume(me)`". So it's kind...
It's actually already possible to polyfill generator functions using Duktape threads, see: https://github.com/svaarala/duktape/issues/1101#issuecomment-264230874 There are a few minor differences in Duktape behavior compared to real ES generators that make this...
> I'm still thinking it might be easier to implement the other way around: make Promises + async/await first class constructs, and then implement GeneratorFunctions's yield using async/await. That would...
> I know the current Babel implementation implements async/await by translating it into generator primitives, As does TypeScript (when using `--downlevelIteration`, without it TS won't transpile them at all). IMO...
@svaarala Thinking about this now, assuming a `Promise` polyfill is provided, could one emulate `await` by: ```js // await prom; prom.then(Duktape.Thread.resume.bind(null, thisThread)); Duktape.Thread.yield(); ``` Or would that cause unforeseen issues...
I was under the impression that WebAssembly was just a subset of full JavaScript. Is that not actually the case?
Yeah, asm.js was what I was thinking of. WebAssembly seems interesting: what I got out of that page was that it's essentially an attempt at a standardized bytecode format for...
> The specification allows custom LHS expressions where e.g. a function returns an LHS compatible value. FWIW, I think this was explicitly disallowed in ES6.