Master’s Thesis Presentation • Programming Languages • Efficient Implementation of Parametric Polymorphism using Reified TypesExport this event to calendar

Friday, April 21, 2023 — 2:00 PM to 3:00 PM EDT

Please note: This master’s thesis presentation will take place in DC 3317.

Matt D’Souza, Master’s candidate
David R. Cheriton School of Computer Science

Supervisor: Professor Ondřej Lhoták

Parametric polymorphism, also known as generics, is an abstraction that lets programmers define code that behaves independently of the types of values it operates on. Generics is a useful abstraction to enable code reuse and improve the maintainability of software projects.

The approach that a language implementation uses to support parametric polymorphism can have important performance implications. One such approach, erasure, converts generic code to non-generic code that uses a uniform representation for generic data. Erasure is notorious for introducing primitive boxing and other indirections that harm the performance of generic code. More generally, erasure destroys type information that could be used by the language implementation to optimize generic code.

This thesis presents TastyTruffle, a new interpreter for the Scala language. Whereas the standard Scala implementation executes erased Java Virtual Machine (JVM) bytecode, TastyTruffle interprets TASTy, a different representation that has precise type information. This thesis explores how the type information present in TASTy empowers TastyTruffle to implement generic code more effectively. In particular, TASTy’s type information allows TastyTruffle to reify types as objects that can be passed around the interpreter. These reified types are used to support heterogeneous box-free representations of generic values. Reified types also enable TastyTruffle to create specialized, monomorphic copies of generic code that can be easily and reliably optimized by its just-in-time (JIT) compiler.

Empirically, TastyTruffle is competitive with the standard JVM implementation. Both implementations perform similarly on monomorphic workloads, but when generic code is used with multiple types, TastyTruffle consistently outperforms the JVM. TASTy’s type information enables TastyTruffle to find additional optimization opportunities which could not be uncovered with erased JVM bytecode alone.

Location 
DC - William G. Davis Computer Research Centre
DC 3317
200 University Avenue West

Waterloo, ON N2L 3G1
Canada
Event tags 

S M T W T F S
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
  1. 2024 (118)
    1. May (4)
    2. April (37)
    3. March (27)
    4. February (25)
    5. 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)