Extension to TypeScript


Jie Dong

Oral Defence Date: 



TH 434


Profs. Arno Puder and James Wong


JavaScript is the programming language for the web. It is dynamically typed, which makes it more difficult to check for programming errors and to execute efficiently. TypeScript is a superset of JavaScript and it adds static typing as well as interface and class types to JavaScript. In our work, we extend TypeScript’s type system by adding ten primitive types and one object type (the struct type), to increase type safety and execution speed. The main focus of this thesis will be the struct type that bridges TypeScript with Typed Objects, and it features nominal typing, inheritance and fixed size array. We designed the syntax and semantics of the struct type to be aligned with C++ struct type, the class type in TypeScript and Typed Objects. We also designed a test suite (including static tests and dynamic tests) to verify the struct type behavior. In order to quantitatively measure the effectiveness of the test suite, we conducted code coverage tests on the struct type related compiler code. The results showed that over 99% of the code is executed from running the test suite. We also used standard benchmarks to compare the performance of our extension to the original TypeScript, and results showed that code written using our extension runs much faster than using the regular TypeScript.


Compiler, Nominal Typing, Static Typing, TypeScript, JavaScript, Typed Objects.


Jie Dong