Get AI summaries of any video or article — Sign up free
JavaScript Is Becoming 2 Languages?? FROM TC39 thumbnail

JavaScript Is Becoming 2 Languages?? FROM TC39

The PrimeTime·
5 min read

Based on The PrimeTime's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

TC39 is considering splitting JavaScript into an engine-implemented core (JS0) and tool-compiled syntax extensions (JS sugar).

Briefing

TC39 is considering a split of JavaScript into two layers: a “JS0” core implemented directly by engines, and “JS sugar” syntax features that must be compiled by tools into JS0. The proposal, associated with a Google agenda item, aims to keep engines from being forced to support every new syntax addition immediately—especially when those additions create performance and security burdens for implementers. In practice, it would formalize what developers already do informally: TypeScript and other toolchains compile extended syntax into plain JavaScript that engines can run.

Supporters frame the split as a way to let language features evolve faster at the developer level while engines adopt changes more gradually. That matters because modern JavaScript development is heavily mediated by tooling—bundlers, transpilers, and frameworks—so the “authoring language” often differs from the “runtime language.” The discussion also ties into a broader theme: new syntax and abstractions can improve developer productivity, but they can also complicate engine internals, increase the risk surface for security issues, and create debugging challenges when features expand into many lower-level operations.

Critics in the conversation argue that the ecosystem already struggles with tooling complexity and that adding another layer of standardization may not reduce pain. They point out that JavaScript’s current reality includes heavy compilation and transformation, yet developers still face issues like source-map mismatches, code bloat, and hard-to-debug behavior when high-level features desugar into large chunks of generated code. Pattern matching is used as an example of a feature that could be “cool” but also potentially expensive to implement efficiently and safely inside engines.

The discussion then pivots to a related “systems” point: performance and transport efficiency in the web stack. HTTP/3 is contrasted with HTTP/2, focusing on how the transport mechanism changes the reliability model. HTTP/2 relies on TCP and uses mechanisms like HPACK for header compression, while HTTP/3 runs over QUIC (UDP-based), avoiding TCP’s acknowledgement-driven sliding window behavior. The practical takeaway is that reducing protocol-level waiting can improve throughput, but it shifts responsibility for loss handling to the application/transport layer.

Finally, the conversation returns to the language-evolution process and the stakeholders involved—developers, implementers (including engine teams), and users. The proposed “JS0 + JS sugar” taxonomy is presented as an attempt to align incentives: engines prioritize security, performance, and stability; developers want expressive features and better mental models; and users ultimately care about reliability and speed. The central tension remains unresolved: whether formalizing compilation layers will genuinely reduce complexity for developers and users, or simply reorganize the existing “mess” into a more standardized pipeline (TypeScript and other stages potentially becoming “TS sugar” feeding into JS sugar, then down to JS0).

Cornell Notes

TC39 is weighing a two-tier JavaScript model: a “JS0” core that engines implement, plus “JS sugar” syntax that tools compile into JS0. The goal is to prevent every new developer-facing feature from immediately forcing engine changes that can raise performance and security costs. The conversation notes that this largely formalizes today’s reality, where TypeScript and other toolchains already transpile extended syntax into engine-compatible JavaScript. The main concern is that more layers could worsen code bloat and debugging complexity when high-level operations expand into many lower-level steps. The proposal is framed as an incentive alignment problem: engines optimize for stability, while developers want faster feature evolution and better expressiveness.

What does the proposed “JS0 vs JS sugar” split try to solve, and why does it matter for engines?

The split targets the cost of implementing every new syntax feature directly in engines. New language features can require rethinking how JavaScript data is represented and can introduce performance regressions and security risk. By making JS0 the engine-implemented core and forcing JS sugar to compile down via tools, engine teams can adopt changes more gradually while developers still get new syntax through transpilation.

How is the proposal connected to what developers already do with TypeScript and bundlers?

The conversation argues the ecosystem already behaves like a two-language system: TypeScript adds syntax/operators beyond the current JavaScript spec, then compiles to plain JavaScript that engines interpret. Bundlers and transpilers already transform developer-authored code into runtime-ready code, so the proposal would standardize that separation rather than invent a brand-new workflow.

Why do critics worry that more compilation layers could make debugging harder?

If JS sugar features desugar into many JS0 operations, a single high-level step could correspond to a large block of generated code. Even with source maps, stepping through execution may land in the middle of expanded logic, making it harder to locate the real cause of an error. The concern is that code bloat and “expanded semantics” could become a recurring pain point.

What example feature is used to illustrate both developer appeal and engine burden?

Pattern matching is highlighted as “super cool” and likely to drive demand for more expressive constructs. But implementing it efficiently and safely inside engines can be complex, and the conversation suggests it could lead to substantial internal branching or desugaring work—raising the same performance/security concerns that motivate the JS0/JS sugar split.

How does the HTTP/2 vs HTTP/3 discussion reinforce the theme of shifting responsibilities between layers?

HTTP/2 uses TCP, which relies on acknowledgements and a sliding window; sending multiple packets can stall when waiting for ACKs. HTTP/3 uses QUIC over UDP, avoiding TCP’s acknowledgement-driven pacing and allowing faster sending with loss handled via negative acknowledgements (NACKs) and retransmission logic. The analogy is that moving complexity between layers can improve one metric (throughput) while changing where reliability complexity lives.

What does the “stakeholders” framing add to the language-evolution debate?

It positions language design as an incentive alignment problem across developers, engine implementers, and users. Engines prioritize security, performance, and stability; developers want productivity and expressive features; users want fast, reliable apps. The JS0/JS sugar taxonomy is presented as a process change intended to better match those priorities, though the conversation questions whether it will actually reduce overall ecosystem complexity.

Review Questions

  1. If JS sugar features compile into JS0, what kinds of problems could still arise even if engines become simpler?
  2. How do TCP’s acknowledgement and sliding-window behavior differ from QUIC’s UDP-based approach, and what does that imply for performance?
  3. What incentive mismatch does the JS0/JS sugar proposal attempt to address among engines, developers, and users?

Key Points

  1. 1

    TC39 is considering splitting JavaScript into an engine-implemented core (JS0) and tool-compiled syntax extensions (JS sugar).

  2. 2

    The split is motivated by performance and security burdens that new syntax can impose on engine implementers.

  3. 3

    The proposal largely formalizes existing practice where TypeScript and other toolchains transpile extended syntax into engine-compatible JavaScript.

  4. 4

    A major risk is that transpilation can create code bloat and make debugging harder when one high-level operation expands into many lower-level steps.

  5. 5

    The discussion ties language evolution to incentive alignment: engines optimize for stability while developers want faster feature evolution and better expressiveness.

  6. 6

    The HTTP/2 vs HTTP/3 segment illustrates how changing transport mechanisms shifts reliability and performance tradeoffs between layers (TCP/ACKs vs QUIC/UDP).

  7. 7

    The ecosystem concern remains whether standardizing more compilation stages will reduce complexity or simply reorganize an already complicated toolchain pipeline.

Highlights

TC39’s JS0/JS sugar idea would separate what engines must implement from what tools can compile, aiming to reduce engine performance/security pressure.
The conversation argues the ecosystem already lives in a two-layer world because TypeScript and bundlers transform authored code into runtime-ready JavaScript.
HTTP/3’s QUIC-over-UDP approach avoids TCP’s ACK-driven sliding window behavior, changing where loss handling complexity occurs.
A recurring worry is that source maps and debugging may struggle when JS sugar desugars into many JS0 operations.

Topics

  • JavaScript Language Evolution
  • TC39 Proposal
  • TypeScript Transpilation
  • HTTP/3 vs HTTP/2
  • QUIC and QUIC Loss Handling

Mentioned

  • TC39
  • JS0
  • JS sugar
  • V8
  • HTTP/2
  • HTTP/3
  • TCP
  • UDP
  • QUIC
  • HPACK
  • NACK
  • ACK
  • JIT
  • ES
  • TS
  • wasm
  • SV