<?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-23T01:41:57Z</responseDate><request verb="GetRecord" identifier="oai:uwspace.uwaterloo.ca:10012/10856" metadataPrefix="dim">https://dspacemainprd01.lib.uwaterloo.ca/server/oai/request</request><GetRecord><record><header><identifier>oai:uwspace.uwaterloo.ca:10012/10856</identifier><datestamp>2025-03-26T23:38:33Z</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">Lhoták, Ondřej</dim:field>
   <dim:field mdschema="dc" element="contributor" qualifier="author" authority="d1e5aa70-e7a9-4dbd-b844-982613b3a846" confidence="600">Yee, Ming-Ho</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="accessioned">2016-09-15T20:40:45Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="available">2016-09-15T20:40:45Z</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="issued">2016-09-15</dim:field>
   <dim:field mdschema="dc" element="date" qualifier="submitted">2016-09-13</dim:field>
   <dim:field mdschema="dc" element="identifier" qualifier="uri">http://hdl.handle.net/10012/10856</dim:field>
   <dim:field mdschema="dc" element="description" qualifier="abstract" lang="en">Static program analysis is a powerful technique for maintaining software, with&#xd;
applications such as compiler optimizations, code refactoring, and bug finding.&#xd;
Static analyzers are typically implemented in general-purpose programming&#xd;
languages, such as C++ and Java; however, these analyzers are complex and&#xd;
often difficult to understand and maintain. An alternate approach is to use&#xd;
Datalog, a declarative language. Implementors can express analysis constraints&#xd;
declaratively, which makes it easier to understand and ensure correctness of the&#xd;
analysis. Furthermore, the declarative nature of the analysis allows multiple,&#xd;
independent analyses to be easily combined.&#xd;
&#xd;
Flix is a programming language for static analysis, consisting of a logic&#xd;
language and a functional language. The logic language is inspired by&#xd;
Datalog, but supports user-defined lattices. The functional language allows&#xd;
implementors to write functions, something which is not supported in Datalog.&#xd;
These two extensions, user-defined lattices and functions, allow Flix to&#xd;
support analyses that cannot be expressed by Datalog, such as a constant&#xd;
propagation analysis. Datalog is limited to constraints on relations, and&#xd;
although it can simulate finite lattices, it cannot express lattices over an&#xd;
infinite domain. Finally, another advantage of Flix is that it supports&#xd;
interoperability with existing tools written in general-purpose programming&#xd;
languages.&#xd;
&#xd;
This thesis discusses the implementation of the Flix functional language,&#xd;
which involves abstract syntax tree transformations, an interpreter back-end,&#xd;
and a code generator back-end. The implementation must support a number of&#xd;
interesting language features, such as pattern matching, first-class functions,&#xd;
and interoperability.&#xd;
&#xd;
The thesis also evaluates the implementation, comparing the interpreter and code&#xd;
generator back-ends in terms of correctness and performance. The performance&#xd;
benchmarks include purely functional programs (such as an N-body simulation),&#xd;
programs that involve both the logic and functional languages (such as matrix&#xd;
multiplication), and a real-world static analysis (the Strong Update analysis).&#xd;
Additionally, for the purely functional benchmarks, the performance of Flix&#xd;
is compared to C++, Java, Scala, and Ruby.&#xd;
&#xd;
In general, the performance of compiled Flix code is significantly faster&#xd;
than interpreted Flix code. This applies to all the purely functional&#xd;
benchmarks, as well as benchmarks that spend most of the time in the functional&#xd;
language, rather than the logic language. Furthermore, for purely functional&#xd;
code, the performance of compiled Flix is often comparable to Java and Scala.</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">computer science</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">programming languages</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">static analysis</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">language implementation</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">program analysis</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">flix</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">pattern matching</dim:field>
   <dim:field mdschema="dc" element="subject" lang="en">closures</dim:field>
   <dim:field mdschema="dc" element="title" lang="en">Implementing a Functional Language for Flix</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" element="contributor" qualifier="advisor">Lhoták, Ondřej</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>