Software developers will soon be able to write programs that handle concurrency, distribution, and probability using a single, uniform feature called effect handlers, rather than stitching together a dozen separate, hard-wired tools. The problem is that modern software must juggle many "effects"—running tasks in parallel, communicating across networks, or making probabilistic predictions—and each currently requires its own custom-built solution. This makes code brittle, hard to maintain, and difficult to scale. Effect handlers, originally a theoretical concept from computer science, offer a unified way to implement all these effects. But existing implementations are too immature for widespread industrial use. This fellowship will turn effect handlers into a practical foundation for programming. The researcher will build both high-level designs for human programmers and low-level implementations for machines, targeting two key technologies: OCaml 5, the first industrial-strength language with native effect handler support, and WebAssembly, the portable bytecode that runs in every major web browser. If successful, compiler developers could replace dozens of ad hoc concurrency features with a single, efficient effect handler implementation. The researcher will also extend effect handlers to enforce communication protocols via session types, making distributed systems safer and more reliable. The ultimate beneficiaries are the billions of end users who rely on software that runs faster, crashes less, and adapts more easily.
View original technical description
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, Meta'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 create 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. + OCaml. OCaml 5 (released 2022) is the first industrial-strength language with efficient native support for effect handlers, and this support is already bearing fruit, e.g, the Eio 1.0 library (2024) depends on effect handlers to offer seamless high-performance fine-grained control over a range of concurrency and asynchronous I/O features. I will develop an ergonomic effect type system for OCaml, enabling more flexible, maintainable, and robust software to be written in OCaml. Eventually these benefits will transfer to other languages, ultimately improving the user experience for billions of end users. + WebAssembly. I am designing and implementing 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 which is hard-wired and must 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, central to which 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 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.
Plain English summaries and category classifications on this site are generated by AI and may not perfectly reflect the original research.
Is something wrong? Let us know