Operating Principles Open Source and Open Development Closely track ECMAScript standard Innovate in type system Best of breed tooling Continually Lower barrier to entry Community, community, community
Design Goals Statically identify constructs that are likely to be errors. Provide a structuring mechanism for larger pieces of code. Impose no runtime overhead on emitted programs. Emit clean, idiomatic, recognizable JavaScript code. Produce a language that is composable and easy to reason about. Align with current and future ECMAScript proposals. Preserve runtime behavior of all JavaScript code. Avoid adding expression-level syntax. Use a consistent, fully erasable, structural type system. Be a cross-platform development tool. Do not cause substantial breaking changes from TypeScript 1.0. https://github.com/microsoft/TypeScript-wiki/blob/master/TypeScript-Design-Goals.md#goals
Design Goals - For JavaScript Impose no runtime overhead on emitted programs. Align with current and future ECMAScript proposals. Preserve runtime behavior of all JavaScript code. Avoid adding expression-level syntax. Use a consistent, fully erasable, structural type system. https://github.com/microsoft/TypeScript-wiki/blob/master/TypeScript-Design-Goals.md#goals
Design Goals - For Types Statically identify constructs that are likely to be errors. Provide a structuring mechanism for larger pieces of code. Produce a language that is composable and easy to reason about. Use a consistent, fully erasable, structural type system. https://github.com/microsoft/TypeScript-wiki/blob/master/TypeScript-Design-Goals.md#goals
Extinguishing JavaScript Make TypeScript a native browser language Tricky, Microsoft doesn’t “own” a browser or engine Could try pitch a pre-parse types removal like babel plugin Web not like deno, no one time cost for TS
Extinguishing JavaScript Make TypeScript differ from JavaScript TC-39 would get annoyed Users would get annoyed Someone would start a typescriptium fork
Extinguishing JavaScript Make TypeScript differ from JavaScript TC-39 would get annoyed Users would get annoyed Someone would start a typescriptium fork
Extinguishing JavaScript Make TypeScript differ from JavaScript TC-39 would get annoyed Users would get annoyed Someone would start a typescriptium fork
One of TypeScript’s primary jobs is to help you migrate from TypeScript source code to plain JavaScript. Turn it to ESNext, run the compiler, delete your ts files and you’re done.
Flow isn’t going anywhere (to my knowledge) so you can keep JS + types. People will write TypeScript to Flow tools. Hegel has TypeScript d.ts compatibility today
Loosing JS Semantics Want to make it easy to keep supporting JavaScript users The further the distance between a compile to JS language and JS, the more additional work happens at runtime
Needs to handle: - New Syntax in AST - New Emitter - Specialized error messages - Code flow analysis - Type narrowing support - Editor integration - Quick Fixes Many follow on PRs Thousands of lines of code Many many test files Not everyone can do it Optional chaining in TypeScript