Second-Class Values for Safer Effect Handlers
Assigned to Jonas Benn.
Effect handlers as generalizations of exception handlers offer interesting new ways to modularize software. Scala Effekt is an implementation of effect handlers, based on capability passing. Instead of searching for the correct handler in runtime, the handler is passed down to where the effect is used. This allows convenient implementations in languages like Scala and Java and comes with performance improvements. Scala 3 introduced the new feature of implicit function types, greatly reducing the burden of explicit capability passing. However, capabilities can leak and leave the scope of the defining handler leading to runtime errors.
Osvald et al. (2016) present a novel way on achieve capability safety by means of treating them as second class values. The accompanying implementation does not support Scala 3, preventing a common use of the two features second class values and implicit function types.
The goal of the thesis is to extend the Scala 3 compiler to support second class values. This includes extending the parser and the type-checker. The thesis should evaluate combining second class values with implicit function types.
- Scala Effekt Project
- Leo Osvald et al. Gentrification gone too far? affordable 2nd-class values for fun and (co-)effect. OOPSLA 2016. ACM
- Scala Escape
- Dotty Escape as developed in the thesis