From c28aef1c9ee78068623dcadcc49982eac1109cfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hillerstr=C3=B6m?= Date: Tue, 18 May 2021 23:45:20 +0100 Subject: [PATCH] Notes on why first-class control matters --- thesis.tex | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/thesis.tex b/thesis.tex index 1c7b80f..3c9096a 100644 --- a/thesis.tex +++ b/thesis.tex @@ -394,11 +394,33 @@ In this dissertation I am concerned only with parameterised handlers which are a slight variation of deep handlers. \section{Why first-class control matters} +From the perspective of programmers first-class control is a valuable +programming feature because it enables them to implement their own +control idioms as if they were native to the programming +language. More important with first-class control programmer-defined +control idioms are local phenomena which can be encapsulated in a +library such that the rest of the program does not need to be made +aware of their existence. Conversely, without first-class control some +control idioms can only be implemented using global program +restructuring techniques such as continuation passing style. + +From the perspective of compiler engineers first-class control is +valuable because it unifies several control-related constructs under +one single construct. First-class control can be beneficial for +implementing programming languages which have no notion of first-class +control in source language. A runtime with support for first-class +control can considerably simplify and ease maintainability of an +implementation of a programming language with various distinct +second-class control idioms such as async/await, coroutines, etc, +because compiler engineers need only implement and maintain a single +control mechanism rather than having to implement and maintain +individual runtime support for each control idiom in the source +language. -\subsection{Flavours of control} -\paragraph{Undelimited control} -\paragraph{Delimited control} -\paragraph{Composable control} +% \subsection{Flavours of control} +% \paragraph{Undelimited control} +% \paragraph{Delimited control} +% \paragraph{Composable control} \subsection{Why effect handlers matter}