Master’s Thesis Presentation • Programming Languages • Type-Aware Optimizations with Imperfect TypesExport this event to calendar

Friday, April 26, 2024 — 4:00 PM to 5:00 PM EDT

Please note: This master’s thesis presentation will take place in DC 2314 and online.

Jeremiah Ikosin, Master’s candidate
David R. Cheriton School of Computer Science

Supervisor: Professor Gregor Richards

JavaScript, a programming language originally designed for web browsers, has become ubiquitous, experiencing adoption across multiple platforms. Its dynamic type system and prototype-based object orientation are well-known properties which make the language applicable to several programming paradigms, particularly functional and object-oriented programming. However, issues such as global scope pollution, implicit type conversion, the absence of native null safety features, and the complexities of asynchronous callback structures, among others, make the language difficult to work with. To address these challenges, particularly within the context of large-scale application development, TypeScript was introduced.

TypeScript incorporates a structural type system and compiles to JavaScript. The design objective was to ensure seamless interoperability with JavaScript, incorporating various ergonomic features, notably static typing. TypeScript introduces improved tooling, IDE support, ES6 features with extensions, and compatibility with existing JavaScript code. Despite these advantages, TypeScript deliberately refrains from optimizing its JavaScript output. Although JavaScript’s flexibility can often be useful in practice, a naive implementation of the language would be slow. Modern JavaScript engine implementations are intricate systems that employ cutting-edge optimization techniques to achieve efficient executions.

This thesis introduces a method for improving the runtime performance of JavaScript by utilizing type information from TypeScript. It categorizes TypeScript types based on usage into two groups: nominal (similar to classes in Java) and non-nominal (structural or arbitrary). Although TypeScript’s type system is inherently unsound, types tend to be consistent in most nominal use cases. This characteristic renders a significant proportion of type information amenable to optimization with reasonable guarantees.

Subsequently, the TypeScript compiler (tsc) is modified to leverage nominal type usage for optimizations. This modification produces optimized code through the utilization of enhanced heuristics for runtime optimizations. Additionally, the integration of WebKit’s JavaScript engine, JavaScriptCore (JSC), involves the introduction of a new runtime intrinsic specifically designed to utilize type information from TypeScript.

Performance is assessed by comparing JavaScript programs from the JetStream 2.1 JavaScript test suite with equivalent programs ported to TypeScript. These TypeScript programs are then compiled to JavaScript using the modified TypeScript compiler in two modes: with optimizations enabled and with optimizations disabled. The results show that adopting a nominal typing style in TypeScript leads to improved performance in the resulting JavaScript when compiled with optimizations enabled, across nearly all test cases.


To attend this master’s thesis presentation in person, please go to DC 2314. You can also attend virutally using Zoom at https://uwaterloo.zoom.us/j/91781811845.

Location 
DC - William G. Davis Computer Research Centre
Hybrid: DC 2314 | Online master’s thesis presentation
200 University Avenue West

Waterloo, ON N2L 3G1
Canada
Event tags 

S M T W T F S
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
  1. 2024 (163)
    1. August (2)
    2. July (3)
    3. June (17)
    4. May (23)
    5. April (41)
    6. March (27)
    7. February (25)
    8. January (25)
  2. 2023 (296)
    1. December (20)
    2. November (28)
    3. October (15)
    4. September (25)
    5. August (30)
    6. July (30)
    7. June (22)
    8. May (23)
    9. April (32)
    10. March (31)
    11. February (18)
    12. January (22)
  3. 2022 (245)
  4. 2021 (210)
  5. 2020 (217)
  6. 2019 (255)
  7. 2018 (217)
  8. 2017 (36)
  9. 2016 (21)
  10. 2015 (36)
  11. 2014 (33)
  12. 2013 (23)
  13. 2012 (4)
  14. 2011 (1)
  15. 2010 (1)
  16. 2009 (1)
  17. 2008 (1)