TypeScript – Popular, enterprise ready and an ideal option for AI application development
TL;DR:
- We see parallels between Java and TypeScript in their enterprise-adoptability and enterprise-friendliness. The introduction of Java led to the creation of multi-billion-dollar businesses like Databricks, Confluent, and Atlassian. We anticipate that TypeScript will do the same
- This tide change will be driven by AI. While Python is still the go-to language for AI training and development workflows, TypeScript is becoming the language of choice for AI application development
- We are excited to see open-source projects and companies that offer TypeScript-first AI application development frameworks
Context
TypeScript is here and on the upswing—that is our main takeaway from our conversations with practitioners and engineers leading up to and at the TypeScript Congress 2023 conference. This is supported by research on programming language trends: According to JetBrains’ recent Developer Survey, TypeScript’s user share tripled from 12% in 2017 to 34% in 2022 and 2023.
TypeScript: JavaScript made enterprise friendly
TypeScript is a superset of the JavaScript programming language, which means that it is a language that “extends” JavaScript by offering new features and capabilities. A key differentiation of TypeScript is that it helps developers be more explicit about the types of data that are used in code. As a result, TypeScript’s tagline is “JavaScript that scales” because these types embed context: types enable developers to get up to speed on codebases more quickly, collaborate with other teams more effectively, and to catch bugs earlier on in the development process. We believe that Typescript’s enterprise friendly scalability isn’t its only benefit: its effectiveness with the modes of computation required for AI applications will mean that it is increasingly important, as more and more developers set out to leverage LLMs.
Big languages, big potential
When we kicked off this round of research into the latest in the TypeScript ecosystem, we asked ourselves: can we expect TypeScript to be transformational enough that it will be as defining a technological moment as Java was? Java became a standard that set off a retooling event and resulted in the emergence of a class of multi-billion-dollar businesses like Databricks, Confluent, and Atlassian, and accelerated the growth of companies like Apple and Netflix. At its peak, Java captured over 50% of the developer market, and as more enterprises continued to adopt Java, new tooling was created to integrate with it. We argue that data infrastructure was the greatest beneficiary of the Java retooling, as the language was instrumental in the creation of data infrastructure projects like Spark, Kafka, Hadoop, and Cassandra.
Like Java, TypeScript is evolving as a standard, and we think it has the potential to disrupt existing tooling on the market. The biggest parallel is in enterprise-readiness as both languages have seen impressive adoption at the enterprise level.
With that in mind, who stands to benefit the most from the TypeScript retooling? While Vercel (the TypeScript web-app hosting behemoth) has already emerged as one potential disruptor, we see opportunities for TypeScript beyond the front-end.
TypeScript: for AI applications
The TypeScript for AI paradigm is a compelling one. Web application developers who want to use LLMs naturally turn to TypeScript.
Shawn Wang, a leader in the AI Engineering community, writes in his Latent Space newsletter,
Data / AI is traditionally extremely Python centric, and the first AI engineering tools like LangChain, LlamaIndex, and Guardrails arose out of that same community. However, there are at least as many JavaScript developers as Python developers, so now tools are increasingly catering to this widely expanded audience.
We still see Python as the go-to language for AI training and development workflows, because ML frameworks and libraries like PyTorch and TensorFlow are geared toward Python developers, and we don’t see this changing—AI engineers live in these languages.
But for AI application development, we believe TypeScript is becoming a front-runner.
We believe TypeScript is suitable for these applications because it offers asynchronous programming and strict types (although types loosely exist in Python), which can enable developers who are building user facing applications to do so in ways that are performant (i.e., they keep running while the LLM is thinking).
In a typical program, there are certain things that often take time, like making an API call to an external service. TypeScript’s suitability for asynchronous programming provides a solution by enabling tasks to run concurrently and processing responses as they come in. Although Python does offer async / await benefits, based on our discussions with developers, we believe many find that it’s tacked on as an afterthought rather than a core element of the language.
We think TypeScript is not only useful for browser applications, but also for native applications and server applications. “Server on the edge” is one such development that companies including Cloudflare, Vercel, and Lambda@Edge are offering. Many of these support TypeScript / JavaScript natively.
The Future of TypeScript
We are excited about companies that are building tooling for the next iteration of the TypeScript ecosystem, a TypeScript 2.0. We believe emerging runtimes like Bun stand to replace Node.js to make server-side and serverless TypeScript applications faster and better. We have also come across companies that are aiming to redefine categories like alerting, authentication, and email for this new architectural shift.
Most notably, we see potential for TypeScript to play a role in the evolution of the AI infrastructure ecosystem as developers across the stack start building applications with LLMs. Based on our conversations with practitioners, we believe that web application developers, not ML engineers, are increasingly being asked to run point on implementing AI applications at the enterprise. We anticipate that the language will only grow in popularity as more developers discover that it enables reactivity and offers LLMs more context and guarantees.
We believe the existing tooling for AI application development will need to evolve beyond Python. While they offer TypeScript versions, LangChain and LlamaIndex are centered around Python. It seems to us that these companies are actively seeking to remedy this by improving support for TypeScript. LangChain offers LangChain.js, and LlamaIndex offers LlamaIndex.TS and its new chat.llamaindex.ai application is built entirely on top of the TypeScript library. We are excited about frameworks like Axflow that offer a TypeScript-first approach to support the full lifecycle of AI applications including model abstractions, prompt management, dataset management, and more. We anticipate that TypeScript driven frameworks will grow into the default for embedding AI in applications.
We also believe that more established players are already making moves here. For example, Vercel launched the Vercel AI SDK in June 2023 that is an open-source library geared toward helping developers build streaming, conversational, and chat user interfaces in JavaScript and TypeScript. Microsoft (the creator of TypeScript) released TypeChat, a library that allows developers to build natural language interfaces with types.
We think TypeScript is proving itself to be popular, scalable, and enterprise ready. Java did that too. So, is TypeScript the next Java? We think it has the potential to be and AI stands to benefit from it.