Node 0.12 and harmony flag

2,190 views
Skip to first unread message

Alessandro Artoni

unread,
Dec 12, 2013, 11:52:59 AM12/12/13
to nod...@googlegroups.com
Hi everybody!
I am, like a lot of you, by the new harmony features implemented in v8.
I'm starting a new project that would greatly benefits from them, generators and yield in particular and it would be ok for me to support only node >= .12
 Currently they are available through cli switch in node unstable (0.11)...is there any chance they're going to be on by default when the next stable is released?

Cheers

Alessandro

(node rocks!)

Gary Katsevman

unread,
Dec 12, 2013, 11:56:25 AM12/12/13
to nod...@googlegroups.com
Harmony features won't be on by default on node until they are on by default in v8. You'll still be able to run node with `--harmony` to get these features enabled.

Gary Katsevman
gkatsev.com


--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
 
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alessandro Artoni

unread,
Dec 12, 2013, 12:00:25 PM12/12/13
to nod...@googlegroups.com
Many thanks!


2013/12/12 Gary Katsevman <m...@gkatsev.com>
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/aXNCkBxGDYE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Alessandro Artoni


Nathan Rajlich

unread,
Dec 12, 2013, 1:29:12 PM12/12/13
to nod...@googlegroups.com
If you're only interested in the Generators aspect of ES6, then you can use them today even with node v0.10 using gnode: https://github.com/TooTallNate/gnode

Cheers!

Timothy J Fontaine

unread,
Dec 12, 2013, 2:04:00 PM12/12/13
to nod...@googlegroups.com
though quite evil, it's also possible to turn features on at runtime https://npmjs.org/package/setflags

Alessandro Artoni

unread,
Dec 12, 2013, 2:07:02 PM12/12/13
to nod...@googlegroups.com

Ok, that's definitely too evil :-)

Rick Waldron

unread,
Dec 12, 2013, 2:58:27 PM12/12/13
to nod...@googlegroups.com
On Thu, Dec 12, 2013 at 2:04 PM, Timothy J Fontaine <tjfon...@gmail.com> wrote:
though quite evil, it's also possible to turn features on at runtime https://npmjs.org/package/setflags


Three of the flags that are listed in the readme are for obsolete proto implementations: 

--harmony_modules
--harmony_proxies
--harmony_typeof

The first two are just out of date (by more than a year), but the third is completely removed from ES6. Seems bad to offer a module that promotes using junk that will only result in broken code when it gets removed. 

Rick

Timothy J Fontaine

unread,
Dec 12, 2013, 3:00:57 PM12/12/13
to nod...@googlegroups.com
It's open source patches are accepted, I merely grabbed what was in --v8-options when I wrote the module. 


Alex Kocharin

unread,
Dec 13, 2013, 9:25:08 AM12/13/13
to nod...@googlegroups.com
 
I think that setting flags at runtime is still better than using regenerator like gnode does (if you don't care about v0.10 of course).
 
 
12.12.2013, 23:07, "Alessandro Artoni" <art...@gmail.com>:

Nathan Rajlich

unread,
Dec 13, 2013, 12:42:21 PM12/13/13
to nodejs
Alex, if --harmony-generators is supported, then gnode will spawn a node instance with that flag passed, rather than the regenerator transpiling. Regenerator is only used on <= v0.11.2, before that flag was implemented in V8.

(That implementation detail should be essentially transparent though).

Alex Kocharin

unread,
Dec 13, 2013, 2:35:25 PM12/13/13
to nod...@googlegroups.com
Nathan,
 
It's if you call it using "gnode" instead of "node". You'll have to tell users to install it globally, and here they are all the issues with that.
 
I'd prefer to require something inside of the script, so users won't even notice it's there if they won't look closely. Which means using programmatic api. But if I understood that correctly, gnode will run regenerator in this case, even if node supports, but wasn't called with harmony.
 
Or does it still fork in that case? Anyway, setting a flag in runtime sounds simpler. :)
 
 
13.12.2013, 21:42, "Nathan Rajlich" <nat...@tootallnate.net>:

q2dg2b

unread,
Dec 21, 2013, 1:57:14 PM12/21/13
to nod...@googlegroups.com
I think the question most important about this topic it is: will Node.js substitute callback by generators in 1.0? If it will, it will be a completely different language and platform.
Sincerely, I would like to know if generators will be the "next great thing", since they  are another way of thinking very different from callbacks (in fact, Node.js wouldn't be the same Node.js we know)

You can see a movement in this direction inside Express team, who has launched Koa, for instance...


Jonathan Ong

unread,
Dec 21, 2013, 2:26:21 PM12/21/13
to nod...@googlegroups.com
no, that will break everything. plus, what happens if there's "await" in ES7? they would have to change everything again.

q2dg2b

unread,
Dec 21, 2013, 8:21:03 PM12/21/13
to nod...@googlegroups.com
I wish your answer shall be the official one....

Rick Waldron

unread,
Dec 21, 2013, 10:37:09 PM12/21/13
to nod...@googlegroups.com
On Sat, Dec 21, 2013 at 1:57 PM, q2dg2b <q2d...@gmail.com> wrote:
I think the question most important about this topic it is: will Node.js substitute callback by generators in 1.0?

I don't think you understand generators—they don't "replace" or "substitute" callbacks. They are an addition to your developer toolkit.
 
If it will, it will be a completely different language and platform.

The language is still JavaScript, it's just evolving.
 
Sincerely, I would like to know if generators will be the "next great thing", since they  are another way of thinking very different from callbacks (in fact, Node.js wouldn't be the same Node.js we know)

You can see a movement in this direction inside Express team, who has launched Koa, for instance...

...Evolution.


Rick

T.C. Hollingsworth

unread,
Dec 21, 2013, 10:43:29 PM12/21/13
to nod...@googlegroups.com
On Sat, Dec 21, 2013 at 6:21 PM, q2dg2b <q2d...@gmail.com> wrote:
> I wish your answer shall be the official one....

It is:
https://groups.google.com/d/msg/nodejs/9afurRCTlOc/JKVo0ThFZIsJ

-T.C.

Alessandro Artoni

unread,
Dec 21, 2013, 10:48:46 PM12/21/13
to nod...@googlegroups.com

Guys, just my humble opinion... I don't think node APIs will directly make use of generator (or promises) in a near future, since they will break almost everything.
What, to me, is more important is to understand weather developer can reasonably hope to have support for these features in the platform or not, so that new higher-level APIs and framework could be built on top of it.
For what I understand, after quite a lot of research, v8 will more likely NOT enabled harmony features without flag until the standard is finalized. That being, according to people on es-discuss, something around end of Q1 for a RC version, end of the year for the final Ecmascript 6 publication
Thanks everybody for helping!

Rick Waldron

unread,
Jan 1, 2014, 10:23:42 PM1/1/14
to nod...@googlegroups.com
On Sat, Dec 21, 2013 at 10:48 PM, Alessandro Artoni <art...@gmail.com> wrote:

Guys, just my humble opinion... I don't think node APIs will directly make use of generator (or promises) in a near future, since they will break almost everything.
What, to me, is more important is to understand weather developer can reasonably hope to have support for these features in the platform or not, so that new higher-level APIs and framework could be built on top of it.
For what I understand, after quite a lot of research, v8 will more likely NOT enabled harmony features without flag until the standard is finalized. That being, according to people on es-discuss, something around end of Q1 for a RC version, end of the year for the final Ecmascript 6 publication
Thanks everybody for helping!


Sorry so late, but I can confirm this is correct.

Rick


Reply all
Reply to author
Forward
0 new messages