Issue 2355 in v8: Implement `yield` for generators

45 views
Skip to first unread message

codesite...@google.com

unread,
Oct 2, 2012, 11:13:23 AM10/2/12
to v8-...@googlegroups.com
Status: New
Owner: ----

New issue 2355 by longs...@gmail.com: Implement `yield` for generators
http://code.google.com/p/v8/issues/detail?id=2355

Generators have been approved for ES.next:
http://wiki.ecmascript.org/doku.php?id=harmony:generators

Firefox currently implements the `yield` keyword, but not the function*()
{} syntax. I think v8 should do the same for now.

I searched everywhere and I can't find any existing bugs or plans for the
`yield` keyword. This is a significant feature for javascript, one of the
few that introduces a new semantic that is very difficult to simulate
without native support.

This would have a big impact on node.js as well, allowing better style for
async code.

codesite...@google.com

unread,
Jan 17, 2013, 6:38:23 PM1/17/13
to v8-...@googlegroups.com

Comment #1 on issue 2355 by gorgi.ko...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

+1. While for some people this will be just a "nice to have", for complex
JS code and especially in node.js it would make all the difference in the
world. It will enable people to write coroutine-like code instead of crufty
and sometimes convoluted callback boilerplate.

codesite...@google.com

unread,
Jan 17, 2013, 6:41:13 PM1/17/13
to v8-...@googlegroups.com

Comment #2 on issue 2355 by gorgi.ko...@gmail.com: Implement `yield` for
Edit: forgot to add - for example, something like task.js
http://taskjs.org/ + V8 would mean pure awesome (especially for node)

codesite...@google.com

unread,
Jan 19, 2013, 1:28:15 AM1/19/13
to v8-...@googlegroups.com

Comment #3 on issue 2355 by kurtisfi...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

All I can say is ... what's the hold up? Firefox has had this for 5 years
now. You guys could at least make it conditionally compiled so that
node.js can use it. And while I'm dreaming maybe you could implement
the 'async' keyword? Of course that would mean having a task framework
like .Net, which would imply having a standard framework period.

I wish someone could at least explain why generators are not being
implemented in V8.


codesite...@google.com

unread,
Jan 20, 2013, 10:57:09 PM1/20/13
to v8-...@googlegroups.com

Comment #4 on issue 2355 by disfated: Implement `yield` for generators
http://code.google.com/p/v8/issues/detail?id=2355

I would give all Harmony features for only the support for generators. I
believe it will bring ssjs to a comletely new level. So... WHEN??? :)

codesite...@google.com

unread,
Mar 26, 2013, 2:09:40 PM3/26/13
to v8-...@googlegroups.com

Comment #5 on issue 2355 by aarons...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

Please, for the love of all that is good, yes. Sooner than later.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Mar 27, 2013, 6:35:03 AM3/27/13
to v8-...@googlegroups.com
Updates:
Status: Accepted

Comment #6 on issue 2355 by yan...@chromium.org: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

(No comment was entered for this change.)

codesite...@google.com

unread,
Mar 27, 2013, 6:42:15 AM3/27/13
to v8-...@googlegroups.com

Comment #7 on issue 2355 by kurtisfi...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

Yay!

codesite...@google.com

unread,
Mar 27, 2013, 6:43:15 AM3/27/13
to v8-...@googlegroups.com

Comment #8 on issue 2355 by disfated: Implement `yield` for generators
http://code.google.com/p/v8/issues/detail?id=2355

Thanks all gods!

codesite...@google.com

unread,
Mar 27, 2013, 6:51:17 AM3/27/13
to v8-...@googlegroups.com
Updates:
Owner: mstar...@chromium.org

Comment #9 on issue 2355 by yan...@chromium.org: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

(No comment was entered for this change.)

codesite...@google.com

unread,
Mar 27, 2013, 7:07:49 AM3/27/13
to v8-...@googlegroups.com

Comment #10 on issue 2355 by tobias.b...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

Thank you!

codesite...@google.com

unread,
Mar 27, 2013, 7:39:25 AM3/27/13
to v8-...@googlegroups.com

Comment #11 on issue 2355 by mieli...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

Please make it an expression so one can conveniently pass a value to
generator, e.g.:

var x;
x = yield;

or

return yield MyAsyncFunction();

codesite...@google.com

unread,
Mar 27, 2013, 11:05:20 AM3/27/13
to v8-...@googlegroups.com

Comment #12 on issue 2355 by edy.b...@gmail.com: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

The specs already has yield as an expression, so they should implement it
that way.

codesite...@google.com

unread,
Mar 27, 2013, 12:14:27 PM3/27/13
to v8-...@googlegroups.com
Updates:
Cc: rossb...@chromium.org
Labels: Harmony

Comment #13 on issue 2355 by yan...@chromium.org: Implement `yield` for
generators
http://code.google.com/p/v8/issues/detail?id=2355

(No comment was entered for this change.)

Reply all
Reply to author
Forward
0 new messages