1
0
mirror of https://github.com/dhil/phd-dissertation synced 2026-03-13 11:08:25 +00:00

Compare commits

..

44 Commits

Author SHA1 Message Date
Daniel Hillerström
c2d79e1d06 Fix bibliography: add missing year 2025-12-18 14:08:13 +00:00
Daniel Hillerström
47410e4d14 Fix typo in -ctrl+ rule. The delimiter is part of the reified context. 2025-12-18 14:07:59 +00:00
81a4ecec0b UNIX tutorial 2024 2024-10-11 15:45:34 +02:00
cafa8b1ba2 Merge branch 'master' of github.com:dhil/phd-dissertation 2024-02-26 09:51:21 +01:00
2e61275a5b Fix typo; fix sentence structure.
This commit fixes a typo in the type signature of `init` (thanks to
Ramsay Carslaw for spotting it). This commit also structures the last
sentence of Section 2.7 to read slightly better.
2024-02-26 09:50:56 +01:00
e90ba67a4b Update timeline 2023-09-14 09:22:21 +02:00
6aee80a71b Fix typo 2023-09-14 09:14:29 +02:00
aea67c86b4 Fix typo 2023-04-12 14:55:37 +02:00
Daniel Hillerström
5ede30903f Fix typo 2023-02-14 10:59:29 +01:00
Daniel Hillerström
03b7c5b548 Fix typo. Slightly reword an awkward sentence. 2023-02-10 14:31:37 +01:00
7535fe7ecc Fix typos in handler typing rules in the appendix 2023-01-09 17:00:38 +00:00
72b54ad278 Add missing space in 'Evaluationcontexts' in Figure 3.5 2023-01-09 14:45:32 +00:00
01e707822f Fix typo in T-Let Figure 3.4 2023-01-09 14:42:09 +00:00
2cecb13d34 Update all slides 2022-11-17 15:05:18 +00:00
ed634fcaa3 Update slides 2022-11-17 11:10:29 +00:00
c60dc80fde Update slides 2022-11-16 23:42:00 +00:00
e86597f4e4 Draft lecture notes 2022-11-16 22:02:05 +00:00
2b7b1df8db Merge branch 'master' of github.com:dhil/phd-dissertation 2022-11-15 18:01:32 +00:00
20f44ad547 Fix typo 2022-11-15 18:01:26 +00:00
101ac96aa2 NU PRL slides 2022-11-02 15:45:00 +00:00
e6182105de Merge branch 'master' of github.com:dhil/phd-dissertation 2022-10-12 23:56:05 +01:00
63fe9a738a Prepare slides for Huawei Research Centre Zurich seminar 2022-10-12 23:55:57 +01:00
3a9394baf8 Fix a minor typo 2022-07-01 01:19:43 +01:00
6193214890 Update slides 2022-05-26 18:27:32 +01:00
ffe6ebd0b9 Update MSR 2022 slides 2022-05-25 22:29:14 +01:00
01a8a3d581 Draft MSR talk 2022-05-25 22:24:31 +01:00
008e80ea67 Link to thesis.
Update README to reflect the structure of the revised thesis.
2022-03-26 00:18:14 +00:00
3276537ab1 Tweak acknowledgements 2022-03-23 14:56:41 +00:00
20551152b3 Minor tweaks and typo fixes. 2022-03-21 14:12:59 +00:00
8679803146 Fix typo 2022-03-18 14:49:58 +00:00
d7bd881a00 Update latest draft 2021-12-22 16:55:21 +00:00
f5685fe70d Chapter 8 2021-12-22 16:48:14 +00:00
7f3503153f Minor fixes 2021-12-22 16:27:14 +00:00
40c6505ae2 Simplify 2021-12-22 16:15:16 +00:00
b897751a38 Note on reduction relation 2021-12-22 16:13:22 +00:00
3e1bbf3206 Fix todo 2021-12-22 16:10:51 +00:00
40948507e9 CPS outline 2021-12-22 16:08:08 +00:00
2a800f07e2 WIP 2021-12-22 15:58:26 +00:00
d3921f24e3 WIP 2021-12-22 14:23:57 +00:00
7063acb4e7 Related work 2021-12-21 16:14:59 +00:00
c9ff1d9af8 Chapter 3 2021-12-21 16:05:12 +00:00
fff15c9c83 Section 2.6 and 2.7 2021-12-20 23:29:27 +00:00
a24a33dcf8 Section 2.5 2021-12-20 16:08:32 +00:00
6c128a1181 Section 2.4 2021-12-20 13:37:07 +00:00
9 changed files with 9286 additions and 2152 deletions

134
README.md
View File

@@ -1,16 +1,13 @@
# Foundations for programming and implementing effect handlers # Foundations for programming and implementing effect handlers
**NOTE** I have made a draft copy of the dissertation available in A copy of my dissertation can be [downloaded via my
this repository. I ask that you **do not** link to or distribute the website](https://dhil.net/research/papers/thesis.pdf).
draft anywhere, because I will delete the file once the final revision
has been submitted after the viva. I will make the final revision
publicly available at a stable link.
--- ----
Submitted May 30, 2021. Viva August 13, 2021. Submitted on May 30, 2021. Examined on August 13, 2021.
The board of examiners consists of The board of examiners were
* [Andrew Kennedy](https://github.com/andrewjkennedy) (Facebook London) * [Andrew Kennedy](https://github.com/andrewjkennedy) (Facebook London)
* [Edwin Brady](https://www.type-driven.org.uk/edwinb/) (University of St Andrews) * [Edwin Brady](https://www.type-driven.org.uk/edwinb/) (University of St Andrews)
@@ -30,77 +27,76 @@ The dissertation is structured as follows.
and contributions of the dissertation, and discusses some related and contributions of the dissertation, and discusses some related
work. work.
### Background
* Chapter 2 defines some basic mathematical notation and
constructions that are they pervasively throughout this dissertation.
* Chapter 3 presents a literature survey of continuations and
first-class control. I classify continuations according to their
operational behaviour and provide an overview of the various
first-class sequential control operators that appear in the
literature. The application spectrum of continuations is discussed as
well as implementation strategies for first-class control.
### Programming ### Programming
* Chapter 4 introduces a polymorphic fine-grain call-by-value core * Chapter 2 illustrates effect handler oriented programming by
calculus, λ<sub>b</sub>, which makes key use of Remy-style row polymorphism example by implementing a small operating system dubbed Tiny UNIX,
to implement polymorphic variants, structural records, and a which captures some essential traits of Ritchie and Thompson's
structural effect system. The calculus distils the essence of the core UNIX. The implementation starts with a basic notion of file i/o,
of the Links programming language. and then, it evolves into a feature-rich operating system with full
file i/o, multiple user environments, multi-tasking, and more, by
composing ever more effect handlers.
* Chapter 5 presents three extensions of λ<sub>b</sub>, * Chapter 3 introduces a polymorphic fine-grain call-by-value core
which are λ<sub>h</sub> that adds deep handlers, λ<sup>†</sup> that adds shallow calculus, λ<sub>b</sub>, which makes key use of Rémy-style row
handlers, and λ<sup>‡</sup> that adds parameterised handlers. The chapter polymorphism to implement polymorphic variants, structural records,
also contains a running case study that demonstrates effect handler and a structural effect system. The calculus distils the essence of
oriented programming in practice by implementing a small operating the core of the Links programming language. The chapter also
system dubbed Tiny UNIX based on Ritchie and Thompson's original presents three extensions of λ<sub>b</sub>, which are λ<sub>h</sub>
UNIX. that adds deep handlers, λ<sup>†</sup> that adds shallow handlers,
and λ<sup>‡</sup> that adds parameterised handlers.
### Implementation ### Implementation
* Chapter 6 develops a higher-order continuation passing * Chapter 4 develops a higher-order continuation passing style
style translation for effect handlers through a series of step-wise translation for effect handlers through a series of step-wise
refinements of an initial standard continuation passing style refinements of an initial standard continuation passing style
translation for λ<sub>b</sub>. Each refinement slightly modifies the notion translation for λ<sub>b</sub>. Each refinement slightly modifies
of continuation employed by the translation. The development the notion of continuation employed by the translation. The
ultimately leads to the key invention of generalised continuation, development ultimately leads to the key invention of generalised
which is used to give a continuation passing style semantics to deep, continuation, which is used to give a continuation passing style
shallow, and parameterised handlers. semantics to deep, shallow, and parameterised handlers.
* Chapter 7 demonstrates an application of generalised continuations * Chapter 5 demonstrates an application of generalised continuations
to abstract machine as we plug generalised continuations into to abstract machine as we plug generalised continuations into
Felleisen and Friedman's CEK machine to obtain an adequate abstract Felleisen and Friedman's CEK machine to obtain an adequate abstract
runtime with simultaneous support for deep, shallow, and parameterised runtime with simultaneous support for deep, shallow, and
handlers. parameterised handlers.
### Expressiveness ### Expressiveness
* Chapter 8 shows that deep, shallow, and parameterised notions of
handlers can simulate one another up to specific notions of
administrative reduction.
* Chapter 9 studies the fundamental efficiency of effect handlers. In * Chapter 6 shows that deep, shallow, and parameterised notions of
this chapter, we show that effect handlers enable an asymptotic handlers can simulate one another up to specific notions of
improvement in runtime complexity for a certain class of administrative reduction.
functions. Specifically, we consider the *generic count* problem using
a pure PCF-like base language λ<sub>b</sub><sup>→</sup> (a simply typed variation of * Chapter 7 studies the fundamental efficiency of effect handlers. In
λ<sub>b</sub>) and its extension with effect handlers λ<sub>h</sub><sup>→</sup>. We this chapter, we show that effect handlers enable an asymptotic
show that λ<sub>h</sub><sup>→</sup> admits an asymptotically more efficient improvement in runtime complexity for a certain class of
implementation of generic count than any λ<sub>b</sub><sup>→</sup> implementation. functions. Specifically, we consider the *generic count* problem
using a pure PCF-like base language λ<sub>b</sub><sup>→</sup> (a
simply typed variation of λ<sub>b</sub>) and its extension with
effect handlers λ<sub>h</sub><sup>→</sup>. We show that
λ<sub>h</sub><sup>→</sup> admits an asymptotically more efficient
implementation of generic count than any λ<sub>b</sub><sup>→</sup>
implementation.
### Conclusions ### Conclusions
* Chapter 10 concludes and discusses future work. * Chapter 8 concludes and discusses future work.
### Appendices ### Appendices
* Appendix A contains a proof that shows the `Get-get` equation for
state is redundant. * Appendix A contains a literature survey of continuations and
* Appendix B contains the proof details for the higher-order first-class control. I classify continuations according to their
uncurried CPS translation for deep and shallow handlers. operational behaviour and provide an overview of the various
* Appendix C contains the proof details and gadgetry for the first-class sequential control operators that appear in the
complexity of the effectful generic count program. literature. The application spectrum of continuations is discussed
* Appendix D provides a sample implementation of the Berger count as well as implementation strategies for first-class control.
program and discusses it in more detail. * Appendix B contains a proof that shows the `Get-get` equation for
state is redundant.
* Appendix C contains the proof details and gadgetry for the
complexity of the effectful generic count program.
* Appendix D provides a sample implementation of the Berger count
program and discusses it in more detail.
## Building ## Building
@@ -114,3 +110,11 @@ e.g.
$ make $ make
``` ```
## Timeline
I submitted my thesis on May 30, 2021. It was examined on August 13,
2021, where I received pass with minor corrections. The revised thesis
was submitted on December 22, 2021. It was approved on March
14, 2022. The final revision was submitted on March 23, 2022. I
received my PhD award letter on March 24, 2022. My graduation
ceremony took place in McEwan Hall on July 11, 2022.

1469
code/ehop2022.links Normal file

File diff suppressed because it is too large Load Diff

1352
code/unix-huawei2022.links Normal file

File diff suppressed because it is too large Load Diff

1372
code/unix-msr2022.links Normal file

File diff suppressed because it is too large Load Diff

1352
code/unix-nuprl2022.links Normal file

File diff suppressed because it is too large Load Diff

1393
code/unix-tutorial.links Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1258,7 +1258,7 @@
@techreport{Remy93, @techreport{Remy93,
title = {{Syntactic theories and the algebra of record terms}}, title = {{Syntactic theories and the algebra of record terms}},
author = {Didier Remy}, author = {Didier R\'{e}my},
number = {RR-1869}, number = {RR-1869},
institution = {{INRIA}}, institution = {{INRIA}},
year = {1993}, year = {1993},
@@ -2401,7 +2401,8 @@
author = {Nikolaos S. Papspyrou}, author = {Nikolaos S. Papspyrou},
title = {A resumption monad transformer and its applications in the semantics of concurrency}, title = {A resumption monad transformer and its applications in the semantics of concurrency},
booktitle = {Proceedings of the 3rd Panhellenic Logic Symposium}, booktitle = {Proceedings of the 3rd Panhellenic Logic Symposium},
address = {Anogia, Greece} address = {Anogia, Greece},
year = 2001,
} }
@inproceedings{Harrison06, @inproceedings{Harrison06,

4361
thesis.tex

File diff suppressed because it is too large Load Diff