CE-16.02

Title: 

Extension to TypeScript

Author(s): 

Jie Dong

Oral Defence Date: 

01/08/2016

Location: 

TH 434

Committee: 

Profs. Arno Puder and James Wong

Abstract: 

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.

Keywords: 

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

Copyright: 

Jie Dong