TypeScript’s momentum is unmistakable. Conversations with engineers and insights from the TypeScript Congress 2023 highlight its growing prominence. JetBrains’ Developer Survey shows TypeScript’s user share has tripled from 12% in 2017 to 34% in 2022 and 2023.

**TypeScript: Scaling JavaScript **

As a superset of JavaScript, TypeScript extends the language by adding static typing. This enhancement allows developers to explicitly define data types, embedding context directly into the code. The result is “JavaScript that scales”. Reflecting on Java’s history, it became a standard that triggered a massive retooling across industries, leading to the rise of Databricks, Confluent, and Atlassian. Java’s influence was particularly profound in data infrastructure, underpinning projects like Spark, Kafka, Hadoop, and Cassandra. Similarly, TypeScript is evolving into a standard with the potential to disrupt existing tooling. Both languages share impressive enterprise adoption rates. The key question is: who will benefit most from this TypeScript retooling? While Vercel has emerged as a significant player, opportunities for TypeScript extend beyond front-end development. The intersection of TypeScript and AI is particularly intriguing; developers incorporating LLMs naturally gravitate towards TypeScript. Shawn Wang notes in his Latent Space newsletter that while AI has been Python-centric, there’s a burgeoning audience of JavaScript developers entering the AI space, prompting tools to cater to this expanded demographic. While Python remains the go-to for AI training due to frameworks like PyTorch and TensorFlow, TypeScript is gaining traction in AI application development. Its support for asynchronous programming and strict typing makes it ideal for building performant, user-facing applications that interact with AI models.

The Advantage of Asynchronous Programming

Asynchronous programming is crucial when dealing with time-consuming operations like API calls. TypeScript excels here by allowing tasks to run concurrently and processing responses as they arrive, enhancing application responsiveness. While Python offers async/await, many developers feel it’s less integral to the language compared to TypeScript. TypeScript’s utility isn’t confined to browser applications; it’s also effective for native and server applications. The rise of “server on the edge” solutions from companies like Cloudflare, Vercel, and AWS Lambda@Edge which natively support TypeScript/JavaScript underscores this versatility.

TypeScript’s Role in AI Infrastructure

Excited about the evolution of the TypeScript ecosystem, particularly with emerging runtimes like Bun poised to replace Node.js, enhancing server-side and serverless applications. Companies are redefining categories like alerting, authentication, and email to align with this new architectural paradigm. Existing AI development tools centered around Python will need to adapt. While LangChain and LlamaIndex have TypeScript versions, they originated in Python. Efforts are underway to improve TypeScript support, with LangChain.js and LlamaIndex.TS (whose new chat.llamaindex.ai is entirely built on the TypeScript library). Frameworks like Axflow are emerging, offering a TypeScript-first approach to AI application development, encompassing model abstractions, prompt management, dataset handling, and more. One could foresee that TypeScript-driven frameworks will become the default for embedding AI in applications. Established players are already moving in this direction. Vercel’s AI SDK, launched in June 2023, is an open-source library designed to help developers build streaming, conversational, and chat interfaces using JavaScript and TypeScript. Microsoft, the creator of TypeScript, introduced TypeChat, a library enabling developers to build natural language interfaces with type safety.

TypeScript has the potential to be as transformative as Java was for previous generations.