Effect Handler Oriented Programming

Lead Research Organisation: University of Edinburgh
Department Name: Sch of Informatics

Abstract

In an economy in which the UK software industry added £139 billion of
value to UK GDP in 2018 alone, this fellowship will transform the way
developers write software. By offering a radically new way of
composing and customising programs, I will empower software developers
to build more flexible, maintainable, and robust software.

Computers must interact with the real world. In computer programs real
world effects are pervasive, e.g.: concurrency (performing two
computations at once), distribution (performing computation in
different places), input, output, and probability (e.g. for machine
learning).

Effect handlers are a general programming feature that can be used to
implement all of these effects. They were introduced by theoretical
computer scientists as part of a mathematical model of effects. Thanks
in part to my efforts they now show promise as a practical programming
tool. Interest in effect handlers in industry is growing. For
instance, Facebook's React Fiber, the core of the market-leading React
user interface library for web applications, is directly inspired by
effect handlers, and Uber's Pyro tool for probabilistic programming
and statistical inference makes essential use of effect handlers.

Preliminary results suggest effect handlers have the potential to
support efficient implementations. Nevertheless, existing
implementations are in their infancy and research is required to make
them scale, both in terms of ease of programming and in terms of
performance. I will develop the theory and practice of Effect Handler
Oriented Programming as a uniform foundation for modular and efficient
implementation of effects. I will develop both high-level (for humans)
and low-level (for machines) effect handler designs and
implementations. In collaboration with my project partners I will
ensure that EHOP has direct impact through two key technologies.

+ Hack. I will add effect handlers to Hack, the high-level programming
language in which the Facebook server is written. Hack currently
provides ad hoc support for features such as concurrency and
probabilistic programming, which I will replace by effect handlers,
eliminating the need to maintain several ad hoc features, and
introducing fine-grained control over details such as scheduling
strategies. This will allow more flexible, maintainable, and robust
software to be written in Hack, ultimately improving the user
experience of billions of Facebook users.

+ WebAssembly. I will design and implement an effect handler extension
for WebAssembly, a portable low-level bytecode supported by the top
four browser vendors and designed to supersede JavaScript as the
target language for the web. Currently, languages such as JavaScript
provide a collection of ad hoc overlapping concurrency features. Each
of these is hard-wired and has to be maintained separately. However,
all of them can be implemented with minimal effort using effect
handlers. Rather than hard-wiring and maintaining several ad hoc
features, compiler developers will be able to rely on a single
implementation of effect handlers in WebAssembly. This will enable
more flexible, maintainable, and reliable programming language
implementations, ultimately improving the user experience of billions
of web users.

A "killer app" for effect handlers is concurrency and distribution. A
central aspect of concurrency and distribution is communication. For
communication to be safe, secure, and reliable, all parties must
comply with appropriate protocols. Session types are a nascent
technology for enforcing protocol compliance. Unifying the two main
threads of my research over the last half decade, I will extend the
theory and practice of effect handlers to enable session-typed
concurrency and distribution features to be defined as effect
handlers. Ultimately, this will enable safe, secure, and reliable
communication infrastructure for billions of end users.

Planned Impact

The programme is intended to establish a radically new programming
paradigm centring on effect handlers, and design and build high-level
programming languages and low-level backends to enable their use in
programming practice, as well as establishing theoretical
foundations. It will have a far reaching impact on computing practice,
in the short term (3 years), medium term (6 years) and long term (10
years and beyond).

(1) Who will benefit from this research?

In the short term, the beneficiaries will be the partners of this
programme and those closely associated with them, including DFINITY
(WebAssembly), Facebook (Hack), Jane Street (Multicore OCaml), and
Microsoft (Koka and WebAssembly).

In the medium term, effect handlers will be present as a low-level
abstraction in commercial deployments of WebAssembly and Hack. This
will directly benefit language designers and implementers. Indirectly
this will benefit billions of end users who use the web and Facebook.

In the longer term, effect handlers will be adopted as a high-level
abstraction in mainstream programming languages. This will directly
benefit software developers in general. Indirectly this will benefit
billions of end users.

(2) How will they benefit from this research?

The partners of this programme will benefit from their direct
collaboration, and early access to the ideas and implementations, and
will continue to be at the forefront of the software technologies
exploiting the results of this collaboration.

Language designers and implementers will benefit from an efficient
implementation of effect handlers as a uniform low-level abstraction
that can serve as a target for concurrency features in particular.

Software developers will benefit from a radically new programming
paradigm that supports modular effectful programming. Effect handlers
will empower them to build efficient customised versions of features
such as async/await, coroutines, and probabilistic programming. They
will be able to plug such features together in whatever combination
they choose, and to fine-tune parameters such as scheduling strategies
according to need. Advanced effect type systems and session types will
empower developers to build safe, secure, and reliable software. (Even
for those languages that do not immediately adopt such type systems in
all their glory, "soft" approaches such as gradual typing will offer
many of the same benefits.)

Ultimately, billions of end users (including Facebook and web users)
will benefit from an improved user experience as effect handlers will
enable more robust software and (for instance through systems like
WebAssembly) more predictable performance.

Publications

10 25 50

publication icon
Emrich F (2022) Constraint-based type inference for FreezeML in Proceedings of the ACM on Programming Languages

publication icon
Ghica D (2022) High-level effect handlers in C++ in Proceedings of the ACM on Programming Languages

publication icon
Sam Lindley (2021) Handler calculus

publication icon
Simon Fowler (2021) Separating Sessions Smoothly

 
Description Compiling Links to WebAssembly 
Organisation Northeastern University - Boston
Country United States 
Sector Academic/University 
PI Contribution We have implemented two prototype WebAssembly backends for a tiny subset of the Links programming language. One of these is direct. The other targets the notwasm language used by the jankscripten toolchain (https://github.com/arjunguha/jankscripten).
Collaborator Contribution Northeastern have helped us with interfacing with the jankscripten toolchain (https://github.com/arjunguha/jankscripten).
Impact We have implemented two prototype WebAssembly backends for a tiny subset of the Links programming language. One of these is direct. The other targets the notwasm language used by the jankscripten toolchain (https://github.com/arjunguha/jankscripten).
Start Year 2021
 
Description Effect handlers consultancy 
Organisation Huawei Technologies Research and Development UK Ltd
Country United Kingdom 
Sector Private 
PI Contribution I provide consultancy services to Huawei's Programming Languages Research Laboratory in Edinburgh on effect handlers.
Collaborator Contribution Confidential.
Impact Confidential.
Start Year 2021
 
Description Extending WebAssembly with support for effect handlers 
Organisation Indian Institute of Technology Madras
Country India 
Sector Academic/University 
PI Contribution Design, documentation, and implementation in the reference interpreter for WasmFX, an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Organising regular meetings to coordinate the work. Recently, we have begun work on implementing WasmFX for Wasmtime, the primary non-browser production implementation of effect handlers, which is, e.g., central to the operation of the Fastly content delivery network.
Collaborator Contribution DFINITY have helped considerably with the specification and implementation of the reference interpreter. Ljubljana are focusing on developing a mechanised correctness proof for the extended specification. IIT Madras are building an implementation of the specification as an extension to the Wasmtime implementation of WebAssembly. Microsoft have built a WebAssembly backend for the Koka programming language, which is being extended to support the effect handler extensions. Northeastern have helped with implementing WasmFX for Wasmtime. All partners are fully involved in the design process. Northeastern joined the collaboration in 2022.
Impact Design, documentation, and implementation in the reference interpreter for an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Implementation of WasmFX for Wasmtime - a side-effect of this work was an implementation, in collaboration with other Wasmtime devlopers at Fastly, of the function references extension for Wasmtime. A paper is in preparation for submission to OOPSLA 2023 (deadline April 2023). This will cover design considerations for WasmFX as well as concrete benchmarks based on Wasmtime.
Start Year 2021
 
Description Extending WebAssembly with support for effect handlers 
Organisation Microsoft Research
Country Global 
Sector Private 
PI Contribution Design, documentation, and implementation in the reference interpreter for WasmFX, an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Organising regular meetings to coordinate the work. Recently, we have begun work on implementing WasmFX for Wasmtime, the primary non-browser production implementation of effect handlers, which is, e.g., central to the operation of the Fastly content delivery network.
Collaborator Contribution DFINITY have helped considerably with the specification and implementation of the reference interpreter. Ljubljana are focusing on developing a mechanised correctness proof for the extended specification. IIT Madras are building an implementation of the specification as an extension to the Wasmtime implementation of WebAssembly. Microsoft have built a WebAssembly backend for the Koka programming language, which is being extended to support the effect handler extensions. Northeastern have helped with implementing WasmFX for Wasmtime. All partners are fully involved in the design process. Northeastern joined the collaboration in 2022.
Impact Design, documentation, and implementation in the reference interpreter for an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Implementation of WasmFX for Wasmtime - a side-effect of this work was an implementation, in collaboration with other Wasmtime devlopers at Fastly, of the function references extension for Wasmtime. A paper is in preparation for submission to OOPSLA 2023 (deadline April 2023). This will cover design considerations for WasmFX as well as concrete benchmarks based on Wasmtime.
Start Year 2021
 
Description Extending WebAssembly with support for effect handlers 
Organisation Northeastern University - Boston
Country United States 
Sector Academic/University 
PI Contribution Design, documentation, and implementation in the reference interpreter for WasmFX, an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Organising regular meetings to coordinate the work. Recently, we have begun work on implementing WasmFX for Wasmtime, the primary non-browser production implementation of effect handlers, which is, e.g., central to the operation of the Fastly content delivery network.
Collaborator Contribution DFINITY have helped considerably with the specification and implementation of the reference interpreter. Ljubljana are focusing on developing a mechanised correctness proof for the extended specification. IIT Madras are building an implementation of the specification as an extension to the Wasmtime implementation of WebAssembly. Microsoft have built a WebAssembly backend for the Koka programming language, which is being extended to support the effect handler extensions. Northeastern have helped with implementing WasmFX for Wasmtime. All partners are fully involved in the design process. Northeastern joined the collaboration in 2022.
Impact Design, documentation, and implementation in the reference interpreter for an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Implementation of WasmFX for Wasmtime - a side-effect of this work was an implementation, in collaboration with other Wasmtime devlopers at Fastly, of the function references extension for Wasmtime. A paper is in preparation for submission to OOPSLA 2023 (deadline April 2023). This will cover design considerations for WasmFX as well as concrete benchmarks based on Wasmtime.
Start Year 2021
 
Description Extending WebAssembly with support for effect handlers 
Organisation University of Ljubljana
Country Slovenia 
Sector Academic/University 
PI Contribution Design, documentation, and implementation in the reference interpreter for WasmFX, an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Organising regular meetings to coordinate the work. Recently, we have begun work on implementing WasmFX for Wasmtime, the primary non-browser production implementation of effect handlers, which is, e.g., central to the operation of the Fastly content delivery network.
Collaborator Contribution DFINITY have helped considerably with the specification and implementation of the reference interpreter. Ljubljana are focusing on developing a mechanised correctness proof for the extended specification. IIT Madras are building an implementation of the specification as an extension to the Wasmtime implementation of WebAssembly. Microsoft have built a WebAssembly backend for the Koka programming language, which is being extended to support the effect handler extensions. Northeastern have helped with implementing WasmFX for Wasmtime. All partners are fully involved in the design process. Northeastern joined the collaboration in 2022.
Impact Design, documentation, and implementation in the reference interpreter for an extension of WebAssembly with support for effect handlers (aka "typed continuations"). Implementation of WasmFX for Wasmtime - a side-effect of this work was an implementation, in collaboration with other Wasmtime devlopers at Fastly, of the function references extension for Wasmtime. A paper is in preparation for submission to OOPSLA 2023 (deadline April 2023). This will cover design considerations for WasmFX as well as concrete benchmarks based on Wasmtime.
Start Year 2021
 
Description Next generation of effect handlers for Multicore OCaml 
Organisation Jane Street Europe
Country United Kingdom 
Sector Private 
PI Contribution We hold regular meetings with Jane Street to discuss the future design of effect handlers in the Multicore OCaml programming language. We have developed a library to support multishot continuations in Multicore OCaml. We are starting to analyse the pros and cons of different effect type systems for effect handlers. We will prototype these in our experimental Links programming language in order to inform the future design of an effect type system for Multicore OCaml.
Collaborator Contribution Jane Street attend regular meetings with us to discuss the future design of effect handlers in the Multicore OCaml programming language. Jane Street have produced a draft proposal for a revised semantics for effect handlers.
Impact Jane Street have produced a draft proposal for a revised semantics for effect handlers.
Start Year 2021
 
Description WebAssembly stack-switching proposal 
Organisation Google
Country United States 
Sector Private 
PI Contribution Sam Lindley (Edinburgh) and Francis McCabe (Google) are the co-champions of the "stack-switching" proposal for WebAssembly. Stack-switching is an implementation technique for effect handlers / typed continuations. I meet regularly with my co-champion and the WebAssembly stack-switching subgroup. Our work with other collaborators on extending WebAssembly with effect handlers and adding a WebAssembly backend feeds into this process.
Collaborator Contribution As well has helping to coordinate the formal proposal process and chairing the stack-switching subgroup, Google is prototyping stack-switching extensions as part of their implementation of WebAssembly in the V8 engine (used by Chrome, Microsoft Edge, and other browsers).
Impact Creation of the stack-switching subgroup. A full program of talks from a range of parties interested in the stack-switching proposal.
Start Year 2021
 
Title Links 
Description Links is a functional programming language designed to make web programming easier. Links eases building interactive web applications with significant client- and server-side components. We have extended the core language of Links with effect handlers and improved the type-and-effect system for effect handler oriented programming. 
Type Of Technology Webtool/Application 
Year Produced 2021 
Open Source License? Yes  
Impact N/A 
URL https://links-lang.org
 
Title Multicont: continuations with multi-shot semantics in OCaml 
Description This library provides a thin abstraction on top of OCaml's regular linear continuations that enables programming with multi-shot continuations, i.e. continuations that can be applied more than once. 
Type Of Technology Webtool/Application 
Year Produced 2022 
Open Source License? Yes  
Impact It has been used to demonstrate programming with effect handlers, e.g. see "effects-examples". It has sparked discussions about the design and implementation of native multi-shot continuations in OCaml (see https://github.com/ocaml/ocaml/pull/10894). 
URL https://github.com/ocaml-multicore/effects-examples
 
Title Wasm reference interpreter extended with effect handlers 
Description We have extended the WebAssembly reference interpreter with the primitives of our stack switching proposal. 
Type Of Technology Webtool/Application 
Year Produced 2021 
Open Source License? Yes  
Impact The reference interpreter is a mandatory part of our stack switching proposal for WebAssembly. 
 
Title Wasmtime extended with effect handlers 
Description Wasmtime is the primary production WebAssembly runtime implemented outside the browser. It is for instance central to the operation of the Fastly content delivery network. We have extended WebAssembly to support the WasmFX extension. Our initial implementation builds on the existing Wasmtime fibers API. In future we will explore lower-level implementations, which we expect to be more flexible and higher performance. This work will open up many more possiblities, by providing a realistic backend for a range of different source languages that make essential use of first-class control flow features. We will make essential use of the implementation to provide the first benchmarks for WasmFX which we will document in a paper to be submitted by mid-April to the OOPSLA 2023 conference. 
Type Of Technology Webtool/Application 
Year Produced 2023 
Open Source License? Yes  
Impact This is the first implementation of WasmFX in a production implementation. It will allow us to perform realistic benchmarks and push forward the standardisation process for adding stack switching / typed continuations / WasmFX to the WebAssembly process. A prerequisite for implementing effect handlers was to implement other missing features in Wasmtime - notably the function references extension to WebAssembly. 
URL https://github.com/effect-handlers/wasmtime
 
Title cpp-effect library for effect handlers in C++ 
Description With collaborators at Huawei's Edinburgh Programming languages laboratory we designed, implemented, and evaluated the first high-level C++ library for effect handlers. The library builds on top of the boost.context fibers library. (I've classified this under "Webtool/Application", but perhaps "Software" would make more sense as this is a library rather than an application. I've done this because the researchfish interface is broken and doesn't let me fill in the relevant fields if I select "Software" - instead it demands a doi.) 
Type Of Technology Webtool/Application 
Year Produced 2022 
Open Source License? Yes  
Impact This work led to the publication of a paper at the OOPSLA 2022 conference / PACMPL journal. The work illustrates that C++ can support effect-handler oriented programming ergonomically in a fashion that smoothly integrates with an idiomatic C++ programming style and performs reasonably well in practice - without paying particular attention to optimisation. It demonstrates that effect handlers make perfect sense as an abstraction for imperative source programming languages - e.g. schedulers may be implemented using a standard loop rather than the tail-recursive implementation typical of much of the existing work on effect handlers, which is mostly geared towards functional programming languages. Our benchmark results also show that the performance is competive even for examples for which effect handlers are known to be suboptimal - e.g. implementing a type loop using a simple generator abstraction. Moreover, our implementation of a generator that traverses a tree scales linearly with the size of the tree, whereas an equivalent implementation using symmetric C++ coroutines is quadratic and performs much worse than the effect handler version in practice. This work is proving helpful as concrete evidence for convincing companies (e.g. Huawei) and standardisation bodies (e.g. the WebAssembly Community Group) that effect handlers are a viable foundation for building concurrency features in practice. 
URL https://github.com/maciejpirog/cpp-effects
 
Description Asymptotic speedup via effect handlers 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Professional Practitioners
Results and Impact Daniel Hillerström presented work on Asymptotic speedup via effect handlers. This is based on recent non-trivial extensions to theoretical work previously presented at ICFP 2020, and now included in an extended version of that work submitted to a special issue of the Journal of Functional Programming.
Year(s) Of Engagement Activity 2022
URL https://www.gla.ac.uk/schools/computing/research/researchsections/fata-section/
 
Description Composing UNIX with Effect Handlers: A Case Study in Effect Handler Oriented Programming (Huawei Research Centre, Zurich) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was a talk given during a visit to the Huawei Research Centre in Zurich, about how to construct the essence of a UNIX operating system using effect handlers. This work serves a case study for practical programming with effect handlers, as well as providing insight into how we may decompose a complex monolithic system like UNIX into a granular set of small effect handlers, that when composed yield the semantics of UNIX. Following this talk Daniel Hillerström was offered a job as a senior researcher, which he has subsequently accepted.
Year(s) Of Engagement Activity 2022
 
Description Concrete categories and higher-order recursion 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact Cristina Matache presented here work on Concrete categories and higher-order recursion to the LICS 2022 conference. It has applications to probability, differentiability, and full abstraction.
Year(s) Of Engagement Activity 2022
URL https://lics.siglog.org/lics22/
 
Description Dagstuhl Seminar 21292 on Scalable Handling of Effects 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Sam Lindley co-organised a week-long meeting on Scalable Handling of Effects. It brought together international researchers and industrial participants. It was held as a prestigious Dagstuhl Seminar. Initially it was supposed to be held in 2020, but was postponed to July 2021 because ofCovid-19. Due to the on-going pandemic it was held as a virtual event.

Algebraic effects and effect handlers are currently enjoying significant interest in both academia and industry as a modular programming abstraction for expressing and incorporating user-defined computational effects in programming languages. For example, there are a number of effect handler oriented languages in development (such as Eff, Frank, and Koka); there exist effect handler libraries for mainstream languages (such as C and Java); effect handlers are a key part of languages such as Multicore OCaml (and indeed they are due to appear in the production release of OCaml next year); effect handlers are being increasingly used in statistical probabilistic programming (such as Uber's Pyro tool); and proposals are in the works to include effect handlers in new low-level languages (such as WebAssembly). While effect handlers have solid mathematical foundations and have been extensively experimented in prototype languages and on smaller examples, enabling effect handlers to scale still requires tackling some hard problems. To this end, this Dagstuhl Seminar 21292 "Scalable Handling of Effects" focused on addressing the following key problem areas for scalability: Safety, Modularity, Interoperability, Legibility, and Efficiency.

For details of concrete outcomes see the summary here: https://www.dagstuhl.de/21292
Year(s) Of Engagement Activity 2021
URL https://www.dagstuhl.de/21292
 
Description Dagstuhl Seminar 21372 on Behavioural Types: Bridging Theory and Practice 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Sam Lindley co-organised a week-long meeting on Behavioural Types: Bridging Theory and Practice. It brought together international researchers and industrial participants. It was held as a prestigious Dagstuhl Seminar. Due to the on-going pandemic it was held as a hybrid event (12 people, including Sam Lindley, attended on-site at Schloss Dagstuhl in Germany, and 28 people attended virtually).

Behavioural types specify the way in which software components interact with one another. Unlike data types (which describe the structure of data), behavioural types describe communication protocols, and their verification ensures that programs do not violate such protocols. The behavioural types research community has developed a flourishing literature on communication-centric programming, exploring many directions. One of the most studied behavioural type systems are session types, introduced by Honda et al. in the '90s, and awarded with prizes for their influence in the past 20 and 10 years (by the ESOP and POPL conferences, respectively). Other varieties of behavioural types include typestate systems, choreographies, and behavioural contracts; research on verification techniques covers the spectrum from fully static verification at compile-time to fully dynamic verification at run-time.

In the last decade, research on behavioural types has shifted emphasis towards practical applications, using both novel and existing programming languages (e.g., Java, Python, Go, C, Haskell, OCaml, Erlang, Scala, Rust). Yet, despite the vibrant community and the stream of new results, the use of behavioural types for mainstream software development and verification remains limited.

The Dagstuhl Seminar brought together academic and industry experts who work in the areas of concurrency, distributed systems, and behavioural types. The goal was to explore how best to bridge the gap between behavioural types theory and mainstream software development practice.

The aim was to make tangible progress on at least the following key topics:

* Failure handling: how to describe and handle errors and unexpected behaviours of distributed system components
* Asynchronous communication: how to ensure the correct handling of issues like packet loss and time constraints
* Dynamic reconfiguration: how to correctly design and implement applications with dynamic communication topology, e.g., based on the ubiquitous pub/sub model.

For details of concrete outcomes see the summary here: https://www.dagstuhl.de/21372
Year(s) Of Engagement Activity 2021
URL https://www.dagstuhl.de/21372
 
Description Dagstuhl Seminar 23101 on Foundations of WebAssembly 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact Sam Lindley and Daniel Hillerström were invited to attend a week-long meeting on Foundations of WebAssembly. It brought together international researchers and industrial participants. It was held as a prestigious Dagstuhl Seminar.

Several EHOP project partners also attended, and we used this as an opportunity to make progress on preparing an OOPSLA 2023 submission on WasmFX.

Matija Pretnar was in attendance. We planned a program of work for a visit to Edinburgh from April - July 2023.

We helped to establish a new initiative to build a new specification language for WebAssembly.
Year(s) Of Engagement Activity 2023
URL https://www.dagstuhl.de/en/seminars/seminar-calendar/seminar-details/23101
 
Description Effect Handler Oriented Programming (Huawei-Edinburgh lab 2022) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Industry/Business
Results and Impact This talk was given at the Huawei-Edinburgh joint lab technical seminar series in December 2021. This talk has character of a tutorial as it introduces the concept of effect handler oriented programming through a series of examples.
Year(s) Of Engagement Activity 2021
URL https://blogs.ed.ac.uk/he-lab/2020/12/01/technical-talk-effect-handler-oriented-programming/
 
Description Effect handler oriented programming (Huawei strategy and technology workshop) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact Sam Lindley presented the EHOP project to an audience of Huawei researchers, developers, and prominent academic researchers working in the field of programming languages.

A somewhat tangential, but potentially outcome arose from a discussion with another one of the attendees - Professor Sukyoung Ryu, head of the School of Computing at KAIST, Korea. Sukyoung Ryu leads a highly impactful project on a scalable analysis framework for JavaScript. Her tools are now deeply embedded in the standardisation process for JavaScript. Based on his WebAssembly experience, Sam Lindley suggested that a similar approach could be fruitful for WebAssembly too. This directly led to her being invited to a Dagstuhl seminar on Foundations of WebAssembly (March 2023), also attended by Sam Lindley, Daniel Hillerström, and several of the EHOP project partners, and the beginnings of a new project to build a new specification language for WebAssembly.
Year(s) Of Engagement Activity 2022
 
Description Effect handler oriented programming (OPLSS 2022 Summer School) 
Form Of Engagement Activity Participation in an activity, workshop or similar
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Sam Lindley taught a 4-lecture summer school course on Effect Handler Oriented Programming at the prestigious Oregon Programming Languages Summer School (OPLSS). This is primarily targeted at PhD students, but undergraduates, other researchers, and people from industry also attend. Strong connections were drawn between this course and a complementary OPLSS course taught by Steve Zdancewic on formal verification of monadic computations.
Year(s) Of Engagement Activity 2022
URL https://www.cs.uoregon.edu/research/summerschool/summer22/topics.php
 
Description Effect handler oriented programming (SPLV 2022) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Postgraduate students
Results and Impact Sam Lindley gave a talk on effect handler oriented programming at the Scottish Programming Languages and Verification summer school (SPLV 2022) held at Heriot-Watt University, Scotland. This is an event held annually in Scotland with participants (primarily PhD students) from all over the world.
Year(s) Of Engagement Activity 2022
URL https://www.macs.hw.ac.uk/splv/splv-2022/
 
Description Effect handlers for WebAssembly (MFPS 2022 invited talk) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was an invited talk presented as part of a special session on Algebraic Effects at the MFPS 2022 conference held at Cornell University. Sam Lindley presented our WasmFX work on adding effect handlers to WebAssembly including the design, implementation, and formal semantics. The talk is recorded on YouTube.
Year(s) Of Engagement Activity 2022
URL https://www.cs.cornell.edu/mfps-2022/
 
Description Effect handlers for WebAssembly (Newton Institute, 2022) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact This was a talk presented at a meeting at the Newton Institute in Cambridge on formalising WebAssembly. Sam Lindley presented our WasmFX work on adding effect handlers to WebAssembly including the design, implementation, and formal semantics. The talk led to a lively discussion and changed the direction of another research project presented at the meeting. As a direct result of this talk Amal Ahmed decided to generalise her Capability Wasm system (which tracks capabilities in Wasm in order to enforce safety properties) to a new system called Rich Wasm in order to support richer type systems, in particular to support effect type systems providing stronger guarantees on top of WasmFX.
Year(s) Of Engagement Activity 2022
URL http://talks.cam.ac.uk/talk/index/176900
 
Description High-level effect handlers in C++ (Huawei Joint Lab Workshop, 2023) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was a reprise of the OOPSLA 2022 talk for the Huawei Joint Lab meeting. It was part of a series of talks relating to effect handlers and effect handler-oriented programming, which Huawei is showing increasing interest in as a direct result of EHOP and the consultancy services Sam Lindley provides to Huawei on effect handlers.
Year(s) Of Engagement Activity 2023
URL https://blogs.ed.ac.uk/he-lab/2023/01/05/january-2023-workshop-schedule/
 
Description High-level effect handlers in C++ (OOPSLA 2022) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was the talk associated with the OOPSLA 2022 paper. With collaborators at Huawei's Edinburgh Programming languages laboratory we designed, implemented, and evaluated the first high-level C++ library for effect handlers.

This work illustrates that C++ can support effect-handler oriented programming ergonomically in a fashion that smoothly integrates with an idiomatic C++ programming style and performs reasonably well in practice - without paying particular attention to optimisation. Our benchmark results also show that the performance is competive even for examples for which effect handlers are known to be suboptimal - e.g. implementing a type loop using a simple generator abstraction. Moreover, our implementation of a generator that traverses a tree scales linearly with the size of the tree, whereas an equivalent implementation using symmetric C++ coroutines is quadratic and performs much worse than the effect handler version in practice.

The presentation was delivered in an effect handlers session with two other talks in which there were close connections between all three talks. In particular, all included a notion of named handlers. The talk led to an engaging discussion with the audience and planned visits to Edinburgh from the authors of the other papers.
Year(s) Of Engagement Activity 2022
URL https://2022.splashcon.org/track/splash-2022-oopsla
 
Description On the expressive power of types (TYPES 2022 keynote) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact Sam Lindley delivered an invited keynote at the TYPES 2022 conference in Nantes France. The talk involved a poll in which the audience was asked a number of questions. The answers revealed the subtleties in defining what expressiveness means and the talk shed light on how types can help to clarify such questions.
Year(s) Of Engagement Activity 2022
URL https://types22.inria.fr/invited-speakers/
 
Description Talk: Composing UNIX with Effect Handlers: A Case Study in Effect Handler Oriented Programming (Dagstuhl seminar 21292) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was an academic talk given during Dagstuhl Seminar 21292 about how to construct the essence of a UNIX operating system using effect handlers. The talk was attended by 30 people, consisting mostly of academic staff, students, but also a few people representing the industry. This work serves a case study for practical programming with effect handlers, as well as providing insight into how we may decompose a complex monolithic system like UNIX into a granular set of small effect handlers, that when composed yield the semantics of UNIX.
Year(s) Of Engagement Activity 2021
URL https://www.dagstuhl.de/en/program/calendar/semhp/?semnr=21292
 
Description Talk: Composing UNIX with Effect Handlers: A Case Study in Effect Handler Oriented Programming (ML Family Workshop'21) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was an academic talk given during ML Family Workshop at ICFP 2021 about how to construct the essence of a UNIX operating system using effect handlers. The talk was attended by 50+ people (the exact number is unbeknownst to me as the talk was live streamed to YouTube simultaneously with delivering the talk on conference platform AirMeet, where 60 people were present). This work serves a case study for practical programming with effect handlers, as well as providing insight into how we may decompose a complex monolithic system like UNIX into a granular set of small effect handlers, that when composed yield the semantics of UNIX.

An audience member later posted a link to this talk on the internet forum reddit (https://www.reddit.com/r/ProgrammingLanguages/comments/pknkcq/composing_unix_with_effect_handlers_a_case_study/) which caused further discussion about this work.
Year(s) Of Engagement Activity 2021
URL https://icfp21.sigplan.org/home/mlfamilyworkshop-2021
 
Description Talk: Handler Calculus (Dagstuhl seminar 21292) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was an academic talk given during Dagstuhl Seminar 21292 about the design of a programming calculus based on effect handlers. The talk was attended by 30 people, consisting mostly of academic staff, students, but also a few people representing the industry. This work rethinks the foundations of programming languages in terms of effect handlers. This work demonstrates how to encode various standard programming data types such as pairs and sums.
Year(s) Of Engagement Activity 2021
URL https://www.dagstuhl.de/en/program/calendar/semhp/?semnr=21292
 
Description Talk: Handler Calculus (HOPE 2021) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact This was an academic talk given during the HOPE Workshop at ICFP 2021 about the design of a programming calculus based on effect handlers. The talk was attended by 50+ people, consisting of academic staff, students, and practitioners from industry. This work rethinks the foundations of programming languages in terms of effect handlers. This work demonstrates how to encode various standard programming data types such as pairs and sums.
Year(s) Of Engagement Activity 2021
URL https://icfp21.sigplan.org/home/hope-2021
 
Description Talk: Handlers.Js: Compiling Effect Handlers to JavaScript (Tarides 2021) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Industry/Business
Results and Impact This was an invited talk given at Tarides, Paris, France in November 2021 about how to viable compilation strategies for effect handlers to JavaScript. The talk was attended by roughly 40 people, most of whom are employees at Tarides, others were from OCaml Labs and Segfault Systems. The talk sparked discussion about how to concrete compile OCaml 5.0 effect handlers to JavaScript, specifically how one may adapt the existing OCaml-to-JavaScript compiler (known as "jsoo").
Year(s) Of Engagement Activity 2021
 
Description Talk: Typed Continuations: A Basis for Stack-switching in Wasm (Wasm stacks subgroup 2021) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact This was a talk given to the WebAssembly Stack Switching subgroup in 2021 about our proposal for stack switching in WebAssembly (Wasm). The talk was attended 12 people, most of whom are industry people. The talk sparked discussions, which helped identify short-comings that need to be addressed to make the proposal acceptable by the WebAssembly working group.
Year(s) Of Engagement Activity 2021
URL https://github.com/WebAssembly/meetings/blob/ad81cdb9b99135d7dd4c23281c8da3bdbce28603/stack/2021/sg-...
 
Description Talk: Wasm with typed continuations continued (Wasm stacks subgroup 2021) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Professional Practitioners
Results and Impact This talk was a follow up on our earlier talk at "Typed Continuations: A Basis for Stack-switching in Wasm" one month earlier to address the feedback we had received back then. It was attended by 15 people, most of whom are industry practitioners. The talk sparked further discussions about our proposal. During the conclusion of the meeting it was agreed that we should open a pull request of our material against the main design repository for stack switching.
Year(s) Of Engagement Activity 2021
URL https://github.com/WebAssembly/meetings/blob/ad81cdb9b99135d7dd4c23281c8da3bdbce28603/stack/2021/sg-...
 
Description Talk: WasmFX: Typed Continuations in Wasm (SPLS Oct'21) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach Regional
Primary Audience Other audiences
Results and Impact This talk was given during the Scottish Programming Languages Seminar held in October 2021. This talk is about the design of our proposal for stack switching in WebAssembly. The talk was attended by roughly 50 people, some of which which asked further questions about our design, and who also reported an increased interest in our work on WebAssembly.
Year(s) Of Engagement Activity 2021
URL https://spls-series.github.io/meetings/2021/october/
 
Description WasmFX: structured stack switching via effect handlers in WebAssembly (Huawei Edinburgh Joint Lab Workshop 2023) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact Daniel Hillerström presented ongoing work on the design and implementation of WasmFX to academic researchers and industrial participants attending the Huawei Edinburgh Joint Lab Workshop. This was part of a series of talks relating to effect handlers and effect handler-oriented programming, which Huawei is showing increasing interest in as a direct result of EHOP and the consultancy services Sam Lindley provides to Huawei on effect handlers.
Year(s) Of Engagement Activity 2023
URL https://blogs.ed.ac.uk/he-lab/2023/01/05/january-2023-workshop-schedule/
 
Description WasmFX: structured stack switching via effect handlers in WebAssembly (Wasm Research Day, 2022) 
Form Of Engagement Activity A talk or presentation
Part Of Official Scheme? No
Geographic Reach International
Primary Audience Other audiences
Results and Impact Daniel Hillerström presented ongoing work on the design and implementation of WasmFX to academic researchers and industrial participants attending the colocated WebAssembly Community Group meeting at Google's San Francisco office. This spawned a great deal of discussion and complemented a later related talk by our project partner Andreas Rossberg at the subsequent WebAssembly Community Group meeting. Together the two talks helped to clarify to the WebAssembly Community Group (who coordinate the standardisation of WebAssembly) what the design space is for supporting stack switching in WebAssembly and how WasmFX hits a sweetspot in that design space.
Year(s) Of Engagement Activity 2022
URL https://www.cs.cmu.edu/~wasm/wasm-research-day-2022.html