TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

V8 developers start working on ES6 generators for JavaScript

95 pointsby jlongsterabout 12 years ago

10 comments

jlongsterabout 12 years ago
Note the opportunity here: all your promises code immediately turns into this: <a href="http://taskjs.org/" rel="nofollow">http://taskjs.org/</a>
评论 #5455591 未加载
jlongsterabout 12 years ago
Andy Wingo mentioned via twitter that he's working on it: <a href="https://twitter.com/andywingo/status/316644148532891648" rel="nofollow">https://twitter.com/andywingo/status/316644148532891648</a>
评论 #5455366 未加载
Yoricabout 12 years ago
Ahaha, finally!<p>I have been waiting to use this feature on the web, well, since Mozilla implemented it, which must have been at least 5 years ago.
评论 #5455216 未加载
olegpabout 12 years ago
In the mean time you can use fibers with Node. I've been using them for StartHQ (<a href="http://starthq.com" rel="nofollow">http://starthq.com</a>) via Common Node (<a href="https://github.com/olegp/common-node" rel="nofollow">https://github.com/olegp/common-node</a>) and to be honest I don't see how I could have made it maintainable with promises, let alone no flow control library at all.
评论 #5457517 未加载
Mahnabout 12 years ago
A bit offtopic, but: are all chromium &#38; V8 team members Googlers? just wondering, chromium and V8 are both open source, but I've never head of any major contributors other than Google itself.
评论 #5455200 未加载
评论 #5455849 未加载
评论 #5455387 未加载
评论 #5455408 未加载
gbadmanabout 12 years ago
I've been really looking forward to this ever since I saw this post[1] on the possibilities that coroutines introduce for async programming.<p>This article in question was already discussed in some depth on HN[2].<p>Can't wait for an era of much more elegant async code!<p>[1] <a href="http://syzygy.st/javascript-coroutines/" rel="nofollow">http://syzygy.st/javascript-coroutines/</a><p>[2] <a href="https://news.ycombinator.com/item?id=4912413" rel="nofollow">https://news.ycombinator.com/item?id=4912413</a>
surrealizeabout 12 years ago
The es wiki page linked in the bug doesn't say much about array/generator comprehensions, e.g.:<p>[for (x of a) for (y of b) x * y]<p>but those would be really nice as well.<p>A few months ago the ES committee decided to switch them from reading right-to-left (as in spidermonkey comprehensions, python, and haskell) to reading left-to-right (as in C#):<p><a href="https://gist.github.com/dherman/b250d1fad15dbb5f77a5" rel="nofollow">https://gist.github.com/dherman/b250d1fad15dbb5f77a5</a>
ajucabout 12 years ago
I'd love to use this for cooperative multitasking inside one thread (like in Python example using yield). Would be great for simple scripts for ai in games.
domenicdabout 12 years ago
So who do we have to pay to get this turned on by default, instead of behind a flag?
TazeTSchnitzelabout 12 years ago
PHP gets yield, now JS too?<p>You'd think it would be the other way round!