worry.... of ES6 and Node & errors

301 views
Skip to first unread message

Ep Ga

unread,
Sep 9, 2014, 4:44:47 PM9/9/14
to nod...@googlegroups.com

Are you going to force user to use ES6? A lot of dislike ES6 and are for ES5+; staying complaint with our code style and syntax as ES5, with the addition of new feature such as let and const, +. Which does not change the syntax but just add on new statement and operand.

Are you going to force user to use new feature of ES6 or are you just going to make them available to be use in node, and node, not changing the code module where we will be force to use ES6 feature.

Like I said, a lot of us disprove of some... most the majority of the new features in ES6, and are only looking forward to those that does not change the language, but add on... i.e.: ES5+

Also, do you have documentation of all errors that could take place in the node environment?

zladuric

unread,
Sep 10, 2014, 1:53:13 AM9/10/14
to nod...@googlegroups.com
Do you have a source of that data? Because majority of professionals I've spoken to and I'm following are eager to start using ES6, done already do.

Especially because it will, implicitly it explicitly, prevent whole classes of errors. In any case, I think it is up to the upstream provider of V8, Google.

In any case, you can always remain on node v0.10.x.

As for documented errors, you're referring to bugs? Did you check github issues for node project?

Rick Waldron

unread,
Sep 10, 2014, 7:55:08 PM9/10/14
to nod...@googlegroups.com


On Tuesday, September 9, 2014, Ep Ga <epg...@gmail.com> wrote:

Are you going to force user to use ES6? A lot of dislike ES6 and are for ES5+; staying complaint with our code style and syntax as ES5, with the addition of new feature such as let and const, +. Which does not change the syntax but just add on new statement and operand.

Are you going to force user to use new feature of ES6 or are you just going to make them available to be use in node, and node, not changing the code module where we will be force to use ES6 feature.

Like I said, a lot of us disprove of some... most the majority of the new features in ES6, and are only looking forward to those that does not change the language, but add on... i.e.: ES5+


V8 will implement new language features and they will appear in Node as they become stable. 
 

Also, do you have documentation of all errors that could take place in the node environment?

There are no breaking changes in ES6, so there will be no errors when using new language features.

Rick
 

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/bf8a0e1d-6128-4f84-9d2c-773b2b6cf5ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeremy Darling

unread,
Sep 10, 2014, 7:55:51 PM9/10/14
to nodejs
I'm not on the Node team but I would assume that it would depend on what the V8 team decides to do since Node is basically a wrapper around V8 at the end of the day.  If the V8 team decides to enforce ES6 only (unlikely) and not provide backward compatibility with ES5 then Node would most certainly be forced to go this route as well, that or fork and maintain their own version of the V8 core.

As ES6 is vastly different than ES5 it would seem more likely that a directive will be added (similar to that of "use strict") that would provide an indicator to the browser/javascript engine to switch into ES6 mode.  A real trick to that flag though would have to be the ability for it to be queried thus allowing older (or non-ES6) browsers to prompt the user or fall back to a different code base.

Course, as I said, I'm not a member of the Node Core nor am I a V8 developer, so my 2 cents is pretty much worthless :)

 - Jeremy


--

Ep Ga

unread,
Sep 11, 2014, 12:43:43 AM9/11/14
to nod...@googlegroups.com
I'm more so speaking on syntax style... are we going to have to be force to use the enw syntax style or will there be a choice in the programming style we prefer?

like callback function and so on.

.... dark days ahead I see... dark days...

Rick Waldron

unread,
Sep 11, 2014, 2:09:03 AM9/11/14
to nod...@googlegroups.com
On Tue, Sep 9, 2014 at 6:57 PM, Jeremy Darling <jeremy....@gmail.com> wrote:
I'm not on the Node team but I would assume that it would depend on what the V8 team decides to do since Node is basically a wrapper around V8 at the end of the day.  If the V8 team decides to enforce ES6 only (unlikely)

V8 implementors are involved with designing and specifying ES6 and features are already well in progress.
 
and not provide backward compatibility with ES5

No ES5 code will break. 
 
then Node would most certainly be forced to go this route as well, that or fork and maintain their own version of the V8 core.

Which isn't going to happen.
 

As ES6 is vastly different than ES5 it would seem more likely that a directive will be added (similar to that of "use strict")

Nope, ES6 was designed as a fully compatible superset to ES5.
 
that would provide an indicator to the browser/javascript engine to switch into ES6 mode.  

There won't be any new modes.
 
A real trick to that flag though would have to be the ability for it to be queried thus allowing older (or non-ES6) browsers to prompt the user or fall back to a different code base. 

Course, as I said, I'm not a member of the Node Core nor am I a V8 developer, so my 2 cents is pretty much worthless :)


;)


Rick
 

 - Jeremy


On Tue, Sep 9, 2014 at 3:44 PM, Ep Ga <epg...@gmail.com> wrote:

Are you going to force user to use ES6? A lot of dislike ES6 and are for ES5+; staying complaint with our code style and syntax as ES5, with the addition of new feature such as let and const, +. Which does not change the syntax but just add on new statement and operand.

Are you going to force user to use new feature of ES6 or are you just going to make them available to be use in node, and node, not changing the code module where we will be force to use ES6 feature.

Like I said, a lot of us disprove of some... most the majority of the new features in ES6, and are only looking forward to those that does not change the language, but add on... i.e.: ES5+

Also, do you have documentation of all errors that could take place in the node environment?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/bf8a0e1d-6128-4f84-9d2c-773b2b6cf5ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.

Rick Waldron

unread,
Sep 11, 2014, 7:22:03 PM9/11/14
to nod...@googlegroups.com
You can write whatever code style you want to write. 

Rick
 

Zlatko Đurić

unread,
Sep 11, 2014, 7:22:31 PM9/11/14
to nod...@googlegroups.com

Ok, I'm falling for it.

What syntax style? Show one specific example that will not work with harmony?
Do you even know what changes it brings?
Do you know that some harmony features are already shipped, not just in Chrome, but also Firefox? And no pages are being broken?

--
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/k7DKA2uKCVA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.

To post to this group, send email to nod...@googlegroups.com.

Ep Ga

unread,
Sep 12, 2014, 10:08:42 PM9/12/14
to nod...@googlegroups.com
I just... I just find it more easier to understand ES5 than Es6... A few of there new addition I can see of use, but for most I'm cloudy on... I just want to be able to always use ES5 with addition to it as ES+... I like the callback hell, and node have module that can be use to break it down into an saner view.

I'm ES5+.... Just won't some comfort knowing that i can use it's style instead of this new syntax style....

Generators, why do they have *? Couldn't the yield sign defined a behavior of the function to a generator behavior? And even understand or better yet compwthending the act of generator is not clear to me....

And why couldn't they be a key word instead of adding a funny syntax to it? Like Geneator(); and generator(); for both constructor and statment?

And promise???

I just.... Anyone care to give a feedback?

Bruno Jouhier

unread,
Sep 13, 2014, 9:46:40 AM9/13/14
to nod...@googlegroups.com
Generators have a * because it is sometimes desirable to be able to create a generator that does not yield. Consider the following:

function* genIntegers() { var i = 0; while (true) yield i++; }
function* genNothing() { }

function doSomethingWithGenerator(g) { ... }
function foobar(really) { doSomethingWithGenerator(really ? genIntegers() : genNothing()); }

Bruno

th317erd

unread,
Sep 14, 2014, 2:24:40 AM9/14/14
to nod...@googlegroups.com
I don't know if ANY instance in the history of ANY programming language where moving forward broke things from before. I am sure with enough digging someone could find something here or there... but bottom line is don't worry. You can use ES6 just like it was ES5... just ignore the new features. 

Cheers!

Rick Waldron

unread,
Sep 14, 2014, 3:36:22 AM9/14/14
to nod...@googlegroups.com


On Friday, September 12, 2014, Ep Ga <epg...@gmail.com> wrote:
I just... I just find it more easier to understand ES5 than Es6... A few of there new addition I can see of use, but for most I'm cloudy on... I just want to be able to always use ES5 with addition to it as ES+... I like the callback hell, and node have module that can be use to break it down into an saner view.

I'm ES5+.... Just won't some comfort knowing that i can use it's style instead of this new syntax style....

As I've told you several times, on several threads, over several mailing lists: you may use whatever parts of the language you feel comfortable with—no one will force you to use anything.
 

Generators, why do they have *? Couldn't the yield sign defined a behavior of the function to a generator behavior? 

Because yield is not a reserved word and making it so would break code in existing functions that may use that word as an identifier. function* is a new syntactic boundary that eliminates this hazard. This is well documented.
 
And even understand or better yet compwthending the act of generator is not clear to me....

And why couldn't they be a key word instead of adding a funny syntax to it? Like Geneator(); and generator(); 

For the same reason as above.

 
for both constructor and statment?

And promise???

I just.... Anyone care to give a feedback?

There exists ample discussion and publications covering the use cases and history of generators and promises in both JavaScript and other languages. 

Rick



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.

To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/10e28c5d-2f28-4cfa-b46a-47d8b5a97993%40googlegroups.com.

Peter Petrov

unread,
Sep 14, 2014, 8:35:30 PM9/14/14
to nod...@googlegroups.com
On Sunday, September 14, 2014 9:24:40 AM UTC+3, th317erd wrote:
I don't know if ANY instance in the history of ANY programming language where moving forward broke things from before. I am sure with enough digging someone could find something here or there...


Python 3 

Ryan Schmidt

unread,
Sep 14, 2014, 8:50:57 PM9/14/14
to nod...@googlegroups.com

On Sep 14, 2014, at 1:24 AM, th317erd wrote:

> I don't know if ANY instance in the history of ANY programming language where moving forward broke things from before. I am sure with enough digging someone could find something here or there...

I agree and hope that new versions of ECMAScript should be backwards compatible with old versions. But it's certainly not the case in all languages. As an example, practically every new minor version of PHP introduces backward-incompatible changes, such as the introduction of new reserved words which old code might be using as e.g. identifier names; in fact it seems to me that the primary driving factor behind increasing PHP's minor version number is in order to introduce a breaking change. Such breaking changes are enumerated in the migration documents:

http://php.net/manual/en/appendices.php

I'm not holding up PHP as any kind of example of good language design, just wanted to point out that there absolutely are languages whose new versions don't necessarily run all old code anymore. Fortunately I've moved on from PHP to node where I hope I won't have to deal with too much of that. (Instead, I have to deal with new versions of npm modules that have different interfaces than their predecessors, or modules being abandoned and having to find replacements that work differently.)

Rick Waldron

unread,
Sep 14, 2014, 8:51:17 PM9/14/14
to nod...@googlegroups.com
On Sat, Sep 13, 2014 at 9:46 AM, Bruno Jouhier <bjou...@gmail.com> wrote:
Generators have a * because it is sometimes desirable to be able to create a generator that does not yield. Consider the following:

That's not why "function *" exists. The new syntactic form exists as a means of creating a safe way to introduce `yield` as a special special form keyword; currently `yield` is a valid identifier in any global or function code. Take a look at the following: 

  function foo() {
    var yield = 1;
    return yield;
  }

That's completely valid in non-strict code: http://jsfiddle.net/rwaldron/16hg19cd/ If ES6 decided to risk the path that SpiderMonkey took for JS1.7/1.8 then any code that used the word `yield` as an identifier would suddenly stop working as intended. Providing a new syntactic boundary prevents that from happening: no code can possibly exist of this form or within this form, therefore nothing can be broken by its addition. A second reason is that "function *" provides a syntactic mechanism to clearly denote that this function declaration or expression is in fact defining a generator. 

Rick


 

function* genIntegers() { var i = 0; while (true) yield i++; }
function* genNothing() { }

function doSomethingWithGenerator(g) { ... }
function foobar(really) { doSomethingWithGenerator(really ? genIntegers() : genNothing()); }

Bruno

On Saturday, September 13, 2014 4:08:42 AM UTC+2, Ep Ga wrote:
I just... I just find it more easier to understand ES5 than Es6... A few of there new addition I can see of use, but for most I'm cloudy on... I just want to be able to always use ES5 with addition to it as ES+... I like the callback hell, and node have module that can be use to break it down into an saner view.

I'm ES5+.... Just won't some comfort knowing that i can use it's style instead of this new syntax style....

Generators, why do they have *? Couldn't the yield sign defined a behavior of the function to a generator behavior? And even understand or better yet compwthending the act of generator is not clear to me....

And why couldn't they be a key word instead of adding a funny syntax to it? Like Geneator(); and generator(); for both constructor and statment?

And promise???

I just.... Anyone care to give a feedback?

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.

Ep Ga

unread,
Sep 15, 2014, 12:48:21 AM9/15/14
to nod...@googlegroups.com
I'm mostly looking forward to what I consider the extension of ES5, ES5+:

let
yield --with out the 'function*'--

And a couple of other addition.

I am to use native module to build my app, no external module...

With these add on for the language, this might make this easier... But no sense on waiting... You'll think by this time 'let' would be useable by now.

Rick Waldron

unread,
Sep 15, 2014, 1:41:20 PM9/15/14
to nod...@googlegroups.com
On Mon, Sep 15, 2014 at 12:48 AM, Ep Ga <epg...@gmail.com> wrote:
I'm mostly looking forward to what I consider the extension of ES5, ES5+:

let
yield --with out the 'function*'--

That's not a thing that is possible or going to change.
 

And a couple of other addition.

I am to use native module to build my app, no external module...

With these add on for the language, this might make this easier... But no sense on waiting... You'll think by this time 'let' would be useable by now.

The current implementation in v8, behind the --harmony flag is several years old and long obsolete.

Rick

Bruno Jouhier

unread,
Sep 15, 2014, 1:49:51 PM9/15/14
to nod...@googlegroups.com


On Monday, September 15, 2014 2:51:17 AM UTC+2, Rick Waldron wrote:


On Sat, Sep 13, 2014 at 9:46 AM, Bruno Jouhier <bjou...@gmail.com> wrote:
Generators have a * because it is sometimes desirable to be able to create a generator that does not yield. Consider the following:

That's not why "function *" exists. The new syntactic form exists as a means of creating a safe way to introduce `yield` as a special special form keyword; currently `yield` is a valid identifier in any global or function code. Take a look at the following: 

  function foo() {
    var yield = 1;
    return yield;
  }

That's completely valid in non-strict code: http://jsfiddle.net/rwaldron/16hg19cd/ If ES6 decided to risk the path that SpiderMonkey took for JS1.7/1.8 then any code that used the word `yield` as an identifier would suddenly stop working as intended. Providing a new syntactic boundary prevents that from happening: no code can possibly exist of this form or within this form, therefore nothing can be broken by its addition. A second reason is that "function *" provides a syntactic mechanism to clearly denote that this function declaration or expression is in fact defining a generator. 

Rick

Right. I forgot about the syntax issue. But it's not just syntactically useful, it is also semantically useful.
 

Ep Ga

unread,
Sep 15, 2014, 6:23:39 PM9/15/14
to nod...@googlegroups.com
Rick Waldron

I'm speaking of this:

function foo(x){
While(x){
yield x.pop();
}
}

var bar = Foo(["foo","bar","baz"]);

for(;bar;) console.log(bar.next())://baz, bar, foo, undefined

I welcome this, the ES5+ spec welcome this!

But not this:

function* foo(x){
While(x){
yield x.pop();
}
}

var bar = Foo(["foo","bar","baz"]);

for(;bar;) console.log(bar.next())://{value: baz, done:false}{value: bar, done:false}{value: foo, done:false}{value: undefined, done:false} the done property will never be true consider that the while loop will not continue after coming across a false condition. And or the yield sign consider the pop() method being active on an undefined array.

Returning an object that will need to be parse.


Rick Waldron

unread,
Sep 15, 2014, 9:41:42 PM9/15/14
to nod...@googlegroups.com


On Monday, September 15, 2014, Ep Ga <epg...@gmail.com> wrote:
Rick Waldron

I'm speaking of this:

function foo(x){
    While(x){
        yield x.pop();
    }
}

This is not valid in ES6, you cannot have a yield inside a plain function. (There is also a typo: "While")


 

var bar = Foo(["foo","bar","baz"]); 

for(;bar;) console.log(bar.next())://baz, bar, foo, undefined

I welcome this, the ES5+ spec welcome this!

But not this:

function* foo(x){
    While(x){
        yield x.pop();
    }
}

var bar = Foo(["foo","bar","baz"]);

for(;bar;) console.log(bar.next())://{value: baz, done:false}{value: bar, done:false}{value: foo, done:false}{value: undefined, done:false} the done property will never be true consider that the while loop will not continue after coming across a false condition. And or the yield sign consider the pop() method being active on an undefined array.

Returning an object that will need to be parse.

Just because you're mis-understanding how generator logic works and you're writing intentionally wrong examples doesn't mean the feature is broken or incorrect. If you had actually bothered to write the examples above correctly, with the correct for-of usage, you'd see it works just fine: 

function* gen(x){
  // Don't intentionally check a value that will always be true,
  // that's not new or special to generators.
  while(x.length) {
    yield x.pop();
  }
}

for (var item of gen(["foo","bar","baz"])) {
  console.log(item);
}

"baz"
"bar"
"foo"



Rick

 

Ep Ga

unread,
Sep 16, 2014, 5:17:20 PM9/16/14
to nod...@googlegroups.com
Rick, copy and paste in Firefox--the ones who are most involve in the spec direction--:

function r(){
var i = 0, a = [0,9,8,7,6,5,4,3,2,1];
return (function (){return a.pop();});
}

var rr = r();

function y(){
let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
while(a){
yield (a.pop());
}
}

let yy = y();

function* g(){
let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
while(a){
yield (a.pop());
}
}

let gg = g();

console.log("return: " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + "\n" +
"yield: " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + "\n" +
"function*: " + JSON.stringify([gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next()]));

/*
return: 1 2 3 4 5 6 7 8 9 0 undefined
yield: 1 2 3 4 5 6 7 8 9 0 undefined
function*: [{"value":1,"done":false},{"value":2,"done":false},{"value":3,"done":false},{"value":4,"done":false},{"value":5,"done":false},{"value":6,"done":false},{"value":7,"done":false},{"value":8,"done":false},{"value":9,"done":false},{"value":0,"done":false},{"done":false}]
*/

Rick Waldron

unread,
Sep 17, 2014, 1:14:10 AM9/17/14
to nod...@googlegroups.com


On Tuesday, September 16, 2014, Ep Ga <epg...@gmail.com> wrote:
Rick, copy and paste in Firefox--the ones who are most involve in the spec direction--:

function r(){
     var i = 0, a = [0,9,8,7,6,5,4,3,2,1];
     return (function (){return a.pop();});
 }

var rr = r();

function y(){
     let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
     while(a){
         yield (a.pop());
     }
}


Firefox implemented `yield` in normal functions during ES4 prototyping era. It's non-standard, it's wrong and it's not part of ES6. I'm losing patience for this discussion.

 
let yy = y();

function* g(){
     let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
     while(a){
         yield (a.pop());
     }
}

Why would you _ever_ do this? `a` will always evaluate truthy. Writing an intentionally broken program is not a valid argument against anything. 


let gg = g();

console.log("return: " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr()  + "\n" +
      "yield: " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + "\n" +
      "function*: " + JSON.stringify([gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next()]));

/*
return: 1 2 3 4 5 6 7 8 9 0 undefined
yield: 1 2 3 4 5 6 7 8 9 0 undefined
function*: [{"value":1,"done":false},{"value":2,"done":false},{"value":3,"done":false},{"value":4,"done":false},{"value":5,"done":false},{"value":6,"done":false},{"value":7,"done":false},{"value":8,"done":false},{"value":9,"done":false},{"value":0,"done":false},{"done":false}]
*/


Clearly you don't understand the history of iterator and generator design, but read this and please move on: https://github.com/rwaldron/tc39-notes/blob/master/es6/2013-03/mar-12.md

(Look for StopIteration)

Rick
 

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages