mirror of
https://github.com/dhil/phd-dissertation
synced 2026-03-13 11:08:25 +00:00
Compare commits
53 Commits
0b198e7a25
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2d79e1d06 | ||
|
|
47410e4d14 | ||
| 81a4ecec0b | |||
| cafa8b1ba2 | |||
| 2e61275a5b | |||
| e90ba67a4b | |||
| 6aee80a71b | |||
| aea67c86b4 | |||
|
|
5ede30903f | ||
|
|
03b7c5b548 | ||
| 7535fe7ecc | |||
| 72b54ad278 | |||
| 01e707822f | |||
| 2cecb13d34 | |||
| ed634fcaa3 | |||
| c60dc80fde | |||
| e86597f4e4 | |||
| 2b7b1df8db | |||
| 20f44ad547 | |||
| 101ac96aa2 | |||
| e6182105de | |||
| 63fe9a738a | |||
| 3a9394baf8 | |||
| 6193214890 | |||
| ffe6ebd0b9 | |||
| 01a8a3d581 | |||
| 008e80ea67 | |||
| 3276537ab1 | |||
| 20551152b3 | |||
| 8679803146 | |||
| d7bd881a00 | |||
| f5685fe70d | |||
| 7f3503153f | |||
| 40c6505ae2 | |||
| b897751a38 | |||
| 3e1bbf3206 | |||
| 40948507e9 | |||
| 2a800f07e2 | |||
| d3921f24e3 | |||
| 7063acb4e7 | |||
| c9ff1d9af8 | |||
| fff15c9c83 | |||
| a24a33dcf8 | |||
| 6c128a1181 | |||
| 98784c59ab | |||
| 6492391ed4 | |||
| cea34c85e1 | |||
| 40b1144d9b | |||
| 3067bfb939 | |||
| 83b5f7db99 | |||
| 981b0d48f8 | |||
| ee8a4ab2dd | |||
| 3fda920eae |
134
README.md
134
README.md
@@ -1,16 +1,13 @@
|
||||
# Foundations for programming and implementing effect handlers
|
||||
|
||||
**NOTE** I have made a draft copy of the dissertation available in
|
||||
this repository. I ask that you **do not** link to or distribute the
|
||||
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.
|
||||
A copy of my dissertation can be [downloaded via my
|
||||
website](https://dhil.net/research/papers/thesis.pdf).
|
||||
|
||||
---
|
||||
----
|
||||
|
||||
Submitted May 30, 2021. Pending examination.
|
||||
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)
|
||||
* [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
|
||||
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
|
||||
|
||||
* Chapter 4 introduces a polymorphic fine-grain call-by-value core
|
||||
calculus, λ<sub>b</sub>, which makes key use of Remy-style row polymorphism
|
||||
to implement polymorphic variants, structural records, and a
|
||||
structural effect system. The calculus distils the essence of the core
|
||||
of the Links programming language.
|
||||
* Chapter 2 illustrates effect handler oriented programming by
|
||||
example by implementing a small operating system dubbed Tiny UNIX,
|
||||
which captures some essential traits of Ritchie and Thompson's
|
||||
UNIX. The implementation starts with a basic notion of file i/o,
|
||||
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>,
|
||||
which are λ<sub>h</sub> that adds deep handlers, λ<sup>†</sup> that adds shallow
|
||||
handlers, and λ<sup>‡</sup> that adds parameterised handlers. The chapter
|
||||
also contains a running case study that demonstrates effect handler
|
||||
oriented programming in practice by implementing a small operating
|
||||
system dubbed Tiny UNIX based on Ritchie and Thompson's original
|
||||
UNIX.
|
||||
* Chapter 3 introduces a polymorphic fine-grain call-by-value core
|
||||
calculus, λ<sub>b</sub>, which makes key use of Rémy-style row
|
||||
polymorphism to implement polymorphic variants, structural records,
|
||||
and a structural effect system. The calculus distils the essence of
|
||||
the core of the Links programming language. The chapter also
|
||||
presents three extensions of λ<sub>b</sub>, which are λ<sub>h</sub>
|
||||
that adds deep handlers, λ<sup>†</sup> that adds shallow handlers,
|
||||
and λ<sup>‡</sup> that adds parameterised handlers.
|
||||
|
||||
### Implementation
|
||||
|
||||
* Chapter 6 develops a higher-order continuation passing
|
||||
style translation for effect handlers through a series of step-wise
|
||||
refinements of an initial standard continuation passing style
|
||||
translation for λ<sub>b</sub>. Each refinement slightly modifies the notion
|
||||
of continuation employed by the translation. The development
|
||||
ultimately leads to the key invention of generalised continuation,
|
||||
which is used to give a continuation passing style semantics to deep,
|
||||
shallow, and parameterised handlers.
|
||||
* Chapter 4 develops a higher-order continuation passing style
|
||||
translation for effect handlers through a series of step-wise
|
||||
refinements of an initial standard continuation passing style
|
||||
translation for λ<sub>b</sub>. Each refinement slightly modifies
|
||||
the notion of continuation employed by the translation. The
|
||||
development ultimately leads to the key invention of generalised
|
||||
continuation, which is used to give a continuation passing style
|
||||
semantics to deep, shallow, and parameterised handlers.
|
||||
|
||||
* Chapter 7 demonstrates an application of generalised continuations
|
||||
to abstract machine as we plug generalised continuations into
|
||||
Felleisen and Friedman's CEK machine to obtain an adequate abstract
|
||||
runtime with simultaneous support for deep, shallow, and parameterised
|
||||
handlers.
|
||||
* Chapter 5 demonstrates an application of generalised continuations
|
||||
to abstract machine as we plug generalised continuations into
|
||||
Felleisen and Friedman's CEK machine to obtain an adequate abstract
|
||||
runtime with simultaneous support for deep, shallow, and
|
||||
parameterised handlers.
|
||||
|
||||
### 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
|
||||
this chapter, we show that effect handlers enable an asymptotic
|
||||
improvement in runtime complexity for a certain class of
|
||||
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.
|
||||
* Chapter 6 shows that deep, shallow, and parameterised notions of
|
||||
handlers can simulate one another up to specific notions of
|
||||
administrative reduction.
|
||||
|
||||
* Chapter 7 studies the fundamental efficiency of effect handlers. In
|
||||
this chapter, we show that effect handlers enable an asymptotic
|
||||
improvement in runtime complexity for a certain class of
|
||||
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
|
||||
* Chapter 10 concludes and discusses future work.
|
||||
* Chapter 8 concludes and discusses future work.
|
||||
|
||||
### Appendices
|
||||
* Appendix A contains a proof that shows the `Get-get` equation for
|
||||
state is redundant.
|
||||
* Appendix B contains the proof details for the higher-order
|
||||
uncurried CPS translation for deep and shallow handlers.
|
||||
* 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.
|
||||
|
||||
* Appendix A contains 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.
|
||||
* 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
|
||||
|
||||
@@ -114,3 +110,11 @@ e.g.
|
||||
$ 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
1469
code/ehop2022.links
Normal file
File diff suppressed because it is too large
Load Diff
1352
code/unix-huawei2022.links
Normal file
1352
code/unix-huawei2022.links
Normal file
File diff suppressed because it is too large
Load Diff
1372
code/unix-msr2022.links
Normal file
1372
code/unix-msr2022.links
Normal file
File diff suppressed because it is too large
Load Diff
1352
code/unix-nuprl2022.links
Normal file
1352
code/unix-nuprl2022.links
Normal file
File diff suppressed because it is too large
Load Diff
1393
code/unix-tutorial.links
Normal file
1393
code/unix-tutorial.links
Normal file
File diff suppressed because it is too large
Load Diff
@@ -137,7 +137,7 @@
|
||||
handlers.\\[2em]
|
||||
|
||||
\[
|
||||
\Scale[2]{\cek{C \mid E \mid K = \overline{((H,E), \sigma)}}}
|
||||
\Scale[2]{\cek{C \mid E \mid K = \overline{(\sigma, (H,E))}}}
|
||||
\]\\[2em]
|
||||
|
||||
\textbf{Relevant papers} TyDe'16~\cite{HillerstromL16},
|
||||
|
||||
Binary file not shown.
30
thesis.bib
30
thesis.bib
@@ -19,6 +19,15 @@
|
||||
type = {{MSc(R)} thesis}
|
||||
}
|
||||
|
||||
# UNIX with effect handlers abstract
|
||||
@misc{Hillerstrom21,
|
||||
author = {Daniel Hillerström},
|
||||
title = {Composing {UNIX} with {Effect} {Handlers}: {A} {Case} {Study} in {Effect} {Handler} {Oriented} {Programming} (Extended Abstract)},
|
||||
year = {2021},
|
||||
optmonth = sep,
|
||||
howpublished = {{ML Workshop}}
|
||||
}
|
||||
|
||||
# OCaml handlers
|
||||
@article{SivaramakrishnanDWKJM21,
|
||||
author = {{KC} Sivaramakrishnan and
|
||||
@@ -1249,7 +1258,7 @@
|
||||
|
||||
@techreport{Remy93,
|
||||
title = {{Syntactic theories and the algebra of record terms}},
|
||||
author = {Didier Remy},
|
||||
author = {Didier R\'{e}my},
|
||||
number = {RR-1869},
|
||||
institution = {{INRIA}},
|
||||
year = {1993},
|
||||
@@ -2392,7 +2401,8 @@
|
||||
author = {Nikolaos S. Papspyrou},
|
||||
title = {A resumption monad transformer and its applications in the semantics of concurrency},
|
||||
booktitle = {Proceedings of the 3rd Panhellenic Logic Symposium},
|
||||
address = {Anogia, Greece}
|
||||
address = {Anogia, Greece},
|
||||
year = 2001,
|
||||
}
|
||||
|
||||
@inproceedings{Harrison06,
|
||||
@@ -3775,3 +3785,19 @@
|
||||
pages = {1--22},
|
||||
year = {1977}
|
||||
}
|
||||
|
||||
# Dagstuhl seminar report
|
||||
@article{AhmanALR21,
|
||||
author = {Danel Ahman and
|
||||
Amal Ahmed and
|
||||
Sam Lindley and
|
||||
Andreas Rossberg},
|
||||
title = {{Scalable} {Handling} of {Effects} ({Dagstuhl} {Seminar} 21292)},
|
||||
journal = {Dagstuhl Reports},
|
||||
volume = {11},
|
||||
number = {6},
|
||||
pages = {54--81},
|
||||
year = {2021}
|
||||
}
|
||||
|
||||
|
||||
|
||||
14688
thesis.tex
14688
thesis.tex
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user