1 of 10

What does 1JS mean

in a world of transpilers?

Brian Terlson

Daniel Ehrenberg

March 2018 TC39

2 of 10

Two visions of language evolution

3 of 10

Powerful and minimalistic

  • New features bring new fundamental capabilities
  • Refrain from creating redundant syntactic sugar
  • Role of transpilers:
    • Compatibility with old implementations, and
    • Addition of language features which do not add new capabilities
  • Welcome a variety of JS-superset languages
    • TC39 would not participate in this world

4 of 10

Common and Usable

  • New features have a variety of motivations, including fundamental new capabilities, ergonomics and encouraging “good” practices
  • Look to the ecosystem of compile-to-JS languages for inspiration
  • When something is very widely supported there, take it as a strong datapoint that we may want something similar
  • Work with compile-to-JS languages to evolve together with them

5 of 10

Ecosystem alignment with TC39

6 of 10

Transpiler policies for new features

  • These days, transpilers actually have policies that say that new features need to be on a TC39 track
  • These policies were put in place in order to maintain alignment with the rest of the JS ecosystem
  • Examples of several policies
    • TS shipping only Stage 3+ features, aside from type-system features
    • Babel shipping only Stage 0+ features
    • Acorn shipping only Stage 4 features; earlier is in a plugin
  • We have earned a good reputation for continually developing useful features in TC39, and the tools ecosystem is coordinating this way

7 of 10

2JS?

8 of 10

2JS?

  • For alignment within the ecosystem, there would need to be a standard among various tools
    • This would be a lot of organizational work, but even if that happens...
  • The lack of a finished standard for, e.g., decorators inhibits adoption
  • So, at best, we’d have two JavaScripts: the TC39 one and the transpiler one
  • (Note: more dialects will always exist, e.g., JSX and TypeScript. However, some features would benefit from convergence among these dialects, e.g., decorators and fields)

9 of 10

2JS?

  • Reasons why this would be good:
    • Teams can omit tools and stick to the smaller TC39 subset
    • Simpler for implementations to not implement features
    • Some features don’t have much potential for native optimizations
  • Reasons why this would be not so good:
    • More complexity and divergence in the ecosystem overall
    • TC39 may still have to take into account the other language(s)
    • Native support is convenient, e.g., in Node, DevTools, etc
  • Once we figure out the design of language features, how do we determine which JS to put them in?

10 of 10

Thoughts?

1JS, 2JS or more?