ECMAScript 2018 Language Specification
tc39.github.io
tc39.github.io
[1]: https://github.com/tc39/proposal-async-iteration [2]: https://github.com/tc39/agendas/blob/master/2017/11.md
Since Java blocks, you can implement a crawler as a custom iterator that makes API requests / paginates behind the scenes and thus abstracts away the fact that it's making a series of requests since the callsite just iterates over the values as it finds them.
Would be nice to have that sort of abstraction in Node.
Yep, that's what I had built when they were announced. I had an API that returned a page and "next" pointer but the iterator just returned next item (promise) and followed next links, for the API consumer it looked like a regular collection. Pretty nice!
> Would be nice to have that sort of abstraction in Node.
Unfortunately Node APIs will probably always lag behind because it's hard to rewrite everything using Promises...
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 communicate using atomic operations that ensure a well-defined execution order even on parallel CPUs. This specification also includes new static methods on Object: Object.values, Object.entries, and Object.getOwnPropertyDescriptors.
[0] http://2ality.com/2017/08/optional-catch-binding.html
[1] http://wiki.c2.com/?EmptyCatchClause
[2] https://github.com/tc39/proposal-optional-catch-binding/issu...
} catch (e if e instanceof CriticalError) {
// handle critical
} catch (e if e instanceof TypeError) {
// handle type mismatch
} catch () {
}
so you could at least handle critical and other errors before blindly silencing - but for some reason exception filtering/conditional catch hasn't come up in ECMALooking 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?
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] http://2ality.com/2016/09/template-literal-revision.html
`${'`'}Look, this is a backtick: \${'${'`'}'}${'`'}`
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.
`foo \u0060bar\u0060`
https://github.com/tc39/proposal-bigint
It's the feature I'd most like to see added.
You can help out by contributing testing etc. in babel[0] or typescript
Don't assume that the current snapshot is feature complete.
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 communicate using atomic operations
that ensure a well-defined execution order even on parallel
CPUs. This specification also includes new static methods on
Object: Object.values, Object.entries, and
Object.getOwnPropertyDescriptors.Where decorators are sugar for higher order functions, even capable of `Class -> Class` transformation, which makes them much different from Java annotations.
ECMAScript is an object-oriented programming language for ...
heavy sigh
Prototype-based is a form of OOP: https://en.wikipedia.org/wiki/Prototype-based_programming
And "functional programming language" would be way too fine a point, like calling Ruby an FP language.