Hi all,
I've created three experimental branches recently:
* The await branch is an attempt to support the await / deferred proposal which has been submitted to EcmaScript (
http://wiki.ecmascript.org/doku.php?id=strawman:deferred_functions). What I did is just a quick proof of concept but it shows that 1) there is a very good alignment between the await / deferred proposal and streamline, and 2) the full proposal can be easily implemented in streamline. To see what the result looks like, take a peek at
https://github.com/Sage/streamlinejs/blob/await/examples/diskUsage/diskUsageAwait._js* The typescript branch is an attempt to use streamline with TypeScript. I was quite successful with it and I managed to get a working version of the full tutorial in TypeScript (
https://github.com/Sage/streamlinejs/blob/typescript/tutorial/tuto8-all.ts). After that I started to convert some of our project's modules to TypeScript; to get a better feel for what it would bring, but I hit some bugs in the TypeScript compiler. So I let it rest a bit.
* The spoon branch is an attempt to support Fedor Indutny's spoon transform (
https://github.com/indutny/spoon) as an alternative to streamline's callback transform. I managed to hook it up but it only passes a subset of my unit tests because the spoon transform is incomplete (see
https://github.com/Sage/streamlinejs/blob/spoon/test/common/spoon/eval-test._js - the tests that don't pass are currently commented out).
I would like to put more work into the await branch. I think that we need a clean async language extension to JS in the future and I would rather join a proposal which has already been discussed in the EcmaScript circles than push an alternate proposal which will likely be perceived as a marginal, personal initiative.
This does not mean that I would drop the _ syntax (our team has too much investment in it). Instead I would support both syntaxes together, so that you can choose and so that you can seamlessly migrate modules from _ to await if you choose to.
Regarding typescript, I would give it a slightly lower priority. The await syntax is likely to have more appeal than the _ syntax in the typescript community, because the keyword already exists in C#. So I'd rather get back to it after solidifying the await implementation.
I don't intend to put any work into the spoon branch at the stage. I'm waiting for Fedor to complete his implementation.
I had also added a timeout/cancellation API to futures in the master branch (see
https://github.com/Sage/streamlinejs/issues/106). This API has not landed in NPM yet (NPM is on the v0.4 branch). I'd like to pursue this but I may choose to develop these features around the deferred API rather than around the future API.
I wanted to share this with you. I'm particularly interested by your thought on the idea to bridge the gap with the await/deferred proposal.
Cheers to all,
Bruno