DartlangTV
AI-assisted summary of Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart — original source. Check the original for full context.
Source published:
Key ideas
- Microsoft has introduced TypeScript as an open-source, true superset of JavaScript with optional static typing that compiles down to clean JavaScript and aligns with ECMAScript 6 drafts. (0:00)
- Google's Dart pursues a clean-slate language model with fixed object shapes, native integers, and an optional dedicated virtual machine designed to bypass fundamental JavaScript startup and runtime bottlenecks. (2:00)
- Anders Hejlsberg and Lars Bak identify enterprise web scalability, code maintainability, and tooling deficiencies as the shared catalysts behind both TypeScript and Dart. (4:58)
- The fundamental design divergence hinges on runtime semantics: TypeScript operates purely as design-time static analysis with zero execution footprint, whereas Dart enforces structured semantics enabling aggressive whole-program tree shaking and runtime verification. (20:51)
Detailed notes
## Background Published on YouTube by the DartlangTV channel on January 10, 2013, this video captures a Channel 9 discussion filmed at the GOTO 2012 conference in Aarhus. It documents an in-depth conversation between Dart co-creator Lars Bak and TypeScript lead architect Anders Hejlsberg examining the design, tradeoffs, and future of Dart, TypeScript, and JavaScript.
## TL;DR Recorded the day after Microsoft publicly announced TypeScript, language architects Anders Hejlsberg and Lars Bak contrast their competing philosophies for solving the scalability and tooling challenges of modern web development. Hejlsberg presents TypeScript as an ergonomic, pragmatic superset of JavaScript that introduces optional static typing and ECMAScript 6 alignment purely at compile time without altering runtime semantics or breaking ecosystem compatibility. Bak advocates for Dart's clean-slate design, arguing that legacy JavaScript semantics, slow standards processes, and dynamic execution traps necessitate fixed object layouts, native integer semantics, whole-program tree shaking, and a dedicated high-performance virtual machine to keep pace with proprietary mobile platforms. While diverging on whether the web needs a radical runtime overhaul or a transparent tooling layer, both creators agree that optional typing is vital for large engineering teams and champion open-source diversity across the web platform.
## Atmosphere & style The conversation carries an energetic, collegial tone defined by mutual respect and playful intellectual sparring between two titan software architects. Bak delivers blunt, colorful critiques—characterizing devotion to legacy JavaScript runtimes as an engineering 'Stockholm syndrome' and teasing a tree-shaking competition—while Hejlsberg responds with measured pragmatism, technical precision, and good humor. The exchange feels less like a corporate marketing duel and more like an authentic, high-level summit between veteran systems builders genuinely invested in the future of web development.
## Bulletin - [00:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=0s) Microsoft has introduced TypeScript as an open-source, true superset of JavaScript with optional static typing that compiles down to clean JavaScript and aligns with ECMAScript 6 drafts. - [02:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=120s) Google's Dart pursues a clean-slate language model with fixed object shapes, native integers, and an optional dedicated virtual machine designed to bypass fundamental JavaScript startup and runtime bottlenecks. - [04:58](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=298s) Anders Hejlsberg and Lars Bak identify enterprise web scalability, code maintainability, and tooling deficiencies as the shared catalysts behind both TypeScript and Dart. - [20:51](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1251s) The fundamental design divergence hinges on runtime semantics: TypeScript operates purely as design-time static analysis with zero execution footprint, whereas Dart enforces structured semantics enabling aggressive whole-program tree shaking and runtime verification.
## Key takeaways - [00:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=0s) TypeScript is engineered as a true superset of JavaScript, allowing existing JavaScript code to run as valid TypeScript while layering on optional types, classes, and ES6-aligned constructs. - [02:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=120s) Dart rejects backward-compatibility constraints in favor of a clean-slate semantics model paired with its own virtual machine to overcome JavaScript startup delays and dynamic execution overhead. - [04:58](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=298s) Both Microsoft and Google turned to structured languages because large, unstructured JavaScript codebases devolve into unmaintainable 'spaghetti code' that defeats IDE refactoring and navigation tooling. - [08:40](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=520s) TypeScript prioritizes immediate adoption and ecosystem leverage by providing external type definitions for existing dynamic libraries like the DOM, Node.js, and jQuery without altering runtime behavior. - [12:35](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=755s) Dart incorporates Smalltalk-inspired fixed object layouts and native integers to eliminate JavaScript's reliance on hidden-class heuristics, de-optimization traps, and ubiquitous IEEE 754 floating-point operations. - [16:21](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=981s) Lars Bak argues that relying on the slow, committee-driven evolution of ECMAScript risks web platforms losing the developer ecosystem to proprietary mobile application runtimes. - [20:51](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1251s) TypeScript operates entirely as a static compile-time tooling layer that is erased at runtime, leaving standard browser engine semantics completely untouched. - [24:23](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1463s) Both languages implement optional typing as an adjustable dial, allowing developers to balance rapid, untyped prototyping with structured, self-documenting interface contracts. - [26:20](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1580s) Dart enforces runtime type validation in checked mode to detect invalid contract crossings at interface boundaries, breaking away from JavaScript's silent-failure model. - [30:54](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1854s) TypeScript addresses the multi-team collaboration challenge by establishing a formalized, compile-time contract mechanism across heterogeneous libraries without adding runtime overhead. - [34:34](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2074s) Dart's strict structural constraints enable sound whole-program tree shaking from entry points to strip uncalled methods, combating massive startup bundle download bloat. - [37:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2220s) Dynamic JavaScript idioms like keyed property access prevent sound dead-code elimination, undermining tree-shaking efficacy when TypeScript is mixed with arbitrary dynamic libraries. - [39:23](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2363s) Lars Bak critiques conservative web engineering as a 'Stockholm syndrome' that impedes language innovation under the pretext of legacy compatibility. - [41:34](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2494s) Both projects embrace open-source distribution across diverse platforms and editors, reflecting a multi-language web ecosystem driven by developer choice rather than proprietary lock-in.
## Detailed walkthrough ### [00:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=0s) First Impressions of TypeScript and the CoffeeScript Comparison
Sitting down at the GOTO Aarhus conference, Channel 9 hosts a discussion between Anders Hejlsberg (lead architect of TypeScript at Microsoft) and Lars Bak (co-creator of Google Chrome’s V8 engine and Dart). The conversation opens on the heels of Microsoft’s official public announcement of TypeScript the day before. The host asks Lars for his immediate assessment of the new project. Lars rejects the host's assumption that he had not had time to process it, clarifying that while he has not written any code in it yet, he looked through it the day prior.
Lars views TypeScript as a conservative, pragmatic choice. He characterizes the project directly: “It seems like a safe bet, right? It's a, to me it looks like a CoffeeScript with optional typing.” He points out that developers get classes and optional typing—which he notes is fundamentally not that far off from what Dart offers, alongside a bit of type inferencing. Ultimately, Lars notes, TypeScript simply compiles down to JavaScript. He wonders whether Microsoft's intent is to guide the standards body: “I don't know what the intent is with with it, if it's to influence the the standards committee to to adapt that kind of stuff, but I know that they have discussed the classes and and types as well as part of the ECMAScript 4 proposal, right?”
Anders responds directly to the CoffeeScript analogy, acknowledging the shared compilation target while pointing out a foundational structural difference: TypeScript is not just a language that compiles down to JavaScript; it starts with JavaScript as a true superset. As Anders explains: “Unlike CoffeeScript and unlike Dart, it also starts with JavaScript, so it's a superset of JavaScript, so you can just copy and paste your code in and then, you know, there are only a few extra concepts you have to learn.” The entire philosophy was to avoid inventing an unrelated language, building a system where code starts with JavaScript and compiles back down to plain JavaScript.
```mermaid flowchart LR accTitle: TypeScript and CoffeeScript Relationship to JavaScript accDescr: Diagram contrasting how CoffeeScript and Dart compile to JavaScript versus TypeScript acting as a full superset that begins and ends with JavaScript.
subgraph OtherApproach["External Source Languages"] CS["CoffeeScript / Dart"] -->|"Compile down"| JSOut1["JavaScript Output"] end
subgraph SupersetApproach["Superset Architecture"] JSIn["JavaScript Code"] -->|"Valid as"| TS["TypeScript (Superset)"] TS -->|"Typecheck & Transpile"| JSOut2["Clean JavaScript"] end ```
[02:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=120s) Standards Alignment and Dart’s Alternative Strategy
Anders explains the feature set of TypeScript, which includes optional static typing, classes, modules, arrow functions, and rest parameters. Crucially, the last four features are modeled to mirror the evolving ECMAScript 6 (ES6) draft standard as closely as possible. He clarifies that TypeScript is not trying to strong-arm the TC39 committee: “We're not trying to sway the committee in one direction or the other, rather we're trying to follow where the committee is.” In fact, the team had originally designed a different class syntax, but when the standards committee agreed upon the “maximally minimal” classes proposal, TypeScript went back and realigned with TC39, even though it broke internal Microsoft teams already using the early builds. Anders makes their stance explicit: “It wouldn't make a lot of sense for us to have a different model of classes from what ultimately ends up in ECMAScript 6.”
Lars welcomes the competition and innovation, thanking Anders for bringing another web language into the arena. However, he draws a sharp contrast with Google's philosophy behind Dart. Rather than preserving legacy JavaScript baggage, Dart was created from a blank slate to introduce clean semantics and solve deep runtime issues: “Dart is a very different kind of programming language where we from scratch are trying to make cleaner semantics.”
Lars argues that the problem with JavaScript—and by extension TypeScript, since it targets the JavaScript engine—is fundamental execution architecture: - **Startup performance:** Large JavaScript applications require executing the entire top-level script file simply to initialize structure, because JavaScript lacks a statically declared declarative structure. - **Runtime speed:** Dart is built alongside its own dedicated virtual machine designed to dramatically outperform JavaScript engines over time. - **Engine mechanics:** Compiling down to JavaScript inherits JavaScript’s setup bottlenecks, meaning TypeScript cannot bypass the core runtime initialization penalties inherent in browsers.
[04:58](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=298s) The "Elephant in the Room": Do JS Developers Want Structure?
The interviewer introduces the central dilemma: many JavaScript developers are perfectly happy writing standard jQuery and working within prototype-based, dynamic patterns without classical object orientation. He asks whether TypeScript and Dart are projecting corporate engineering habits onto people who might actively dislike classes and classical structure.
Lars responds that despite differences in execution, Google and Microsoft share the exact same pain points regarding enterprise web code: “I think we all experience when you do big JavaScript applications they turn into spaghetti code and they're very hard to maintain.” At Google, engineers were forced to mandate strict coding guidelines and insert descriptive JSDoc comments to manually define expected parameter types. Both Dart and TypeScript were born out of a desperate need to bolster programmer productivity and unlock tooling—such as automated refactoring, symbol renaming, and semantic navigation—that is completely reliant on types.
Anders reinforces this point, citing overwhelming feedback from both internal Microsoft teams and external developers struggling with large JavaScript applications:
> “The last decade of IDE advancements, you know, with refactorings and code completion and finding references and navigating big code bases—a lot of that is driven by static type information, and if you don't have the static type information, you just really can only go so far before the guesswork starts, and then sometimes you're going to guess wrong, or you're not going to have a guess at all.”
Anders emphasizes that while dynamic, unstructured code works smoothly for solo developers or compact files you can fit in your head, once applications scale to tens of thousands of lines of code, static types become non-negotiable for reasoning about the codebase.
[08:40](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=520s) Ecosystem Leverage vs. Pristine Semantics
Anders addresses the design trade-off between Dart’s clean-break philosophy and TypeScript’s pragmatic adoption strategy. While acknowledging that JavaScript is far from perfect, he points out that messiness is the universal hallmark of any widely adopted technology that has evolved over years across standards committees and diverse user bases: “They're never pretty, they're never pristine, because lots of people have worked on them over lots of time and committees and what have you; but on the other hand, what they do have is they have an enormous community of users and enormous community of codebases out there that you can leverage.”
TypeScript was engineered to embrace that reality directly rather than discarding it: - Developers can immediately use established third-party JavaScript libraries without changing runtime semantics. - TypeScript enables gradual adoption by letting developers layer static type annotations on top of raw JavaScript. - Type definitions were created externally for standard platforms and widely used libraries, including the DOM, core JavaScript runtimes, Node.js, and jQuery. - Developers get rich IDE autocompletion, error checking, and navigation without needing to rewrite existing libraries or alter underlying dependencies.
[09:53](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=593s) The Limits of Scaling JavaScript Codebases
The discussion turns to the sheer scale of modern web applications. The interviewer questions how far JavaScript can truly be pushed when dealing with canonical large-scale applications like Gmail and Hotmail, asking whether codebases will eventually become too massive for the underlying infrastructure to handle. Anders Hejlsberg reflects that while practical boundaries likely exist today, he remains continually astounded by what modern browsers can achieve. He notes that apps spanning hundreds of thousands of lines of code somehow manage to load and run reliably, crediting the massive engine strides made by engineers working on Google's V8 as well as Microsoft's Chakra in Internet Explorer.
Lars Bak acknowledges that V8 dramatically accelerated JavaScript execution, bringing clear benefits to web users, but points out the core philosophical difference between TypeScript and Dart. While TypeScript represents a pragmatic, safe bet that compiles down to JavaScript, Dart intentionally attempts to correct the underlying language’s architectural flaws. Coming from a computer science background, Lars finds the malleability of JavaScript environments deeply problematic for enterprise engineering: “I still from a computer science background I still have problems with that you can you can design application with libraries where you can you can monkey patch the libraries when you get up running I just find that very very disturbing when you're trying to big big write big application.” Even with a language compiling to JavaScript, Lars warns that without strict whole-program type guarantees, running on top of a dynamic host environment still leaves developers vulnerable to runtime monkey patching and brittle code.
[12:35](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=755s) Dart's Design: Smalltalk Roots, Fixed Shapes, and Integers
Lars explains that Dart was architected to bypass dynamic JavaScript traps by relying on a cleaner, Smalltalk-inspired object model. In Dart, objects have fixed layouts once instantiated; developers cannot arbitrarily bolt properties onto arbitrary objects on the fly, and must explicitly use data structures like maps or lists if they want dictionary semantics. Furthermore, Dart introduces native integers rather than forcing every numerical computation to run on top of IEEE 754 floating-point doubles. Lars argues that forcing a language to simulate integer behavior beneath a ubiquitous double-precision abstraction is conceptually flawed, quipping that when he writes `for` loops, he expects them to behave like integers rather than floating-point numbers.
Anders readily admits that JavaScript harbors numerous awkward design quirks, but frames the dispute around the threshold for abandoning the web standard altogether: “No I I you know everything you say and more I will I will readily agree but the the question is is is not whether JavaScript is broken you know in places the question is whether it is broken enough to Merit being replaced by something else right and then that's and I don't know the answer to that question.” Lars counters that optimizing JavaScript engines requires an immense amount of compiler heuristics based on hidden classes and object shapes. When dynamic code unpredictably mutates an object from the side, hot execution paths immediately de-optimize and performance drops off a cliff.
```mermaid flowchart TD accTitle: JavaScript Heuristic Optimization vs Dart Determinism accDescr: Contrasting dynamic shape changes in JS engines with fixed object layouts in Dart.
subgraph JS["Dynamic JavaScript Engine (V8 / Chakra)"] J1["Object Instantiated"] --> J2["Infer Hidden Class / Shape"] J2 --> J3{"Side Mutation?"} J3 -- No --> J4["JIT Fast Path"] J3 -- Yes --> J5["De-optimize & Recompile"] J5 --> J6["Engine Metadata Bloat"] end
subgraph Dart["Dart Architecture"] D1["Object Instantiated"] --> D2["Fixed Shape Layout"] D2 --> D3["Predictable Fast Execution"] D2 --> D4["Native Integer Semantics"] end ```
- In dynamic engines like V8, attempting to track every dynamic mutation causes metadata bloat inside the virtual machine's shape transitions. - Lars insists that to justify a new language, Dart must deliver concrete systems-level advantages, notably predictable runtime performance and a lighter memory footprint when backed by a native browser VM. - Although Dart targets a dedicated virtual machine for optimal performance, Lars highlights that it can also be cross-compiled to standard JavaScript to run anywhere.
[16:21](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=981s) The Evolution Dilemma: ECMAScript Committees vs. Mobile Threats
The interviewer asks whether JavaScript could follow the evolutionary path from C to C++, where standard classes, interfaces, and language features are added iteratively to produce a modern "JavaScript++" without introducing a competing virtual machine. Lars responds with skepticism born of industry experience: “Oh it is a reasonable if you have infinite amount of time so I'm getting I'm getting close to pension age and all respect for the the committee doing JavaScript but if you have seen the adoption of of new standards in JavaScript I I don't have time okay.” He recounts how V8 kicked off in 2006 during the era when ECMAScript 4 collapsed entirely, noting that years later, the bulk of production web code was still trapped on ECMAScript 3 (ECMA-262 3rd Edition), despite ECMAScript 5 having arrived.
Lars stresses that the web cannot afford to wait for slow standards processes because proprietary native mobile platforms are capturing the developer ecosystem: “I think what what the big problem is right now is that if you don't don't innovate with new languages new systems in the the browsers the proprietary mobile platforms are taking over and I don't like that right so we need to make sure that we push this technology as fast as we can to make sure that web technology is also brilliant when it comes to mobile phones.” Anders acknowledges the political conundrum: JavaScript’s unmatched distribution means coordinating changes across rival companies with conflicting agendas. Nevertheless, Anders points out that ECMAScript 5 did successfully deliver strict mode across modern browsers, suggesting one could envision a future "stricter mode" containing engine hints for object layouts to help existing runtimes execute code significantly faster.
[20:51](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1251s) Engine Performance, Language Evolution, and the Legacy Dilemma
The conversation turns to how web runtimes might be optimized. Anders Hejlsberg suggests that a JavaScript engine could run faster if given explicit hints—similar to how `"use strict"` works as a directive string literal that standard runtimes simply ignore unless they are built to look for and act upon it. The interviewer jokes that this sounds like pragmas in C, but redirects to the broader problem: performance on engines like Chakra (developed by Steve Lucco's team) and V8 is already a triumph of engineering against a difficult target. While anyone could theoretically make things faster simply by “throwing resources at it” or staffing hundreds of developers, the deeper philosophical issue remains. If you simply make JavaScript faster while the language itself never evolves to meet modern development realities, it feels like an enormous waste of effort.
As the interviewer observes, JavaScript was never designed for the scale of software people write in it today—noting that Brendan Eich would be the first to admit he had no inkling it would ever morph into this mammoth ecosystem. Facing that reality leaves the industry with two distinct paths: 1. Build a brand-new, clean-slate language with modern design ideas (such as Dart's isolate-based concurrency model and Smalltalk lineage), or 2. Keep the existing semantics untouched and improve the developer experience purely via tooling, as TypeScript does.
The clean-slate path faces a daunting migration problem. The interviewer compares moving the JavaScript ecosystem to Dart with trying to convince C++ programmers to move to the D programming language: no matter how elegant D is, the existing C++ codebase is so insurmountably large that transition is slow and fraught. Anders agrees, stressing the contrast: “TypeScript is purely a tooling thing, you know, and it all goes away at runtime, right, where Dart is—well, Lars described—but there's a VM there, and it's a different design point.”
- Dart preserves Dart semantics both on its own VM and when compiled down to JavaScript, maintaining stricter behavior than pure JavaScript, while remaining closer to web idioms than heavy compilers like Google Web Toolkit (GWT) or Script#. - Anders highlights that TypeScript leaves runtime safety and execution semantics untouched, acting strictly as a static analysis overlay.
```mermaid flowchart TD accTitle: Strategies for Scaling Web Development accDescr: Chart illustrating the contrast between Dart's runtime/VM overhaul and TypeScript's compile-time tooling strategy.
subgraph Strategies["Architectural Strategies"] direction TB A["Modern Large-Scale Web Apps"] --> B["Dart Approach: Clean-Slate Platform"] A --> C["TypeScript Approach: Tooling Layer"] B --> D["Dart VM / Dart2JS Compiler<br/>• Runtime Type Checks<br/>• Isolates Concurrency<br/>• Strict Semantics"] C --> E["TypeScript Static Compiler<br/>• Erased at Runtime<br/>• Zero VM Overhead<br/>• Pure JavaScript Output"] end ```
[24:23](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1463s) Optional Typing, Incremental Execution, and Dialing the Dial
Lars Bak outlines the core motivation behind optional typing in Dart: allowing dynamic prototyping inside the browser without type friction. When debugging or writing early iterations, developers can evaluate expressions without compiler impediments. Then, as project architectures harden and interface contracts matter across teams, developers can progressively sprinkle in type annotations to aid readability and maintainability. Lars criticizes legacy languages like C# and Java for losing sight of this workflow: “If you contrast these web programming languages to more traditional programming languages like C# and Java, they completely missed the boat when it comes to incremental execution, and I think we just need to face that this is an important part of web development, that you get instant gratification when you do web apps.”
Anders wholeheartedly agrees with this middle ground between rigid static systems and unconstrained dynamic code. In both Dart and TypeScript, typing behaves like a dial: leave off type annotations, and the developer stays in an unconstrained dynamic world (which in TypeScript is vanilla JavaScript). Turn the dial up by annotating types, and the compiler infers downstream types, lighting up tooling with code completion, static diagnostics, and squiggly error underlines.
[26:20](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1580s) Runtime Type Verification vs. Static Eradication
The conversation moves into how the two systems diverge when running code. Lars points out a critical runtime difference: in Dart, objects carry reified runtime type information. When Dart runs with type checks enabled (such as checked mode during development), assignments and boundary crossings between dynamic and typed code are verified at runtime. If an untyped module passes an invalid object into an annotated interface, the system catches it immediately at the boundary.
Anders acknowledges that while the TypeScript team has contemplated an optional debug mode that injects runtime validation assertions, doing so on top of raw JavaScript is fraught with overhead: - Checking whether an arbitrary JavaScript object satisfies an interface requires deep inspection (“graveling through all the properties”). - Validating function arity and signature shapes at runtime in JavaScript is prohibitively expensive. - In Dart, having a dedicated VM architecture makes these checks drastically cheaper.
Anders questions whether full runtime guarantees are truly mandatory in web development. In older native languages like K&R C before ANSI function prototypes, calling a function with mismatched arguments corrupted the call stack and caused the program to jump into raw screen memory. By contrast, JavaScript is inherently memory-safe: passing too few or too many arguments has standard, well-defined language behavior that cannot crash the underlying machine.
[28:43](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1723s) Boundary Failures and "Keep Calm and Carry On"
Lars counters Anders by emphasizing the team-coordination value of contract verification at component boundaries. In large organizations, Team A might build an interface with static types, while Team B consumes it:
> “The fact that you can validate the types when you cross into that library means that you don't have to debug the other person's code if it's correct, right? You can see it at the interface level if it breaks down.”
Lars also targets JavaScript’s silent failure philosophy. When an engineer mistypes a property name in standard JavaScript—such as miscapitalizing `readyState` as all-lowercase in an event handler—the engine does not raise an error; it simply resolves the lookup to `undefined` and “keeps on trucking,” bypassing the intended logic entirely. Dart breaks cleanly with this “keep calm and carry on” tradition. In Dart, attempting to access a missing property or invoke a non-existent method triggers an immediate exception so that bugs are confronted directly during development rather than lingering undetected. In response, Anders notes that it ultimately reflects different placements on a spectrum: “Static typing is a dial, you know, and you can put the dial in different places.”
[30:54](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1854s) Solving the Library Interop and "Two-Team" Problem in JavaScript
Anders Hejlsberg explains that finding the right balance for static type checking involves weighing the programmer's effort against runtime overhead and verification costs. While there is a ceiling where static checking becomes too cumbersome or expensive for JavaScript, he believes TypeScript hits the sweet spot. When asked whether TypeScript solves the classic "two-team problem"—where an architecture team defines interfaces and domain classes in TypeScript, hands over the contract, and lets another team build the implementation against it—Anders agrees that this touches on a fundamental, long-standing gap in web development: the absence of a shared, formal mechanism to describe and reason about software boundaries.
In contemporary JavaScript projects, understanding third-party code requires wading through incompatible, ad-hoc documentation systems. A developer combining jQuery with Node.js faces completely different vocabularies, missing API parameters, undocumented undefined behaviors, and tribal knowledge. TypeScript's interface declarations bridge this divide by letting authors specify contracts that the compiler actively verifies. Having static type definitions backed by real tooling gives engineers confidence that their components will actually mesh upon deployment, avoiding runtime surprises.
As Anders Hejlsberg summarizes the role of TypeScript's type system: > “I think with TypeScript we're capturing a good, you know, 80–90% of the meaningful settings on that dial, so I do think there's a lot of value there, but it's not going to solve every problem known to mankind in JavaScript.”
Anders expands on the core difficulty of managing complex codebases across teams: > “The thing that I think has been lacking for large JavaScript development is an agreed-upon way to reason about libraries: how do I know what's in this library, and how do I know what's in this other library, and how can I in the same language reason about this versus that, and are they compatible, are they not, how do I document them?”
[32:54](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1974s) Design-Time Mirroring and the Startup Download Problem
The conversation turns to the philosophical dissonance between compile-time types and runtime execution. The interviewer observes that what developers define in TypeScript code does not physically persist at runtime—it remains plain, dynamic JavaScript. Anders emphasizes that this intentional design required immense effort: TypeScript does not invent an arbitrary type model, but formalizes a static type system designed specifically to mirror JavaScript's underlying dynamic semantics. Despite this being explained repeatedly, developers still experience cognitive dissonance adjusting to the idea that a type system can vanish at execution time without leaving runtime footprints.
Lars Bak concedes that TypeScript's seamless interoperability with legacy JavaScript is an undeniable advantage, but immediately raises a critical performance dilemma facing modern web applications: startup bloat. Referring to data shared at the conference, Lars points out that modern web applications routinely download hundreds or thousands of functions during page load, only to execute a minuscule fraction of them. Because Dart enforces a clean, structured object model across the entire application, its tooling can perform whole-program dead-code elimination (tree shaking) to discard unreachable functions before deployment, directly shrinking downloaded bundle sizes or VM snapshot images.
Anders Hejlsberg describes the deliberate boundary of TypeScript's type design: > “What we have done in TypeScript is basically formalize a static type system that mirrors the dynamic type system of JavaScript, and we have really worked very hard to stay true to that, that it really is JavaScript's type system and there are no new concepts per se.”
Lars Bak outlines the download penalty that inspired Dart's whole-program optimization: > “As we also heard during this conference, that some websites they download a boatload of functions when they start up and they only run a few percent of the functions, which is a pain for download time and so on.”
[34:34](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2074s) Tree Shaking: Dart's Whole-Program Analysis vs. JavaScript Dynamics
Anders challenges Lars on how Dart accomplishes dead-code elimination in the presence of dynamic typing, asking how the compiler can safely prove a method is unreachable if dynamic calls are permitted. Lars clarifies that tree shaking operates on multiple levels. At its simplest, the compiler can scan the entire codebase to see if a given identifier, such as `foo`, appears anywhere in the application; if no code references that identifier, all definitions of `foo` can be stripped with complete safety. In more advanced stages, Dart runs whole-program type inference starting from known entry points—such as the application's `main()` function or registered DOM event handlers—and traces reachable code paths downward.
Lars notes that Google had previously attempted similar optimizations in pure JavaScript using the Google Closure Compiler, which relies on JSDoc pseudotype annotations in code comments. However, that technique requires an entire codebase to be authored under strict, idiosyncratic coding conventions. In standard JavaScript, dynamic patterns like keyed bracket access—such as `obj[computedString]()`—make it virtually impossible to soundly prove that an arbitrary method will never be called. Because Dart enforces language-level structure, its compiler can aggressively discard unneeded methods and deliver the compact bundle sizes that large enterprise teams demand.
```mermaid flowchart TD accTitle: Dart Tree Shaking vs JavaScript Dynamic Keyed Access accDescr: Diagram contrasting how Dart traces reachable code from entry points with why dynamic JavaScript bracket access blocks tree shaking.
subgraph Dart["Dart Structured Compilation"] Entry["Entry Points: main() / DOM hooks"] Infer["Type Inferencing & Call Graph"] Shake{"Identifier / Method Reached?"} Keep["Include in Deployed Bundle / VM Snapshot"] Drop["Strip Out Unused Methods"]
Entry --> Infer Infer --> Shake Shake -->|"Yes"| Keep Shake -->|"No"| Drop end
subgraph JS["Dynamic JavaScript / Ad-Hoc Interop"] Keyed["Keyed Access: obj[a + b]()"] Unknown["Unknown Dynamic Member"] Bail["Cannot Prove Reachability: Unsafe to Tree Shake"]
Keyed --> Unknown Unknown --> Bail end ```
Lars Bak explains Dart's aggressive dead-code elimination pipeline: > “Because it's more structured also compared to TypeScript, we can actually do analysis on the complete program and do tree shaking and throw out methods we can prove are not being executed, so that the deployment of either the generated JavaScript code or the snapshot we have on the VM will be minimal.”
When Anders asks how this works in partially dynamic environments, Lars highlights the basic pruning mechanism: > “For instance, if you know that the identifier `foo` is not being used anywhere, that's certainly the simplest form of tree shaking, and it works amazingly well.”
[37:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2220s) Tool Chains, Keyed Property Access, and the Tree-Shaking Challenge
Anders counters that there is no fundamental barrier preventing TypeScript code from being tree-shaken, acknowledging that while TypeScript itself does not currently bundle a dedicated tree shaker, the language fits squarely into a broader web toolchain. Developers write TypeScript for development-time safety, code completion, and refactoring, then compile down to JavaScript and pass the output to specialized packagers, AMD/RequireJS module bundlers, and minifiers. However, Anders admits that while authored TypeScript code could theoretically be analyzed, third-party dynamic libraries like jQuery remain nearly impossible to tree-shake safely because the compiler cannot see behind their dynamic facades.
Lars doubles down on this exact point, arguing that mixing arbitrary JavaScript libraries with typed code destroys the sound semantics required for tree shaking. If an optimizer guesses incorrectly and strips a method accessed via an indirect property look-up, the program breaks at runtime. Lars playfully challenges Anders to a friendly competition over who can produce better tree shaking, confidently claiming that Dart holds the winning hand because it controls the entire language definition and runtime pipeline without compromise.
Anders Hejlsberg outlines TypeScript's modular role in modern web workflows: > “The thing that we find that people do with TypeScript is that they use it at development time to provide a better development experience, and then they get this data verification, all of the code completion, etc., then they compile to JavaScript, and then they use other JavaScript tools like minifiers, packagers, etc.”
Lars Bak stakes his claim on Dart's architectural advantage: > “That's one of the benefits by having a more structured language for the whole thing: then you can do tree shaking, and I'll still guarantee that we can do a small competition who can do better tree shaking, but I can guarantee you I'm holding a much better hand.”
- Anders notes that neither TypeScript nor Dart will ever provide every single capability a developer might want across an entire build and deployment toolchain. - Lars insists that once unconstrained dynamic JavaScript libraries are imported into an application, reliable tree shaking ceases to be feasible due to semantic risk.
[39:23](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2363s) The "Stockholm Syndrome" Debate and Ground-Up Innovation
The interviewer steps in to frame the contrast between the two projects: TypeScript acts as a lightweight, pragmatic shell over JavaScript and its existing ecosystem, whereas Dart rethinks web development from the ground up by introducing a clean-slate language and a dedicated virtual machine. The interviewer notes that developers will inevitably be forced to deploy to JavaScript because it runs ubiquitously in every browser without requiring an external VM plugin or custom runtime.
Lars rejects the notion that ubiquitous compatibility should hold back language evolution, branding the fixation on existing JavaScript as an engineering "Stockholm syndrome." He recalls the skepticism Google faced when building the V8 engine, when critics claimed JavaScript was already fast enough and questioned the need for high-performance virtual machines. In Lars's view, dismissing fresh language design out of deference to legacy environments breeds stagnation and denies application developers the tools they need to build next-generation applications. While he welcomes TypeScript as a healthy innovation in the web space and agrees the two languages target fundamentally different philosophies, he maintains that the industry must be daring enough to build new foundations.
Lars Bak delivers his critique of conservative web development: > “That's a Stockholm syndrome, right: if you always look backwards, you don't innovate.”
Lars connects that mindset directly to the skepticism his team overcame while creating the V8 engine: > “So when we did V8, right, it was like, ‘Why do we need fast performance? All the programs are running fine’—I just think that's stupidity, right, so it all boils down to that if you don't innovate and try something new, the application developers cannot innovate.”
Lars concludes with an open-minded outlook on ecosystem diversity: > “I'm very happy about TypeScript; I think anything that tries to innovate in the web space is great, and it's not something that if you do that, we cannot do the other—I think there's room for several solutions.”
[40:53](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2453s) Language Diversity and Developer Choice on the Web
Lars Bak reflects on the growing ecosystem of web programming languages, noting that there are already tons of languages that compile down to JavaScript. In his view, "the more the merrier because at the end of the day it'll be the programmers out there that will make the decision what kind of language you can use." He points out that this mirrors the software development landscape from twenty years earlier, where developers had a wide spectrum of languages at their disposal rather than being constrained to a single option. He emphasizes that nobody should try to shoehorn developers into working with just one language.
The interviewer agrees, emphasizing that languages are simply tools in a developer's toolbox, while the web itself serves as the common runtime. The fundamental challenge for developers is to determine how best to take advantage of the platform shifts happening around them, acknowledging that both Bak and Anders Hejlsberg are doing fantastic work tackling these challenges from their respective angles.
[41:34](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2494s) Open Source Commitments: Freeing the Web and Community Adoption
Bak underscores that Dart, much like TypeScript, is developed completely in the open. Dart includes both a dedicated virtual machine and a compiler targeting JavaScript, and Bak explains that Google open-sourced the virtual machine intentionally so that any platform or vendor can adopt it if they appreciate its execution characteristics. He makes it clear that the Dart team has no interest in building closed or proprietary silos, stating, “we are certainly not trying to come up with a proprietary technology here, we're trying to sort of free the web basically.”
The interviewer notes as a counterbalance that TypeScript embraces that exact same open-source ethos and is not locked exclusively to Visual Studio or Windows. He points out that support had just rolled out for multiple editors outside the Microsoft ecosystem, including Vim and Emacs, demonstrating a cross-platform mindset across both projects. Hejlsberg shares that he is genuinely excited about the open-source reception, mentioning with a grin that right before sitting down for the interview, he checked the repository and saw nine forks had already been created of the TypeScript repo. Wrapping up the discussion, the interviewer looks forward to revisiting the conversation in a year to see how the web landscape evolves. Bak jokes, “we hope we are both in the business in a year,” before the group exchanges warm congratulations and parts with a cheer.
- Both Dart and TypeScript are fully open source, designed to run across multiple environments rather than remaining proprietary or locked to a specific vendor's IDE. - Dart provides both an open virtual machine and a source-to-source compiler targeting JavaScript. - TypeScript shipped with community-oriented editor integration beyond Visual Studio, including support for Vim and Emacs. - Anders Hejlsberg noted that the TypeScript repository had already accumulated nine forks immediately after its launch.
## Notable quotes > [28:43](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=1723s) Static typing is a dial, you know, and you can put the dial in different places. — Anders Hejlsberg
> [04:58](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=298s) I think we all experience when you do big JavaScript applications they turn into spaghetti code and they're very hard to maintain. — Lars Bak
> [02:00](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=120s) It wouldn't make a lot of sense for us to have a different model of classes from what ultimately ends up in ECMAScript 6. — Anders Hejlsberg
> [39:23](https://www.youtube.com/watch?v=5AqbCQuK0gM&t=2363s) If you always look backwards, you don't innovate. — Lars Bak
## Mentioned Anders Hejlsberg, Lars Bak, Brendan Eich, Steve Lucco, TypeScript, Dart, JavaScript, CoffeeScript, C#, Java, Smalltalk, C++, D, V8, Chakra, Internet Explorer, Google Chrome, Google, Microsoft, TC39, ECMAScript, ECMAScript 6, ECMAScript 5, ECMAScript 4, ECMAScript 3, jQuery, Node.js, Google Closure Compiler, Google Web Toolkit, Script#, Visual Studio, Vim, Emacs, Channel 9, GOTO Aarhus
## Video description Lars Bak and Anders Hejlsberg talk about Dart, TypeScript and JavaScript with Channel 9 while attending GOTO2012 in Aarhus.
[Source](https://www.youtube.com/watch?v=5AqbCQuK0gM)