AI summary by TwinMind
JavaScript might become two languages (and it's dramatic)
Theo - t3․gg
24m 33s
JS Sugar/JS Zero Proposal Overview
- New TC39 proposal to split JavaScript into two parts
- JS Zero: core language implemented by browsers/engines
- JS Sugar: syntax features implemented only by build tools (Babel, webpack, etc.)
- Presented by Google, Mozilla, Apple, and Sony at TC39 meeting
- Proposal argues build tools already widely adopted, should leverage this for faster language evolution
- Would defer syntax features to tooling authors instead of browser implementers
Core Arguments from Implementers
- JavaScript engines face increasing complexity burden from new features
- Security vulnerabilities in V8 from: BigInt, class scopes, built-in promise subclassing, resizable buffers, weak refs, logical assignments, top-level await
- Performance issues: ESMs bad for networking, iterator proposals hard to optimize, too many allocations
- Stability concerns: enterprises freeze browser versions, nullish coalescing broke Firefox
- Users (not developers) should be primary customer of browser implementations
- New language features provide minimal user benefit while increasing security/performance risks
- Complexity should live "at the edge" (in tools) rather than in widely-used runtimes
Proposed Implementation Structure
- Current flow: TypeScript/modern JS → build tools → standard JS → browser execution
- Proposed flow: TypeScript + JS Sugar + JS Zero → build tools → JS Zero → browser execution
- JS Sugar features would be standardized but never implemented in browsers
- Tools would compile JS Sugar down to JS Zero for browser compatibility
- Future features could start as JS Sugar and potentially move to JS Zero if warranted
Community Backlash and Criticism
Key Critics
- Yehuda Katz (Ember community legend): "RIP vanilla JS" - build tools would become mandatory
- Brendan Eich (JavaScript creator): implementers lack real web development experience, shouldn't call the shots
- Canada Honk: tooling ecosystem already unstable, lacks resources for this responsibility
Major Concerns Raised
- Tooling Resource Constraints
- Current tools (Babel → SWC → OXC) already in constant flux
- Rewriting tools in Rust while adding new feature burden would slow progress significantly
- Legacy tech debt in tools from previously implemented features
- Developer Experience Impact
- Developers would need to understand two different JavaScript languages
- Browser console wouldn't support JS Sugar syntax
- Similar to requiring understanding of V8 bytecode - unnecessary complexity
- Ecosystem Fragmentation
- Server-side runtimes (Node, Deno, Bun) would need to implement JS Sugar features
- Risk of features being implemented differently across tools
- Potential for tools to hide unfixed mistakes longer
Technical Implementation Concerns
- Feature Stability Issues
- JS Sugar could undermine TC39's staging process designed for stability
- Risk of bad features advancing further before being caught
- Tools might not upgrade consistently, leaving developers behind
- Node.js/Server-side Impact
- Async generators commonly used in Node but claimed underutilized by browser implementers
- Server-side runtimes would bear implementation burden instead of underlying engines
- Security Implications
- If browser engines struggle with security in new features, how will smaller tool teams handle it?
- Potential for more vulnerabilities in distributed tooling ecosystem
Alternative Solutions Mentioned
- ESM bundling proposal for concatenating files (addressing networking concerns)
- Better communication between implementers and developer community
- Improved staffing for JS VM teams to include developer advocates
- Source map improvements (should happen regardless)
Industry Position Split
- Supporters: Malte Ubl (Vercel CTO, former Google) sees this as opposite of web components strategy - good direction
- Opposition: Broad resistance from prominent community figures
- Neutral/Concerned: Many acknowledge implementer burden but question if this solution helps developers or users
Fundamental Philosophical Divide
- Implementers argue helping developers vs. serving users are conflicting goals
- Critics argue this creates false dichotomy - helping developers ultimately helps users
- Question of whether browser teams should focus purely on user-facing benefits vs. developer productivity
- Debate over whether complexity should be handled by specialized tools vs. standardized in browsers
