Live data from Hacker News

ECMAScript 2018 Language Specification

tc39.github.io

21–30 of 49 posts

Re: ECMAScript 2018 Language Specification

#21
post #9

Earlier quoted context omitted.

Can't you just do `Look, this is a backtick: ${'`'}`? Or are you not counting that as "easy" because it's horrible.

Suppose I wanted to embed your solution itself into a template literal. It would look like this: `${'`'}Look, this is a backtick: \${'${'`'}'}${'`'}`

Rust has a nice solution to this.

    r"foo" == "foo" // r" means the literal ends at "
    r#""foo""# == "\"foo\"" // r#" means the literal ends at "#
    r##"r#""foo""#"## == "r#\"\"foo\"\"#" // r##" means the literal ends at "##
and so on.

Basically you add as many # outside as necessary to distinguish the end of the literal (double-quote followed by some #) from any such sequence in the middle of the literal.

Re: ECMAScript 2018 Language Specification

#23
post #9

Earlier quoted context omitted.

Can't you just do `Look, this is a backtick: ${'`'}`? Or are you not counting that as "easy" because it's horrible.

Suppose I wanted to embed your solution itself into a template literal. It would look like this: `${'`'}Look, this is a backtick: \${'${'`'}'}${'`'}`

Web components are the answer for creating composable templates.

Re: ECMAScript 2018 Language Specification

#24
post #5

Template Literal Revision [1] is a welcome change, but still falls way short, as there's still no way to easily include the backtick itself inside raw text. I wish ES would adopt python-style triple-quotes, so you could do things like: String.raw```Look, this is a backtick: "`"``` (The inability to do this is a pain point when you want to embed a language in ES and that language itself makes use of backticks.) [1] ht…

Encoding backtick as unicode escape is one easy enough and "clean" way:

`foo \u0060bar\u0060`

Re: ECMAScript 2018 Language Specification

#25
This page is confusing because it describes itself as ECMAScript 2018 but the features it lists are those I've associated with ECMAScript 2017.

Looking at the Github repo, you can see that they changed it from 2017 to 2018 on March 31st: https://github.com/tc39/ecma262/commit/8340bf9a8427ea81bb0d1...

So what happened to 2017?

Re: ECMAScript 2018 Language Specification

#27

According to [the repo]( https://github.com/tc39/proposals/blob/master/finished-propo... ) only one minor feature had reached stage 4 since last year. Not sure why this is on top HN.

A small update is just as important news as a large update. It's a signal about where Javascript stands as a language.

Re: ECMAScript 2018 Language Specification

#28
post #10

I wish the spec included a more bullet pointy changelog from the previous version, but at least it has this paragraph: This specification introduces Async Functions, Shared Memory, and Atomics along with smaller language and library enhancements, bug fixes, and editorial updates. Async functions improve the asynchronous programming experience by providing syntax for promise-returning functions. Shared Memory and Atom…

That’s ECMAScript 2017.

You're right, thanks for the correction. Very confusing language though, an oversight in editing perhaps?

Re: ECMAScript 2018 Language Specification

#29
post #3

Earlier quoted context omitted.

A few paragraphs down, you should find: This specification introduces Async Functions, Shared Memory, and Atomics along with smaller language and library enhancements, bug fixes, and editorial updates. Async functions improve the asynchronous programming experience by providing syntax for promise-returning functions. Shared Memory and Atomics introduce a new memory model that allows multi-agent programs to communicat…

Nope, that’s a copy-paste from last year’s spec: http://www.ecma-international.org/publications/files/ECMA-ST...

I will be writing the ES2018 intro prose around when we send ES2018 draft to ECMA for ratification (few months away yet).

Re: ECMAScript 2018 Language Specification

#30

I hoped decorators[1] would make it, but seems unlikely (looks like they're still at stage 2). [1] https://github.com/tc39/proposal-unified-class-features

Probably not ES2018, but 2019 is looking likelier now thanks in part to excellent work by Daniel Ehrenberg (@littledan).
Post reply on HN