From e08923dadcbd9a1fc17aab44b57fc308dc9734be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Hillerstr=C3=B6m?= Date: Wed, 7 Oct 2020 21:16:22 +0100 Subject: [PATCH] Note on dynamic binding. --- thesis.bib | 40 ++++++++++++++-------------------------- thesis.tex | 42 +++++++++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/thesis.bib b/thesis.bib index 24a03cf..d56ffdd 100644 --- a/thesis.bib +++ b/thesis.bib @@ -460,30 +460,6 @@ year = {2008} } -# WebAssembly -@misc{HaasRSTGWBH17, - author = {Andreas Haas and Andreas Rossberg and Ben L. Titzer and Dan Gohman and Luke Wagner and JF Bastien and Michael Holman}, - title = {Bringing the {Web} up to Speed with {WebAssembly}}, - year = 2017, - note = {Draft}, - howpublished = {\url{https://people.mpi-sws.org/~rossberg/papers/Haas, Rossberg, Schuff, Titzer, Gohman, Wagner, Bastien, Holman - Bringing the Web up to Speed with WebAssembly [Draft].pdf}} -} - -# ECMAScript -@misc{EMCA15, - author = {{Ecma International}}, - title = {{ECMAScript} 2015 Language Specification}, - year = 2015, - url = {http://www.ecma-international.org/ecma-262/6.0/index.html} -} - -@misc{EMCA17, - author = {{Emca International}}, - title = {{ECMAScript} 2017 Language Specification}, - year = 2017, - url = {https://tc39.github.io/ecma262/} -} - # Hop.js @inproceedings{SerranoP16, author = {Manuel Serrano and @@ -646,7 +622,19 @@ howpublished = {{ML Workshop}} } -% fancy row typing systems that support shapes +# Delimited Control +@inproceedings{KiselyovSS06, + author = {Oleg Kiselyov and + Chung{-}chieh Shan and + Amr Sabry}, + title = {Delimited dynamic binding}, + booktitle = {{ICFP}}, + pages = {26--37}, + publisher = {{ACM}}, + year = {2006} +} + +# fancy row typing systems that support shapes @inproceedings{BerthomieuS95, author = {Bernard Berthomieu and Camille le Moniès de Sagazan}, title = {A Calculus of Tagged Types, with applications to process languages}, @@ -663,7 +651,7 @@ } - +# Zipper data structure. @article{Huet97, author = {G{\'{e}}rard P. Huet}, title = {The Zipper}, diff --git a/thesis.tex b/thesis.tex index 311d941..865f534 100644 --- a/thesis.tex +++ b/thesis.tex @@ -22,11 +22,11 @@ \DeclareCaptionFormat{underlinedfigure}{#1#2#3\hrulefill} \captionsetup[figure]{format=underlinedfigure} \usepackage[T1]{fontenc} % Fixes issues with accented characters -\usepackage[scaled=0.85]{beramono} %\usepackage{libertine} %\usepackage{lmodern} %\usepackage{palatino} % \usepackage{newpxtext,newpxmath} +\usepackage[scaled=0.85]{beramono} \usepackage[activate=true, final, tracking=true, @@ -2204,24 +2204,36 @@ The (delimited) continuation of $\exit~1$ is effectively dead code. \subsection{Dynamic binding: user-specific environments} \label{sec:tiny-unix-env} -In \UNIX{} an environment maps keys to string-values. A key-value pair is -referred to as an \emph{environment variable}. Each user gets their -own environment with their own set of environment variables. Some -environment variable names are common to all environments, but their -valuation may depend on the particular user session. For example, the -environment variable \texttt{USER} is bound to the (string) name of -the user; the result of querying the environment for the value of -\texttt{USER} depends on which user session it is executed under. +When a process is run in \UNIX{}, the operating system makes available +to the process a collection of name-value pairs called the +\emph{environment}. +% +The name of a name-value pair is known as an \emph{environment + variable}. +% +During execution the process may perform a system call to ask the +operating system for the value of some environment variable. +% +The value of environment variables may change throughout process +execution, moreover, the value of some environment variables may vary +according to which user asks the environment. % -\dhil{The value of an environment variable may also change during execution.} +For example, an environment may contain the environment variable +\texttt{USER} that is bound to the name of the inquiring user. -An environment variable is an instance of dynamic binding. The idea of -dynamic binding as a programming notion dates back as far as the -original implementation of Lisp~\cite{McCarthy60}. +An environment variable can be viewed as an instance of dynamic +binding. The idea of dynamic binding as a binding form in programming +dates back as far as the original implementation of +Lisp~\cite{McCarthy60}, and still finds uses in successors such as +Emacs Lisp~\cite{LewisLSG20}. It is well-known that dynamic binding +can be encoded as a computational effect by using delimited +control~\cite{KiselyovSS06}. % -We will use dynamic binding to implement user-specific environments. +Unsurprisingly, we will use this insight to simulate user-specific +environments using effect handlers. -For simplicity we will fix the users to be root, Alice, and Bob. +For simplicity we fix the users of the operating system to be root, +Alice, and Bob. % \[ \User \defas [\Alice;\Bob;\Root]