Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is it just me or does the proposed ES6-standard smell of heavy feature creep?

- we get classes _and_ modules _and_ typed objects. Yeah, those all have their merits and are all somehow different, but having them all seems to add only slightly more value while increasing the overall difficulty of the language considerably.

- same with macros and codegens. While they certainly are different animals, there seems to be overlap in the area they will be employed.

To me, there seems to be feature envy on the side of the JS crowd to try and bake every nice feature into the language. I am not convinced this is the right direction.



we get classes _and_ modules _and_ typed objects

There aren't "typed objects". There is a new library for working with binary data efficiently.

Classes and modules serve different purposes. Classes provide syntactic sugar for prototypal inheritance. Modules provide a baked-in mechanism for encapsulating and sharing code.

same with macros and codegens

Neither of these are on tap for ES6. Brendan showed them as interesting experiments that may be proposed for a future release.


Quite right about macros, but codegen is happening now, all over the place.


> Is it just me or does the proposed ES6-standard smell of heavy feature creep?

I've been on TC39 for years and the vast majority of what we do is cut.

> we get classes _and_ modules _and_ typed objects.

Classes are syntactic sugar for one of the most common dynamic patterns in JavaScript: object factories. Modules are static collections of code. Very different things, especially in a dynamic language like JS. Typed objects are not even remotely related; they're a low-level API for efficiently working with structured binary data.

> same with macros and codegens.

As Yehuda says, macros are not part of ES6 but rather an experiment at http://sweetjs.org to consider for future editions. I don't know what you mean by "codegens." Brendan's slides weren't talking about a feature, but rather an existing usage pattern that we need to serve in additional to human code-writers.

ES6 actually does a remarkable job covering many use cases with small modifications that smoothly integrate with the existing language. You might want to try experimenting with some of these features, many of which are implemented partly or completely in SpiderMonkey (as Brendan's latest blog post details). Most of the features are small improvements to paper cuts, and as everyone I've ever spoken to who's written SpiderMonkey-specific JavaScript attests (for example, in the Firefox front-end or in addons), they make your life so much nicer. I'm particularly thinking of let and destructuring, and I suspect parameter defaults and rest-arguments will be hugely popular as well. The few bigger features, especially modules and generators, are for addressing the most important gaps in JS.

Dave




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: