Having an Effect
Jul. 2nd, 2020 11:58 amhttp://okmij.org/ftp/Computation/having-effect.html
https://www.youtube.com/watch?v=GhERMBT7u4w
This research has been a journey following the tantalizing lead: the founding papers on monads, monad transformers, free monads, and extensible-effects were all about extensible interpreters. Along the way, we have realized that the expression problem, stable denotations, and extensible interpreters are all different names for the same thing. We have eventually found the organizing principle: interaction -- between a client and a server, an interpreter, and the interpreted code, expression and its context.
It may well be that interaction is best expressed in a process calculus. In sequential calculi, Cartwright and Felleisen's ``Extensible Denotational Language Specifications'' is the earliest fully worked-out rigorous presentations of effects as interactions.
The talk gives the modern reconstruction of Cartwright and Felleisen's approach. Our reconstruction is simpler, aided by the tagless-final presentation, and immediately executable.
Developing further, we make the effect handlers themselves modular and extensible -- be part of a program rather than permanently stationed outside. This makes possible the following step:
Cartwright and Felleisen had to bake the variable environment into the basic semantic framework, even though integers, or first-order sub-languages in general, make no use of it. We avoid postulating the variable environment and any special treatment of higher-order. After all, we treat Lambda on par with the State, in the same uniform formalism. Dynamic or lexical binding or various calling conventions boil down to different ways of handling the effect of dereferencing a bound variable.
Revisiting the origins of the field and recovering the insights and forgotten alternatives help make our programs have the intended effect.
https://www.youtube.com/watch?v=GhERMBT7u4w
This research has been a journey following the tantalizing lead: the founding papers on monads, monad transformers, free monads, and extensible-effects were all about extensible interpreters. Along the way, we have realized that the expression problem, stable denotations, and extensible interpreters are all different names for the same thing. We have eventually found the organizing principle: interaction -- between a client and a server, an interpreter, and the interpreted code, expression and its context.
It may well be that interaction is best expressed in a process calculus. In sequential calculi, Cartwright and Felleisen's ``Extensible Denotational Language Specifications'' is the earliest fully worked-out rigorous presentations of effects as interactions.
The talk gives the modern reconstruction of Cartwright and Felleisen's approach. Our reconstruction is simpler, aided by the tagless-final presentation, and immediately executable.
Developing further, we make the effect handlers themselves modular and extensible -- be part of a program rather than permanently stationed outside. This makes possible the following step:
Cartwright and Felleisen had to bake the variable environment into the basic semantic framework, even though integers, or first-order sub-languages in general, make no use of it. We avoid postulating the variable environment and any special treatment of higher-order. After all, we treat Lambda on par with the State, in the same uniform formalism. Dynamic or lexical binding or various calling conventions boil down to different ways of handling the effect of dereferencing a bound variable.
Revisiting the origins of the field and recovering the insights and forgotten alternatives help make our programs have the intended effect.