The GitHub Blog 8小时前
TypeScript的崛起:从解决JavaScript痛点到AI时代主流语言
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

TypeScript的诞生源于JavaScript在大型项目中的可扩展性问题。最初,其目标是为JavaScript添加类型检查,提升开发效率和代码质量。如今,TypeScript已成为GitHub上最受欢迎的语言,尤其在AI驱动的开发环境中,其静态类型系统为AI辅助编码提供了可靠性和可维护性。从IDE到AI代理,TypeScript正重塑现代软件开发范式,展现出强大的演化能力。

💡 TypeScript的诞生与演进:TypeScript由Anders Hejlsberg于2012年创立,旨在解决JavaScript在大型、多开发者代码库中的可扩展性难题。通过引入静态类型检查、接口和现代语言特性,它极大地提高了代码的可维护性和开发效率,从一个“务实的修复”演变为现代开发的主流选择。

🚀 成为GitHub主流语言:2025年,TypeScript首次超越JavaScript和Python,成为GitHub上使用最多的语言。超过一百万开发者在这一年贡献了TypeScript代码,同比增长66%,这表明其在开发者社区中拥有广泛的应用和快速的增长势头。

🤖 AI时代的驱动力:TypeScript的静态类型系统使其成为AI辅助编码的理想选择。AI能够更好地理解和生成类型明确的代码,从而提高代码的可靠性和可维护性。AI从辅助角色转变为执行者,需要像TypeScript这样提供结构化、可预测性的语言来确保工作流程的稳定。

🛠️ 编译器重写与兼容性:为了应对性能挑战,TypeScript的编译器进行了重写,并选择了Go语言,实现了10倍的性能提升。尽管如此,新编译器在功能上与旧版完全兼容,确保了社区无需进行大规模迁移,体现了其对兼容性和演进的重视。

🌐 开源的进化力量:Anders Hejlsberg将开源比作代码中的自然选择。TypeScript的十二年发展历程,体现在GitHub上的海量issues、pull requests和设计文档中,成为语言演进的活生生档案。这种开放式的演进模式是其持续生命力的重要保障。

When Anders Hejlsberg started work on TypeScript in 2012, he wasn’t dreaming up a new language to compete with JavaScript. He was trying to solve a very real problem: JavaScript had become the backbone of the web, but it didn’t scale well for large, multi-developer codebases. Teams were shipping millions of lines of loosely typed code, and the language offered no help when those systems grew too complex to reason about.

What began as a pragmatic fix has since reshaped modern development. In 2025, TypeScript became the most-used language on GitHub, overtaking both JavaScript and Python for the first time. More than a million developers contributed in TypeScript this year alone—a 66% jump, according to Octoverse.

“I remember thinking,” he says, “maybe we’ll get 25% of the JavaScript community to take an interest—that would be success. But where we are now? I’m floored.”

In 2025, TypeScript became the most-used language on GitHub, surpassing both JavaScript and Python for the first time. According to this year’s Octoverse report, more than a million developers began contributing in TypeScript this year alone (a 66% YoY jump). 

So, how did a typed superset of JavaScript become the dominant language of the AI era? We sat down with Anders to talk about evolution, performance, and why a language built for better human collaboration is now powering machine-assisted coding.

“We thought 25-percent adoption would be a success.”

“When we started the project,” Anders says, “I figured if we got 25-percent of the JavaScript community interested, that’d be a win. But now, seeing how many people rely on it every day … I’m floored. The whole team is.”

Back in 2012, JavaScript was already entrenched. TypeScript’s bet wasn’t to replace it but to make large-scale JavaScript development sane by adding types, tooling, and refactorability to the world’s most permissive language.

It’s the joy of working on something you know is making a difference. We didn’t set out to be everywhere. We just wanted developers to be able to build big systems with confidence.

Anders Hejlsberg, creator of TypeScript

A decade later, that bet became the default. Nearly every modern frontend framework—React, Next.js, Angular, SvelteKit—now scaffolds with TypeScript out of the box. The result: safer codebases, better autocomplete, and fewer 3 a.m. debugging sessions over a rogue undefined.

“The magic was making TypeScript feel like JavaScript, but with superpowers,” Anders says.

⚙️ What exactly is TypeScript?

⚙️ What exactly is TypeScript?

TypeScript is an open source, typed superset of JavaScript that compiles to plain JavaScript. It adds static type checking, interfaces, generics, and modern language features—and then erases them at compile time so the output runs anywhere JavaScript does.

Why developers use it:

It’s used for: Frontend frameworks (React, Angular, Vue), backend systems (Node.js, Deno), SDKs, design systems, and increasingly, AI-driven agent frameworks that require strong typing to keep generated code safe.

Rewriting the compiler for the future

When TypeScript launched, it was famously self-hosted: written in TypeScript itself. That kept the compiler portable and hackable. But performance eventually became a problem.

“As much as it pained us to give up on self-hosting, we knew we couldn’t squeeze any more performance out of it,” Anders says.

We experimented with C#, with others, and finally chose Go. The performance gain was 10X. Half from being native, half from shared-memory concurrency. You can’t ignore 10X.

The rewrite delivered a compiler that’s faster, leaner, and more scalable for enterprise-scale codebases—but functionally identical to the old one.

On this note, Anders says, “We have a native compiler that’s a carbon copy of the old one down to the quirks. The community doesn’t have to throw anything away.”

This philosophy around preserving behavior while improving performance is one reason developers trust TypeScript. It’s not a clean-slate rewrite every few years; it’s an evolutionary system built to stay compatible.

“Open source is evolution captured in code.”

Anders reflects on open source as an ecosystem that mirrors natural selection.

“Open source was a big experiment,” Anders says. “No one ever really figured out how to fund it—and yet here we are. It’s bigger than ever, and it’s not going away. It’s evolution captured right there in the code.”

This year’s Octoverse data backs him up: developers pushed nearly 1 billion commits in 2025 (+25% YoY), and 1.12 billion of those were to public and open source repositories. That’s an evolutionary record written one pull request at a time.

TypeScript’s own repository with twelve years of issues, pull requests, and design notes has become a living archive of language evolution. “We have 12 years of history captured on GitHub,” Anders says. “It’s all searchable. It’s evolution you can grep.”

The AI effect: Why TypeScript is thriving now

One of the most striking data points from Octoverse 2025 is how AI is changing language preferences. Developers are moving toward typed languages that make AI-assisted coding more reliable and maintainable. 

Anders explains why: “AI’s ability to write code in a language is proportional to how much of that language it’s seen. It’s a big regurgitator, with some extrapolation. AI has seen tons of JavaScript, Python, and TypeScript so it’s great at writing them. New languages are actually disadvantaged.”

That data familiarity, combined with TypeScript’s static type system, makes it uniquely fit for an AI-first workflow.

“If you ask AI to translate half a million lines of code, it might hallucinate,” Anders says. “But if you ask it to generate a program that does that translation deterministically, you get a reliable result. That’s the kind of problem types were made for.”

The takeaway: in a world where code is written by both humans and machines, types aren’t bureaucracy. They’re truth checkers.

From IDEs to agents

The rise of large language models is also changing what “developer tools” even mean. IDEs are becoming environments not just for developers, but for agents.

AI started out as the assistant. Now it’s doing the work, and you’re supervising. It doesn’t need an IDE the way we do. It needs the services. That’s why all this Model Context Protocol work is exciting.

“AI started out as the assistant,” Anders says. “Now it’s doing the work, and you’re supervising. It doesn’t need an IDE the way we do. It needs the services. That’s why all this Model Context Protocol work is exciting.”

The Octoverse report describes this shift as “AI reshaping choices, not just code.” Typed languages like TypeScript give agents the structure they need to refactor safely, answer semantic queries, and reason about codebases in a deterministic way.

“The goal,” Anders adds, “is to box in AI workflows with just enough determinism that they stay useful without going off the rails.”

The language that keeps evolving

From Turbo Pascal to C#, and now TypeScript, Anders’ work spans decades. But what’s striking is his consistency. He builds languages that make complex software simpler to reason about.

There’s nothing more satisfying than working on something that makes a difference. TypeScript keeps changing, but it always comes back to the same thing: helping developers express intent clearly.

That clarity might explain why more than one new developer joined GitHub every second in 2025, and a growing share of them choose to start in TypeScript. 

The story of TypeScript isn’t just about language design; it’s about evolution. A project that began as a pragmatic fix for JavaScript’s scale has become the foundation for how developers—and now AI—write code together.

Read the 2025 Octoverse report or start using GitHub Copilot >

The post TypeScript’s rise in the AI era: Insights from Lead Architect, Anders Hejlsberg appeared first on The GitHub Blog.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

TypeScript Anders Hejlsberg JavaScript GitHub AI 编程语言 开源 软件开发
相关文章