UHG
Search
Close this search box.

Will TypeScript Wipe Out JavaScript? 

About 92% of TypeScript developers use JavaScript, with 40% choosing it as one of their primary languages.

Share

Illustration by Amit Raja Naik

Listen to this story

TypeScript has become ubiquitous with web development. In the past 12 years since its release, developers around the world have adopted it, as the faster and simpler version of JavaScript. 

Created by Microsoft, the language is used internally in the development of Visual Studio Code and Office 365 suite, among other products. Angular, which is Google’s open-source web application framework based on TypeScript, is widely used by YouTube, Google Cloud etc. 

Amazon also builds its business logic of AWS Construct Library packages in TypeScript, while also providing mappings into each of the supported programming languages.

To prove this in numbers, GitHub last week released the innovation graph tracking different parameters over the past four years and TypeScript went from the 11th position to the 4th as the most used language on the platform

Such rapid rise in popularity is also attributed to JavaScript, the language which it is the superset of. TypeScript adds static typing to JavaScript, allowing developers to create more robust, maintainable code.

Built to plug the holes in JavaScript, the new features allowed it to be a more strongly typed language, which appealed more to classical developers. Andres Hjlesberg, the chief architect at Microsoft, said, “In JavaScript, there’s no notion of modules or a type system.” 

According to him, TypeScript shines in supporting large codebases and a large number of people collaborating on those codebases. “JavaScript wasn’t designed to be a programming language to do any of this,” said Hjlesberg. 

A better JavaScript

It is accepted that TypeScript is better, mostly because it comes with unique features such as enums for clearer and more maintainable code, absent in JavaScript. It also offers robust type-checking and interfaces that help organise code more logically. These features are compiled into standard JavaScript, ensuring compatibility with web browsers.

The language further addresses JavaScript’s limitations by offering a systematic and predictable coding environment, making it easier to develop large-scale applications and collaborate on complex projects.

One key advantage of TypeScript is its powerful tooling, enabled by the type system, which defines what types of data can be used and how. “TypeScript is not just a language, it’s an entire set of tooling all around JavaScript,” Hejlsberg noted.

Another TypeScript’s feature is the type-inference, which is a powerful feature that allows the compiler to automatically deduce the types of variables and expressions based on their usage. Developers don’t always have to explicitly specify types, making the code more concise and readable. 

The language is compatible with existing JavaScript libraries. This means developers can gradually introduce TypeScript into their projects without having to rewrite everything from scratch. 

Apart from all its powerful features, the partnership with Angular has helped drive the numbers. Hjlesberg further pointed out, “Lots of other frameworks are using TypeScript at this point. Aurelia, Ionic, NativeScript are all, in one way or another, involved in TypeScript. The Ember framework, the Glimmer framework that was just released, is written in TypeScript.”

A JetBrains developer report of 2023 also noted that the language almost tripled over the course of six years, increasing from 12% in 2017 to 34% in 2022.  The question then had to be asked, will it eventually replace JavaScript? 

The report addresses this by saying, “Though it is rapidly catching up to JavaScript, the usage of JavaScript remains stable and high. About 92% of TypeScript developers use JavaScript, with 40% choosing it as one of their primary languages.”

The Future of TypeScript

TypeScript continues to evolve, with the team focusing on making it faster and more expressive. One challenge they are addressing is consuming unstructured responses from large language models (LLMs). 

Hejlsberg introduced TypeChat, a project that connects natural language to programming. “It’s about a pragmatic project to connect natural language to the world of programming and data structures,” said Hejlsberg.

TypeChat helps developers create structured interactions with LLMs. “We ask the models to fit the JSON into a schema and the way we tell the model about the schema is that we give it some TypeScript source code,” explained Hejlsberg. 

By providing a TypeScript schema, developers can define the expected structure of the JSON data returned by the LLM.

Another development is the “isolated declaration emit” feature, a collaboration with Bloomberg and Google. 

Daniel Rosenwasser the principal product manager at Microsoft explained, “The idea with isolated declaration emit is that each ‘public’ part of your module’s API needs to have a type annotation. When that guarantee is in place, it means that TypeScript doesn’t have to do any type-checking to generate outputs.”

Looking ahead, Rosenwasser noted, “We have heard developers want to run TypeScript with no friction — no build step if possible.” The TypeScript team is working towards this goal while seeking community feedback. Looking at the popularity the TypeScript has gained over the years, it is possible that it would overtake its parent language. 

📣 Want to advertise in AIM? Book here

Picture of K L Krithika

K L Krithika

K L Krithika is a tech journalist at AIM. Apart from writing tech news, she enjoys reading sci-fi and pondering the impossible technologies, trying not to confuse it with reality.
Related Posts
Association of Data Scientists
Tailored Generative AI Training for Your Team
Upcoming Large format Conference
Sep 25-27, 2024 | 📍 Bangalore, India
Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

Flagship Events

Rising 2024 | DE&I in Tech Summit
April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore
Data Engineering Summit 2024
May 30 and 31, 2024 | 📍 Bangalore, India
MachineCon USA 2024
26 July 2024 | 583 Park Avenue, New York
MachineCon GCC Summit 2024
June 28 2024 | 📍Bangalore, India
Cypher USA 2024
Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA
Cypher India 2024
September 25-27, 2024 | 📍Bangalore, India
discord icon
AI Forum for India
Our Discord Community for AI Ecosystem, In collaboration with NVIDIA.