代码迁移
Search documents
50万行代码不敢交给AI?TypeScript之父直言:它就像是个“高级复读机”
3 6 Ke· 2026-01-30 13:08
Core Insights - The inventor of TypeScript, Anders Hejlsberg, emphasizes that existing programming languages are better suited for AI programming not due to their advancement but because they possess the largest training datasets [1] - He describes current large models as advanced "repeaters" that essentially regurgitate previous work with minor extrapolations [1] TypeScript 7.0 Core Upgrade - TypeScript 7.0 introduces a native compiler, which is currently in preview, promising a performance increase of 10 times [3] - The previous TypeScript compiler was written in TypeScript itself and ran on the V8 JavaScript engine, but performance limitations necessitated this upgrade [3] - The new compiler aims to maintain output consistency with the old compiler, including historical quirks, to avoid migration issues [4] Language Selection Controversy - The decision to implement the native compiler in Go instead of Rust or C sparked controversy within the TypeScript community [5] - Rust was ruled out due to its lack of support for necessary data structures and garbage collection, while C was initially considered but ultimately not chosen [5] - Hejlsberg believes the choice of Go was correct, despite community skepticism regarding the decision not to use C [5] AI in Code Migration - Initial attempts to use AI for migrating TypeScript code to Go were deemed unsuccessful, as AI-generated outputs often lacked the required certainty [6] - Hejlsberg suggests that AI should be used to create tools that assist in migration rather than directly translating code [6] - AI's effectiveness is recognized in specific tasks, such as migrating new pull requests to the Go codebase after the initial migration [6] Future of TypeScript - TypeScript will continue to follow JavaScript's standardization process while enhancing its type system features [7] - Significant changes are expected to occur in the toolchain rather than the language itself, as AI transforms development tools [8] - Hejlsberg notes that AI is evolving from a plugin to a core tool for developers, necessitating robust language service support [8] Origin of TypeScript - TypeScript was conceived to address the limitations of JavaScript rather than to create a new language, stemming from the needs of the Outlook Web team [9] - The decision to migrate the compiler to Go reflects a recognition of performance limitations within TypeScript itself [9]