MMS • RSS
Crockford notes that languages face a problem in that they potentially become too focused on “bad plastic surgery” additions instead of having a clear view of what is coming next.
Compared to a decade ago, I think less of the language is good, but I think the good part is better.
Eich spoke about the progression of how things change over the years, and how old becomes new again. For example, E4X never got accepted into the language, but React users love JSX, which is “E4X without the bad XML parts”.
Eich focused on some of the features he is most excited to see land in the language as early as next year:
- TC39 BigInt – New value type to handle arbitrary precision integers, with support for TypedArrays
- Dynamic import() – ES Module imports by default are static, and this also allows for prefetching
- Array.prototype.flat / flatMap – arbitrary flattening of an array, and the solution to flatten and smooshgate
- More destructuring – for arbitrary objects and arrays
- Private methods and accessors in Classes – per Eich, the # symbol prefix is a bit controversial and may not happen
- Async iteration – for await of syntax
- Several RegExp improvements
See the full list of TC39 proposals for information on these proposals and more.
Crockford spends his time questioning our deep assumptions and how they impact our progress. For example, should we start counting with zero or one, and explains why he believes everything should begin with zero.
Crockford notes that the biggest disappointment thus far with ES2015 implementations is the lack of proper tail calls or tail call optimization, with only Safari having implemented this portion of the specification thus far. According to Crockford, tail calls are the most important feature added to ES2015, as this feature helps support tail recursion, the functional alternative to iteration, as well as continuation passing.
Crockford believes that pure functions are the most critical thing in the language going forward and that anything that impacts pure functions should not get considered for the language.
Crockford explained his perspective on simplicity, “The Simpler the standard, the less there is to agree on, and the more likely is it to make interoperability possible.” He gave JSON as an example, explaining that JSON is a syntax; it says nothing about behavior, and it is simple to understand and use. The entire grammar of JSON fits on the back of a business card.
When asked about type systems such as TypeScript, Eich remarked that the convenience of dynamic programming is convenient, and a type system that doesn’t get in the way is a good idea. Eich notes that “People are used to type systems that don’t pay their way.”
TypeScript was brilliant as it’s a strict superset of JS. Every JS program is a TS program. Anders Hejlsberg is top notch.
Crockford was also asked about TypeScript, but has a much less favorable opinion: “It doesn’t solve problems that I have.” This dismissal of TypeScript was somewhat contradictory with his earlier statement that “interfaces between things are where errors typically happen”, as one of the main benefits of TypeScript is to help define interfaces to prevent these errors.
Eich got asked about possibly standardizing things like React. He noted how early libraries like Dojo and Prototype had concepts that made their way into later versions of the language, but that “We never just standardize a library like React.” Instead, efforts are made to lift the essential primitives out of the libraries into the core language. Eich noted that we could get into trouble by standardizing early, especially for tool time solutions like type systems.
Eich got asked for his opinion on the Observables proposal based on RxJS Observables. He notes that the specification has stalled and that it’s a challenge to get what should get built into the language, and he is not sure if Observables should get added to the language. He did not mention that the WHATWG specification for streams is a superset of Observables, and perhaps the competition between these two proposals may be blocking progress on the Observables proposal.
Finally, Eich was asked about machine learning, and noted that while deep learning is useful, it does not tell us anything about causality, and today’s efforts are just an advanced form of curve fitting algorithms.
The full videos of these conference talks are available with free registration: