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: 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 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 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.
ts-check tool and immediately found the error.
“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.