New TC39 proposal! Does JavaScript require a compiler soon?

#TC39 # JavaScript # Hotdrama

There's some turmoil on the socials about a TC39 proposal that allegedly wants to make a build step a requirement for JS. So I did what many did not: I looked at the slides.

But they're just slides and easy to misinterpret when ripped out of context. So here's the gist of what that whole thing with JS0 and JSSugar is about1:

The premise

The key premise is, that new JavaScript features always bear a risk of introducing security issues; which is undeniably true. And that some of those features bear more risks than others. And the developers of browser engines should be more concerned about the end user - which are not the developers - and their security.

So to add any new features, a lot of care needs to be put into each new Feature. Like, a lot. Especially because the feature focus has been mostly on the developer. And that's mostly what's slowing progress down right now.

What is actually proposed?

This proposal poses the questions, whether browser engines really need to be concerned with implementing all of those. Or whether it might be a good idea to reduce these risks and leave some of those features to build tools. Which, given that we already use them to get features that JS doesn't support, isn't such a crazy idea as the turmoil might suggest. 

In short:

  • It does not say that a build step is required. 
  • It does not say that JS won't receive new features.
  • Instead, it is about drawing a line.

Which is a good thing, and maybe long overdue.

JS0 is merely the proposed name for the side of the line that browser engines will agree on, and JSSugar is the proposed name for, well, the other side of that line. And all build tools that adhere to JSSugar should compile to JS0

Neither name is great, and they will very likely change. Where that line will be, is also up for debate. Even the line itself is still up for debate. Literally - that debate is the whole point. But with that context in mind, they give a good idea about what each represents.

Is this good?

I think this could help to move things faster, since proposals can be handled quicker and some features can be implemented faster by build-tools, without introducing risks or breaking the web. 

It will also help to prevent further language bloat; like I'd love pipes in JS, but since that proposal doesn't seem to get anywhere, it might be better suited for JSSugar as they can easily be transpiled to JS we have today. Immutable Data Structures (Records/Tuples), however, those would be features of JS0 so that browser engines can optimize memory handling.

This will also extend the influence of TC39 into build tools, so we might see some actual common ground and be able to use a single build tool for more than a couple of years, or switch between them more easily as long as we stay within JSSugar.

The slides don't have a lot of details, and the presentation hasn't even happened yet. But overall, this seems like a good idea to me. It just depends on where that line will be, and how the guidelines will be to determine on which side of the line a feature lands.


  1. at least how I understand it, and I left some things out that are mostly to build up an argument.