<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="static/style.xsl"?><OAI-PMH xmlns="http://www.openarchives.org/OAI/2.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"><responseDate>2026-11-22T17:29:12Z</responseDate><request verb="GetRecord" identifier="oai:uwspace.uwaterloo.ca:10012/18928" metadataPrefix="dim">https://dspacemainprd01.lib.uwaterloo.ca/server/oai/request</request><GetRecord><record><header><identifier>oai:uwspace.uwaterloo.ca:10012/18928</identifier><datestamp>2025-03-26T23:38:25Z</datestamp><setSpec>com_10012_9924</setSpec><setSpec>com_10012_1</setSpec><setSpec>col_10012_9930</setSpec><setSpec>col_10012_6</setSpec></header><metadata><dim:dim xmlns:dim="http://www.dspace.org/xmlns/dspace/dim" xmlns:doc="http://www.lyncode.com/xoai" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.dspace.org/xmlns/dspace/dim http://www.dspace.org/schema/dim.xsd">
   <dim:field mdschema="dc" element="contributor" qualifier="advisor">Lhotak, Ondrej</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="author" authority="ac2c8290-2b16-4fe4-8980-0b78a0dc2e76" confidence="600">You, James</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="accessioned">2022-11-24T19:43:34Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="available">2022-11-24T19:43:34Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="issued">2022-11-24</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="submitted">2022-11-11</dim:field>
   <dim:field mdschema="dc" element="identifier" qualifier="uri">http://hdl.handle.net/10012/18928</dim:field>
   <dim:field mdschema="dc" element="description" qualifier="abstract" lang="en">Scala is a generic object-oriented programming language with higher-order abstractions. &#xd;
Programming abstractions in Scala exemplify reusability and extensibility in the context of type safety.&#xd;
In particular, generic programming allows user-defined data structures to behave identically irrespective of the types of their values while remaining free of type errors.&#xd;
&#xd;
The implementation of reusability in Scala comes at a cost; the standard implementation of Scala compiles to Java bytecode, where type erasure significantly reduces Scala program type information to create compatible Java bytecode.&#xd;
Consequently, autoboxing, operations needed when using primitive values in a generic context, are introduced into the final program. &#xd;
The current state-of-the-art techniques for eliminating boxing and achieving optimal data representations at runtime, known as specialization, rely on static program analysis.&#xd;
Such techniques must mitigate the problem of code duplication; static optimizations cannot use runtime information to best select which data structures to specialize.&#xd;
&#xd;
This thesis proposes a new approach to the specialization of Scala programs.&#xd;
The approach integrates type information from a high-level source-like input language with the mechanisms of just-in-time compilation.&#xd;
We propose an ad-hoc specialization mechanism using a whole program approach; specializations of data structures are created based on concrete type arguments.&#xd;
In our approach, specialized objects are compatible with non-specialized code.&#xd;
The thesis uses Truffle, a framework that simplifies the implementation of just-in-time compilers, to implement an experimental research prototype.&#xd;
&#xd;
We demonstrate that our approach is viable and produces improvements in throughput for simplified implementations of real-world Scala programs.&#xd;
While these programs are simple, it is still challenging for state-of-the-art approaches to specialize optimally.&#xd;
We show that our approach can improve performance by an order of magnitude in the context of polymorphic data structures and methods that use bulk storage.&#xd;
We compare the results of our approach to our interpreter without specialization and compiled Scala on GraalVM, a state-of-art Java Virtual Machine.</dim:field>
   <dim:field mdschema="dc" element="language" qualifier="iso" lang="en">en</dim:field>
   <dim:field mdschema="dc" element="publisher" lang="en">University of Waterloo</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">programming languages</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">managed runtimes</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">just-in-time compilation</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">polymorphism</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">data representation</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">java virtual machine</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">scala</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">java</dim:field>
   <dim:field mdschema="dc" element="title" lang="en">Specializing Scala with Truffle</dim:field>
   <dim:field mdschema="dc" element="type" lang="en">Master Thesis</dim:field>
   <dim:field mdschema="dc" element="pending">false</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="department" lang="en">David R. Cheriton School of Computer Science</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="discipline" lang="en">Computer Science</dim:field>
   <dim:field mdschema="uws-etd" element="degree" qualifier="grantor" lang="en">University of Waterloo</dim:field>
   <dim:field mdschema="uws-etd" element="degree" lang="en">Master of Mathematics</dim:field>
   <dim:field mdschema="uws-etd" element="embargo" qualifier="terms" lang="en">0</dim:field>
   <dim:field mdschema="uws" element="contributor" qualifier="advisor">Lhotak, Ondrej</dim:field>
   <dim:field mdschema="uws" element="contributor" qualifier="affiliation1" lang="en">Faculty of Mathematics</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="city" lang="en">Waterloo</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="country" lang="en">Canada</dim:field>
   <dim:field mdschema="uws" element="published" qualifier="province" lang="en">Ontario</dim:field>
   <dim:field mdschema="uws" element="typeOfResource" lang="en">Text</dim:field>
   <dim:field mdschema="uws" element="peerReviewStatus" lang="en">Unreviewed</dim:field>
   <dim:field mdschema="uws" element="scholarLevel" lang="en">Graduate</dim:field>
   <dim:field mdschema="others" element="access-status">open.access</dim:field>
</dim:dim>
</metadata></record></GetRecord></OAI-PMH>