VOOZH about

URL: https://thenewstack.io/typescript-and-the-power-of-a-statically-typed-language/

⇱ TypeScript and the Power of a Statically-Typed Language - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2022-02-08 13:36:14
TypeScript and the Power of a Statically-Typed Language
podcast,the-new-stack-makers,
Software Development / TypeScript

TypeScript and the Power of a Statically-Typed Language

In this latest edition of The New Stack Makers podcast, we spoke with a few of TypeScript's designers and maintainers to learn a bit more about the design of the language.
Feb 8th, 2022 1:36pm by Joab Jackson and Darryl K. Taft
👁 Featued image for: TypeScript and the Power of a Statically-Typed Language

If there is a secret to the success of TypeScript, it is in the type checking, ensuring that the data flowing through the program is of the correct kind of data. Type checking cuts down on errors, sets the stage for better tooling, and allows developers to map their programs at a higher level. And TypeScript itself, a statically-typed superset of JavaScript, ensures that an army of JavaScript programmers can easily enjoy these advanced programming benefits with a minimal learning curve.

In this latest edition of The New Stack Makers podcast, we spoke with a few of TypeScript’s designers and maintainers to learn a bit more about the design of the language: Ryan Cavanaugh, a principal software engineering manager for Microsoft; Luke Hoban, chief technology officer for Pulumi, who was one of the original creators of TypeScript, and; Daniel Rosenwasser, senior program manager, Microsoft. TNS editors Darryl Taft and Joab Jackson hosted the discussion.

TypeScript and the Power of a Statically-Typed Language

TypeScript came about within Microsoft in 2012 as a way to help their  C++ or C# developers to write large-scale web applications, recalled Hoban, who was then part of the developer tools group at Microsoft.

The natural choice was to use JavaScript, the dominant language for the web. But JavaScript didn’t offer much tooling to help developers organize, assist and check their code writing. Various early solutions worked on by Microsoft and other web-scale companies were mostly efforts to compile traditional languages such as C++ into JavaScript, though this left developers at “an arm’s length from the platform,” Hoban said.

They wanted to develop a language that had the “ability to express types into the syntax as a lightweight extension to JavaScript, but …  still offer as much sort of inference as possible, so that you need to use those annotations sort of as infrequently as possible,” Hoban said.

The answer came in making a superset of JavaScript that would be fully compatible with JavaScript and can be transpiled into JavaScript for full browser compatibility. To add rigor, it came with additional type checking. But it would be a nuanced form of type checking that wasn’t too painful to the developer.

The developers of the project are proud of the flexibility that TypeScript offers. Simply mandating that the developer assign a previously-defined type to each variable would be overkill, they admitted. A developer may want to do something tricky, like create a function that makes identical copies of an object, but with the property names all in lower case. The type system had to support this complexity.

“We have a lot of expressivity in our type system,” Cavanaugh said. “We built up many constructs over time in the type system to the point where when you create a type, you’re actually kind of running it through a mini programming language within our type system.”

The development team hopes to have recently implemented recursive typing, where a custom type may be a set number of programming rules.

“We’re trying to enable the right patterns where you’re actually able to express what your JavaScript is doing at runtime. We don’t want people to go overboard, but we’re trying not to like get them stuck in some cases,” Cavanaugh said.

TypeScript now implements a control flow-based type analysis for local variables and parameters. For this, the design team conducted code flow analysis to better understand how data types were being used so TypeScript “just kind of automagically picks up how the types are flowing through your program, so you’re just really writing JavaScript at the end of the day,” Cavanaugh said. (Despite the benefits of type checking, it may be a while if it ever finds itself into JavaScript itself, our panelists agreed. Basic type checking would be easy enough for the browser, but the most complex evaluations would be difficult to implement in runtime. )

With TypeScript, developers are able to map out their programs at a much larger scale, in a way that makes sense to others joining the project later on. “So you’re starting to see much richer and more complex applications which would not have been possible otherwise,” Cavanaugh noted. TypeScript is used across Microsoft for most of all of its web applications, for instance. It is a favorite among JavaScript framework developers, including Angular.js. Slack used Typescript to build its desktop client. It is an integral part of Figma, a popular open source web design tool.

But it can also be used for smaller projects as well. Rosenwasser recalled writing a small script for a one-time project. Initially, he chose JavaScript so he didn’t have to go through the transpiler step. He got caught up trying to find an elusive bug, however. He ran the code through the TypeScript ts-check tool and immediately found the error.

The typing also helps with security. Built for a hostile web environment, JavaScript already has good built-in security, with built-in memory security and a bevy of runtime checks. Where Typescript helps is that it shows and prevents higher-level logic errors, especially those that can come from incorrectly handling input data.

“Data corruption can lead to a security problem. And making sure that you’re like always calling things the right way is just as part of that,” Cavanaugh said.

TRENDING STORIES
Joab Jackson is a senior editor for The New Stack, covering cloud native computing and system operations. He has reported on IT infrastructure and development for over 30 years, including stints at IDG and Government Computer News. Before that, he...
Read more from Joab Jackson
Darryl K. Taft covers DevOps, software development tools and developer-related issues from his office in the Baltimore area. He has more than 25 years of experience in the business and is always looking for the next scoop. He has worked...
Read more from Darryl K. Taft
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Simply.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.