18 ms·
ECMAScript 2017 Language Specification
- pi-rat 9y agoReally hate the naming for JS standards.. ES2017, ES8, ECMA-262. Way to confuse people :/
- wwwigham 9y agoES2017 is the conventional name now that there's annual publications of the spec. ES8 is someone reading the edition number on the document and trying to be terse. ECMA-262 is the formal name of the spec document, not the language the spec defines. All slightly different things, only one of which names the language itself, officially.
- jl6 9y agoWhich one is it that names the language officially?
- JeremyBanks 9y agoECMAScript 2017, that's the name given by the speciation document, which is itself known officially as ECMA-262 edition 8.
- PrunJuice 9y agoSo which name is the correct one?
- komali2 9y agoEcmascript 2017.
- deleted 9y ago[deleted]
- gregmac 9y agoIs calling it "Javascript" even still correct, or should it be called "ECMAScript"? If someone says they write "Javascript using ES2017" are they talking utter nonsense? I can find some references to "Javascript" being an implementation of ECMAScript, but doesn't appear to true [1]. Mozilla's implementation is SpiderMonkey, Google's is V8, and Microsoft has Chakra and JScript. [1] https://en.wikipedia.org/wiki/ECMAScript#Implementations https://en.wikipedia.org/wiki/ECMAScript#Implementations
- wamatt 9y agoSort of related: JS is officially written as "JavaScript" (yeah, ikr) and surprisingly the trademark is owned by Oracle.
- cerved 9y agoThis goes back to the Netscape / SUN partnership. SUN allowed Netscape to use their trademarked name Java when they created JavaScript. Microsoft created JScript. When they decided to standardize the language into a spec, they did so with ECMA. The involved parties couldn't agree on a name so they settled on the highly original name ECMAScript as a compromise. "Eich commented that "ECMAScript was always an unwanted trade name that sounds like a skin disease.""
- gsnedders 9y agoHistory time! Netscape created a language which they called LiveScript when it first shipped in a beta build, largely influenced by Java. By the time of Netscape Navigator 2.0 beta 3, they had negotiated a license for the Java name from Sun and renamed the language JavaScript (and, as wamatt pointed out, Sun owned the JavaScript trademark, now owned by Oracle following the Sun acquisition). IE3 shipped a reverse-engineered copy of JavaScript, which they called JScript because they didn't have a license to the JavaScript trademark. Later in the same year that Netscape Navigator 2.0 and IE3 shipped, Netscape submitted a specification of their JavaScript language to Ecma. What followed, as far as I'm aware, was a bit of a debate about naming: JavaScript was basically out of the question due to it being a Sun trademark, JScript was a MS term that Netscape didn't want to legitimise, and hence the compromise was ECMAScript (why this uses the pre-1994 capitalisation of Ecma is a good question!). So, essentially, JavaScript, JScript, and ECMAScript are three names for the same language. This then gets a bit complicated as Netscape and then Mozilla referred to ECMAScript revisions as JavaScript versions, and then started adding non-standard extensions as new JavaScript versions, though they've basically killed that now.
- BurningFrog 9y agoThink of it as JS 8 came out in 2017 and is defined in a document with an irrelevant ID.
- ScottBurson 9y ago"The versions of Unix are numbered in a logical sequence: 5, 6, 6PWB, 7, 4.1, III, 4.3, V, and V.3." -- quoted from memory from The Unix-Haters Handbook So you see, they're following long-standing industry practice :-)
- bartread 9y agoThe .NET and .NET Core version numbers are another minefield, and I still can't remember (and don't really care) what's what. Your choices are either to laugh or be filled with rage. I'm coming round to the first one having mostly opted for the second in recent months.
- int_19h 9y agoWhat's particularly weird about .NET version numbers? They're monotonically increasing, with the exception of .NET Core getting a reset to 1.0 (which kinda makes sense, since it's a different and incompatible product).
- tmzt 9y agoFramework 1.4 > 4.7 > 4.6.1?
- reitanqild 9y agoJust copying another idea from Java I'd guess: Java 1.4 -> Java 5. (Yes, I'm a Java programmer)
- int_19h 9y ago1.4 is not really "greater than" 4.7, they're just two different parallel tracks.
- ltowel 9y ago.Net Framework, .Net Core and .Net Standard all have different version numbers, which correspond to different things. In addition, since Core and Standard are both in the 1.Xs currently, it can be confusing. Finally, the .Net Core SDK is versioned differently from the run time, both somewhere in the low 1.Xs right now. ``` >dotnet Microsoft .NET Core Shared Framework Host Version : 1.1.0 Build : 928f77c4bc3f49d892459992fb6e1d5542cb5e86 ``` ``` >dotnet --version 1.0.0-preview2-1-003177 ``` The version numbers aren't necessarily weird, but the versioning sure is. Disclaimer: MS Employee who uses Dotnet, but doesn't work on it.
- amelius 9y ago> Way to confuse people :/ JavaScript, that's a scriptable version of Java, right? /sarcasm
- Swizec 9y agoTime to update https://es6cheatsheet.com https://es6cheatsheet.com What's the feature you're most excited about?
- TheCoreh 9y agoDefinitely async functions. JavaScript code will be _so much cleaner_ thanks to them. Can't wait for the much needed improvement in readability.
- iso-8859-1 9y agoYou don't have to wait, it is already supported server-side and client-side.
- tehlike 9y agoasync/await +1 has been possible with babel on older versions of the JS, but nice to have it after all officially.
- flavio81 9y agoAsync/await has been implemented in node.js for a long time, in fact I consider that not using it at the server side is almost criminal...
- vdnkh 9y agoAtomics & shared memory. We use a ton of array buffers along with web workers to transmux HLS video in the browser (https://github.com/video-dev/hls.js https://github.com/video-dev/hls.js). Being able to share memory across the worker instance will hopefully save a lot of memory/time.
- 52-6F-62 9y agoOff topic: I've been using with hls.js at work recently for some stream debugging. Great stuff!
- 9y ago
- speg 9y agoIs there a "What's new" section?
- samerbuna 9y agoThe "finished" proposals have a good list: https://github.com/tc39/proposals/blob/master/finished-proposals.md https://github.com/tc39/proposals/blob/master/finished-propo...
- 43224gg252 9y agoCan anyone recommend a good book or guide for someone who knows pre-ES6 javascript but wants to learn all the latest ES6+ features in depth?
- elevenE 9y agoI found the You Don't Know JS series books by Kyle Simpson very helpful. The last one is for ES6. https://github.com/getify/You-Dont-Know-JS https://github.com/getify/You-Dont-Know-JS
- samerbuna 9y agoexploringjs.com
- WorldMaker 9y agoI like Dr. Rauschmayer's blog, as well: http://2ality.com/ http://2ality.com/ His blog is full of useful and specific deep dives into individual ES proposals as they reach certain stages.
- johnsonjo 9y agoDr. Rauschmayer also has several books free to read online available here http://exploringjs.com/ http://exploringjs.com/. I definitely recommend his books they are often quite thorough.
- johnsonjo 9y agoThere's also Nicholas C. Zakas' book understanding es6. It's free to read online too. https://leanpub.com/understandinges6/ https://leanpub.com/understandinges6/ I haven't read this one but I started one of his other books that was a very large book of JavaScript showing warts and all. I would definitely support these authors though by buying the books if you have the money to do it.
- stevula 9y agoI found it helpful to go through the airbnb style guide. They have lots of examples of the "bad" (often old) way to write something, along with the "good" (often new) way. Then I updated one of my projects to follow those guidelines.
- HugoDaniel 9y agoI would really love to see an object map function. I know it is easy to implement, but since they seem to be gaining ranks through syntax sugar, why not just have a obj.map( (prop, value) => ... ) ? :)
- thomasfoster96 9y agoIs Object.entries(obj).map((prop, value) => ...) close enough? Object.entries is newly standard in ES8.
- HugoDaniel 9y agoNot really object map. Does not return a new object ;)
- thomasfoster96 9y agoAh, well this would return a new object: Object.entries(obj).map((prop, value) => ...).reduce((newOdj, [prop, value]) => newObj[prop] = value); I see your point about verbosity :)
- nathancahill 9y agoYour linter will also complain about modifying newObj within the reducer.
- lukasm 9y agoWhat is up with decorators?
- thangngoc89 9y agoIt's now at stage-2
- thomasfoster96 9y agoProposals [0] that made it into ES8 (“what’s new”): * Object.values/Object.entries - https://github.com/tc39/proposal-object-values-entries https://github.com/tc39/proposal-object-values-entries * String padding - https://github.com/tc39/proposal-string-pad-start-end https://github.com/tc39/proposal-string-pad-start-end * Object.getOwnPropertyDescriptors - https://github.com/ljharb/proposal-object-getownpropertydescriptors https://github.com/ljharb/proposal-object-getownpropertydesc... * Trailing commas - https://github.com/tc39/proposal-trailing-function-commas https://github.com/tc39/proposal-trailing-function-commas * Async functions - https://github.com/tc39/ecmascript-asyncawait https://github.com/tc39/ecmascript-asyncawait * Shared memory and atomics - https://github.com/tc39/ecmascript_sharedmem https://github.com/tc39/ecmascript_sharedmem The first five have been available via Babel and/or polyfills for ~18 months or so, so they’ve been used for a while now. [0] https://github.com/tc39/proposals/blob/master/finished-proposals.md https://github.com/tc39/proposals/blob/master/finished-propo...
- yahelc 9y agoInteresting that String padding made it in -- sort of jumps out as the simplest of these additions. I wonder how much of that had to do with negative PR for JS-land due to left-pad-gate.
- DelaneyM 9y agoYou can read that disaster in two ways... I consider the fact that a stupid-simple package was depended-upon by so many mature libraries as an indication it should be a language feature. Working with network protocols I find myself needing padding functions all the time, and there isn't really an elegant way to do so inline, so I welcome this addition.
- andersonk 9y agoHonestly, I feel most of the blame falls to NPM for allowing publishers to delete packages. This doesn't happen in other ecosystems (e.g. Java).
- drinchev 9y agoFor anyone wondering what's NodeJS support of ES8. Everything is supported, except "Shared memory and atomics" [1] http://node.green http://node.green
- kovek 9y agoShared memory? Is that also maybe going to be implemented on chrome? I would not have expected shared with code running on the web/in a browser. I'm confused about the goals of ECMA and how ECMA relates to JavaScript.
- andrewaylett 9y agoThat's memory shared between the main thread and Web Worker threads. While it's exciting from an "easily implementing multi-threaded applications" point of view, given the nature of the objects, it doesn't actually allow sharing any data that couldn't be shared without the new spec.
- cies 9y agoNice 90s style website ECMA!
- kronos29296 9y agoIts funny that ECMA website is not more modern. Maybe they are too busy with the spec to change it. Who knows?
- komali2 9y agoIt's a site read by a bunch of programmers. Why does it need to be pretty? We can read lightly styled text quite easily. It's how most engineers I know prefer their technical documentation.
- imhelpingu 9y agoI'm not clear on if it's dated and ugly or just way too future for me.
- pgl 9y agoHere’s what’s in it: https://github.com/tc39/proposals/blob/master/finished-proposals.md https://github.com/tc39/proposals/blob/master/finished-propo... And some interesting tweets by Kent C. Dodds: https://twitter.com/kentcdodds/status/880121426824630273 https://twitter.com/kentcdodds/status/880121426824630273 Edit: fixed KCD's name. Edit #2: No, really.
- callumlocke 9y agoThis is mostly symbolic. The annual ECMAScript 'editions' aren't very significant now except as a talking point. What matters is the ongoing standardisation process. New JS features are proposed, then graduate through four stages. Once at stage four, they are "done" and guaranteed to be in the next annual ES edition write-up. Engines can confidently implement features as soon as they hit stage 4, which can happen at any time of year. For example, async functions just missed the ES2016 boat. They reached stage 4 last July [1]. So they're officially part of ES2017 – but they've been "done" for almost a year, and landed in Chrome and Node stable quite a while ago. [1] https://ecmascript-daily.github.io/2016/07/29/move-async-functions-to-stage-4-per-july-2016-tc39-meeting-tc39-proposals-e8c0354 https://ecmascript-daily.github.io/2016/07/29/move-async-fun...
- k__ 9y agoAs far as I understood it: ECMAScript is more a thing for backwards compatibly. Things get proposed and HAVE to be implemented in runtimes before they get into ECMAScript. They want to know if things can be implemented nicely before they standardize them. This is more a game between ECMA and Browser vendors, JS compilers (like Babel) and vendors of other JS runtimes like Node.js. If you are an enduser, i.e. a user of Babel, it's more a question of the support you get from the Babel devs. They say JSX is on? No matter what ECMA says, as long as Babel gets this compiled into ECMAScript conforming JS.
- rictic 9y agoI think it does matter to end user developers though. Once something is in the standard, you can rely on it. It won't change in a backwards-incompatible way. That means that you're not imposing an unusual configuration on downstream users, and depending on the environments you support, at some point you won't even need to run Babel at all. With IE11 approaching end of life, and more and more sites dropping support for it, we're rapidly approaching a time when we can assume the vast majority of users are on a modern, evergreen browser. And the last version of node that didn't have full ES6 support just went out of long term support.
- 9y ago
- jadbox 9y agoI wish this-binding sugar would get promoted into stage 1.
- empyrical 9y agoThe :: syntax is one of my favorite proposals - does anyone know what's holding it up?
- gregjw 9y agoI should really learn ES6
- ashnehete 9y agoLiterally after seeing this on #1 felt like, "Wtf? I just started learning ES6"
- Andrex 9y agoThe additions in ES2016 and 2017 are minimal compared to the massive changes ES2015 (aka "ES6") introduced. Check the full list of them here: https://github.com/tc39/proposals/blob/master/finished-proposals.md https://github.com/tc39/proposals/blob/master/finished-propo...
- ashnehete 9y agoYes, I have been through the proposals. Love these new changes. Psychologically it still felt daunting when I first saw it! :P
- rpedela 9y agoHas there been any progress on supporting 64-bit integers?
- giaour 9y agoThe BigInt proposal[0] is stage 2, meaning we should see some implementations soon. [0]: https://github.com/tc39/proposal-bigint https://github.com/tc39/proposal-bigint
- elmigranto 9y agoHeck, what about any kind of integers, so we can use bitwise operations without `double -> int -> double` casts?
- ihsw2 9y agoNotably, with shared memory and atomics, pthreads support is on the horizon. https://kripken.github.io/emscripten-site/docs/porting/pthreads.html#running-code-and-tests https://kripken.github.io/emscripten-site/docs/porting/pthre... Granted it may be limited to consumption via Emscripten, it is nevertheless now within the realm of possibility. For this that cannot grok the gravity of this -- proper concurrent/parallel execution just got a lot closer for those targeting the browser.
- slackingoff2017 9y agoShhhh node people still pretend threads don't exist
- always_good 9y agoNot sure that anybody is "pretending" anything. Seems like you're just going out on a limb to be condescending.
- MuffinFlavored 9y agoI hope those kinds of comments do not start making their way towards HN. Reddit is getting so bad lately, an influx is probably due.
- olingern 9y agoHmm... can't tell if this is an attempted Node slam, but figured I would add that you can mimic threads / concurrent tasks by utilizing the child_process or cluster modules.
- ihsw2 9y agoAs a matter of fact, it certainly makes things a fair bit more pleasant than the current state of affairs as they -- shared array buffers -- are another data primitive on top of bidirectionally passing strings/buffers.
- judah 9y ago
- ascom 9y agoLooks like ECMA's site is overloaded. Here's a Wayback Machine link for the lazy: https://web.archive.org/web/20170711055957/https://www.ecma-international.org/publications/standards/Ecma-262.htm https://web.archive.org/web/20170711055957/https://www.ecma-...
- danielsamuels 9y agoIf you're using Chrome, you can also go to cache://www.ecma-international.org/publications/standards/Ecma-262.htm (replacing https:// https:// with cache://)
- empyrical 9y agoThat's just doing a google search, so you could do "cache:{URL}" in firefox's search field too
- emehrkay 9y agoI'd like to be able to capture object modifications like Python's magic __getattr__ __setattr__ __delattr__ and calling methods that do not exist on objects. In the meantime I am writing a get, set, delete method on my object and using those instead
- tkone 9y agoThis is what Proxy[1] is for. [1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- emehrkay 9y agoI've used Proxy in the past. It doesn't allow for the capture of both `object.attr_does_not_exist` and `object.methodDoesNotExist()` simultaneously, it is one or the other. I will admit that I am trying to use another lang's paradigms in JS, but only because it is so similar and it makes sense to me. But I may be able to use Proxy just to capture object changes. I will try it out
- houli 9y agoCould you have your "get" handler do its thing and have it forward on the arguments it received to the "apply" handler if necessary with an extra flag argument and vice versa?
- ngz00 9y agoCheck this out: https://gist.github.com/torgeir/e528337e7a9a41c96ac9 https://gist.github.com/torgeir/e528337e7a9a41c96ac9
- z3t4 9y agotheres defineproperty in es5. ive used it to create a orm where foo.bar = 1 executes async sql: update foo set x=1
- 9y ago
- espadrine 9y agoI made a short sum-up of changes in this specification here: http://espadrine.github.io/New-In-A-Spec/es2017/ http://espadrine.github.io/New-In-A-Spec/es2017/
- baron816 9y agoRegardless of what gets included in the spec, I hope people think critically about what to use and what not to use before they jump in. Just because something is shiny and new in JS, it doesn't mean you have to use it or that it's some sort of "best practice."
- flavio81 9y agoWhat I wish ECMAScript had was true support for number types other than the default 32-bit float. I can use 32 and 64 bit integers using "asm.js", but this introduces other complications of its own -- basically, having to program in a much lower level language. It would be nice if EcmaScript could give us a middle ground -- ability to use 32/64 bit integers without having to go all the way down to asm.js or wasm.
- arthurdenture 9y agoThere's a BigInt proposal at stage 2, which might meet some of your needs: https://github.com/tc39/proposal-bigint https://github.com/tc39/proposal-bigint
- hzoo 9y agoIt's parseable in Babel 7, issue to implement the transform is https://github.com/babel/proposals/issues/2 https://github.com/babel/proposals/issues/2
- buu700 9y agoTangential to your point, but JS numbers are actually 64-bit floats (capable of safely representing 53-bit ints), not 32-bit. But yes, 100% agreed; this is a major pain point of the language right now. Nice to hear that there's finally some movement on fixing it (as per arthurdenture's comment)!
- deleted 9y ago[deleted]
- bitL 9y agoHeh, maybe JS becomes finally usable just before WebAssembly takes off, rendering it obsolete :-D
- drew-y 9y agoJS won't be entirely obsolete. You won't be able to access the DOM from WebAssembly. It will be way easier to make way more performant web apps though.
- goatlover 9y agoDOM access is coming to WebAssembly after GC is supported. https://github.com/WebAssembly/design/blob/master/Web.md https://github.com/WebAssembly/design/blob/master/Web.md
- AprilArcus 9y agooh, is that all!
- komali2 9y agoWherein a Hackernews suggests an unknown, unpopular technology will replace a known, popular one in short order.
- bitL 9y agoCome on, many people are looking down at JavaScript for a reason - if the new standard allows proper multithreading, it suddenly gets closer to "usable" language as defined by many. But if they had a choice of another language running on top of Web Assembly (or whatever you name the web's VM), I am not sure they would even consider learning JS despite it being finally on par with their favorite language.
- j0e1 9y ago> Kindly note that the normative copy is the HTML version; Am I the only one who finds this ironic..
- mrec 9y agoWhat's ironic about it?
- komali2 9y ago>AWB: Alternatively we could add this to a standard Dict module. >BT: Assuming we get standard modules? >AWB: We'll get them. lol
- idibidiart 9y agoWait, so async generators and web streams are 2018 or 2016?
- wilgertvelinga 9y agoReally interesting how bad the only JavaScript code used on their own site is: https://www.ecma-international.org/js/loadImg.js https://www.ecma-international.org/js/loadImg.js
- pcbeef 9y agoDo what I say, not what I do.
- skeletonjelly 9y agoI've seen worse.
- andrewalan 9y agoI am Andrew Alan a hacker who has built a very good reputation and undeniably one of the best hackers you can come across.i have got access to hack into any account and also get to generate passwords for accounts like Facebook,Instagram,Twitter,gmail,yahoo mail,whats-app,we-chat,etc..I also have logins for bank like BOA,welsfargo,chase,credit union,capital one, and many other different banks for transfers and credit card top ups,Retrieving hacked social media accounts,clearing criminal records,increase credit scores,CC hack,hacking computer systems,Website hack,Catch hacker scammers,Phishing emails, that's to mention a few.You can contact me on. ICQ ..........711574456 Email ....andrewalanhacksgmailcom Text +13238351741
- pier25 9y agoIn the last couple of years we've seen a small number of significant improvements like async/await but mostly small tepid improvements like string padding, array.map(), etc. It's like TC39 are simply polishing JS. I'd like to see TC39 tackling the big problems of JS like the lack of static type checking. I'm tired of looking at a method and having to figure out if it is expecting a string, or an object. We had EcmaScript4 about 10 years ago with plenty of great features but TC39 killed it. And yeah, it probably made sense since the browser vendor landscape was very different back then. Today it would be possible to implement significant changes to the language much like the WebAssembly initiative.
- shinypotatoe 9y agoCheckout TypeScript. It's great.
- pier25 9y agoI know, but it's not JavaScript.
- Veen 9y agoFor the most part it is JavaScript. JavaScript is valid Typescript, because Typescript is a superset. Typescript just gets you type annotations and "future" JavaScript features, none of which you're forced to use.
- roboguy12 9y agoAnd, when you compile it to JavaScript, you can choose the target language level. So, you could write Typescript and have it compile such that in essence, all it does is strip out the type annotations.
- pier25 9y agoYes I know, but again, it's not JavaScript and there will always be headaches here and there. For example: https://vuejs.org/v2/guide/typescript.html https://vuejs.org/v2/guide/typescript.html
- correctsir 9y agoI've been looking at the stage 2 and 3 proposals. I have a difficult time finding use for any of them except for Object spread/rest. The stage 4 template string proposal allowing invalid \u and \x sequences seems like a really bad idea to me that would inadvertently introduce programmer errors. I do hope the ECMAScript standardization folks will raise the barrier to entry for many of these questionable new features that create a maintenance burden for browsers and ES tooling and a cognitive burden on programmers. It was possible to understand 100% of ES5. I can't say the same thing for its successors. I think there should be a freeze on new features until all the browser vendors fully implement ES6 import and export.