Use yielding (await) in javascript today, with traceur
kyle.graehl.org
kyle.graehl.org
Once the realization hits that in the real world all programming calls are asynchronous, writing awkward code structure with callbacks/promises is unnecessary and just a crutch.
If I wasn't used Iced I would be using Traceur. ES6 features create code that is much more straightforward to understand, and quicker to write to boot.
There is no guarantee that in the future the compiler/CPU will prevent other actions during a 'blocking' call. Blocking syntax is simply for the convenience of program structure.
Whether the call is blocking/synchronous or non-blocking/asynchronous is just a decision that was made at the language design level. Hence why node has both sync and async for file I/O.
Await/yield allows us to keep the concerns of the function in one code block rather than splitting them up -- regardless of whether the source author wrote the method as 'synchronous'.
Thinking about a program as async from the start avoids a ton of problems down the line.
I think that'll be especially handy in Node, where (in my experience) you're a lot more likely to deal with nested async operations.
Agreed. I think that we should start considering the new features
as soon as they begin to work in browsers, and on Node.
[1] https://github.com/jashkenas/coffee-script/issues/3073