The Birth and Death of JavaScript: Analyzing Gary Bernhardt's 2014 Predictions
Gary Bernhardt's 2014 talk, "The Birth and Death of JavaScript," posits that JavaScript's ultimate fate is to transition from a primary programming language to a universal substrate—a compilation target that powers other languages and environments without being written directly by developers.
JavaScript as a Compilation Target
JavaScript has evolved into a foundational layer for modern software development, effectively becoming a "substrate" where developers use higher-level abstractions that eventually compile down to it. This transition is evidenced by the widespread adoption of TypeScript and the prevalence of transpilation.
As one community observer noted:
"Every few years, we invent a better JavaScript. Then we transpile it to JavaScript."
This pattern confirms the shift toward using JavaScript as a target rather than a source language. The rise of Electron further illustrates this trend, as web technologies are wrapped into desktop applications to provide cross-platform support for Mac, Windows, and Linux efficiently.
The Role of WebAssembly (Wasm) and asm.js
Bernhardt's predictions regarding the "death" of JavaScript as a handwritten language were closely tied to the emergence of technologies like asm.js and its successor, WebAssembly (Wasm). The theory was that the browser would eventually execute a binary format, rendering the high-level syntax of JavaScript secondary.
While WebAssembly has materialized, its adoption has not entirely replaced the need for JavaScript. Current technical limitations persist, specifically regarding DOM manipulation, which requires JavaScript to act as "glue code." Without this integration, developers would be forced to eschew HTML and CSS in favor of rendering everything on a canvas, a method used by some Rust GUIs and Flutter.
Retrospective on the 2014-2035 Timeline
Bernhardt's talk used a science-fiction approach to trace the history of programming from 1995 to 2035. Looking back from the current perspective, several key predictions have aligned with industry trends, while others remain debated:
- The Substrate Theory: The idea that JavaScript becomes the invisible engine for other languages has largely come to pass through TypeScript and Wasm.
- The OS Shift: Predictions regarding browser-based operating systems (similar to the early attempts of webOS and Firefox OS) continue to be a point of interest, though some argue that alternatives like Wine/Proton have shifted the landscape toward running x64 binaries on diverse architectures instead.
- The ABI Debate: Some critics argue that having JavaScript or Wasm as a standard Application Binary Interface (ABI) would have been suboptimal for system performance and architecture.
Legacy and Influence
Beyond the technical predictions, Bernhardt's delivery and his ability to critique the flaws of JavaScript while acknowledging its positive impact on the industry have made the talk a lasting piece of developer culture. It is often cited alongside his "Wat" talk as a definitive exploration of the quirks and evolution of the JavaScript ecosystem.