Live data from Hacker News

V8 Release 5.1

v8project.blogspot.com

51–60 of 62 posts

Re: V8 Release 5.1

#51
post #6

In case anyone is wondering, NodeJS v6 is right around the corner with V8 5.x. Node is going to get a serious boost of ES2015 features. Including but not limited to: Proper tail recursion (^_^) and destructuring. Tracked at http://node.green We don't have an ES2015 features page up to date yet, but it's going to be ready any day now (and we're going to link to node.green anyway most likely).

To be precise, Node.js 6.x will include V8 5.0. There has been a little discussion on being able to include V8 5.1 down the road, maybe, but there is nothing concrete on it at this point. Also, the fate for tail-call-elimination is pretty uncertain at the moment; see: https://github.com/tc39/proposal-ptc-syntax

Oh hi, fancy seeing you here :]

Note that ptc syntax _ensures_ tail calls, tail calls themselves have _already_ been approved in ES2015 and are live in V8 (under a flag), you can follow their status here: https://bugs.chromium.org/p/v8/issues/detail?id=4698

Re: V8 Release 5.1

#52

Does this have any implications for npm addon authors?

I'll assume that by "npm addon" you're simply referring to plain old npm packages (native or js). (If not, ignore my comment.)

As far as I know there are currently no big API changes happening in v8, plus the abstraction layer for native node packages (nan, Native Abstracts for Node.js) has been, afaik, quite excellent at shielding native package developers from a lot of potential API breakage -- so generally it can be expected that there will be either no or very minor implications for native packages -- and no implications at all for non-native packages since those work purely with the node API which is not tied to the v8 API.

We'll know more once the v8 project's API changes doc will be updated with 5.1 info, and node core has created its vee-eight-5.1 branch.

EDIT: added clarification about non-native packages; clarity

Re: V8 Release 5.1

#53
post #41

Did they run speed benchmarks against older versions of V8? I'm wondering about the performance cost of these new features (hopefully zero).

Unfortunately it is much larger than zero see https://groups.google.com/d/msg/strengthen-js/ojj3TDxbHpQ/T6....

It is very sad that people working on es spec do not care enough about performance

Re: V8 Release 5.1

#54
post #49

Earlier quoted context omitted.

What really pisses me off are the posts about Coffeescript being supplanted by ES6 like it's a complete substitute. Array comprehensions are just one example of what JS folks are still missing out on.

List comprehensions are incredible. But they're just syntactic sugar for map() and filter() and lambdas. Python's prev = [1,2,3,4] next = [x * 2 for x in old] Is the same as javascript's prev = [1,2,3,4]; next = prev.map(x => x * 2); Python's next = [x for x in prev if x % 2 == 0] is the same as javascript's next = prev.filter(x => x % 2 === 0); And finally, python's next = [x * 2 for x in prev if x % 2 == 0] is the…

I think it's important to remember that Array::map() and Array::filter() construct new Arrays (even if the old one is quickly "lost" and collected). It's probable v8 sees this and does some trickery to make use of the existing allocated Array, but I doubt it.

let next = [ 1, 2, 3, 4 ].map(x => x * 2);

versus:

next = (x * 2 for x in [ 1 .. 4 ])

...which becomes:

// Generated by CoffeeScript 1.10.0

(function() { var next, x;

  next = (function() {
    var i, results;
    results = [];
    for (x = i = 1; i 
}).call(this);

Array::map()/filter() get points for encouraging immutable transformations.

Re: V8 Release 5.1

#55
post #47

Earlier quoted context omitted.

I was about to saw the same thing. That phrase must be so confusing for maga if he always pictures an interior corner instead of an exterior one.

I'm sorry my humble attempt at wordplay mixing the corners bothers you, guys. You are right though, corners are not my forté: failed descriptive geometry back in engineering school.

Don't worry about it! I'm sure that from now on you'll avoid falling into this particular corner case of wordplay...

Re: V8 Release 5.1

#56
post #6

In case anyone is wondering, NodeJS v6 is right around the corner with V8 5.x. Node is going to get a serious boost of ES2015 features. Including but not limited to: Proper tail recursion (^_^) and destructuring. Tracked at http://node.green We don't have an ES2015 features page up to date yet, but it's going to be ready any day now (and we're going to link to node.green anyway most likely).

cool!

Re: V8 Release 5.1

#57
post #49

Earlier quoted context omitted.

List comprehensions are incredible. But they're just syntactic sugar for map() and filter() and lambdas. Python's prev = [1,2,3,4] next = [x * 2 for x in old] Is the same as javascript's prev = [1,2,3,4]; next = prev.map(x => x * 2); Python's next = [x for x in prev if x % 2 == 0] is the same as javascript's next = prev.filter(x => x % 2 === 0); And finally, python's next = [x * 2 for x in prev if x % 2 == 0] is the…

I think it's important to remember that Array::map() and Array::filter() construct new Arrays (even if the old one is quickly "lost" and collected). It's probable v8 sees this and does some trickery to make use of the existing allocated Array, but I doubt it. let next = [ 1, 2, 3, 4 ].map(x => x * 2); versus: next = (x * 2 for x in [ 1 .. 4 ]) ...which becomes: // Generated by CoffeeScript 1.10.0 (function() { var ne…

This could probably be solved if Javascript had map/filter/reduce functions for iterators (and hopefully dictionaries) as well as arrays.

And of course a range(start,stop,step) iterator similar to python's range.

it would then be a matter of:

  next = range(1,40000).map(x => x * 2);
and because range would be an iterator, the only array created would be next.

Re: V8 Release 5.1

#58
post #49

Earlier quoted context omitted.

What really pisses me off are the posts about Coffeescript being supplanted by ES6 like it's a complete substitute. Array comprehensions are just one example of what JS folks are still missing out on.

List comprehensions are incredible. But they're just syntactic sugar for map() and filter() and lambdas. Python's prev = [1,2,3,4] next = [x * 2 for x in old] Is the same as javascript's prev = [1,2,3,4]; next = prev.map(x => x * 2); Python's next = [x for x in prev if x % 2 == 0] is the same as javascript's next = prev.filter(x => x % 2 === 0); And finally, python's next = [x * 2 for x in prev if x % 2 == 0] is the…

Everyone seems to forget nested comprehensions

  [x + y for x in [1,4,9] for y in [2,4,6] if x 

Re: V8 Release 5.1

#59
post #38

What's the latest word on native ES2015 module support (i.e. the import keyword) in V8 or Node.js? Every ES2015 comparison table I know omits it, but it's the big one that could significantly reduce the modern JS toolchain complexity.

ES2015 modules do not take HTML/host environment into consideration. There is still some spec work missing there.

See https://groups.google.com/a/chromium.org/forum/#!searchin/bl... for more information.

Re: V8 Release 5.1

#60
post #6

In case anyone is wondering, NodeJS v6 is right around the corner with V8 5.x. Node is going to get a serious boost of ES2015 features. Including but not limited to: Proper tail recursion (^_^) and destructuring. Tracked at http://node.green We don't have an ES2015 features page up to date yet, but it's going to be ready any day now (and we're going to link to node.green anyway most likely).

ES2015 TCO is in 5.1 but hidden behind a flag. We are preferring the explicit approach championed by Mozilla and Microsoft (https://github.com/tc39/proposal-ptc-syntax) because it makes the debugging and error analysis story better.
Post reply on HN