Computer science, maths, and occasionally something completely different

Effects++, June 2017

NII Shonan Seminar 103: Semantics of Effects, Resources, and Applications Group photo from NII Shonan Seminar 103: Semantics of Effects, Resources, and Applications.

It has been a busy couple of months in the effect handlers biz. The state of effects has been incremented quite a bit. Amongst the recent increments are some of my own work.

Expressivity study Yannick Forster, Ohad Kammar, Sam Lindley, and Matija Pretnar got their paper accepted for publication at ICFP'17:

The title pretty much sums it up: using Felleisen's notion of macro expressivity they establish formal connections between the three different control mechanisms effect handlers, monadic reflection, and shift0/reset. They begin by developing a language called multi-adjunctive metalanguage (MAM) which is a lambda calculus with call-by-push-value semantics and a polymorphic type system with a simple effect system. They take MAM as their basis, in turn augmenting it with the three different control mechanisms.

Systems programming with handlers Towards the end of April I spent some time hacking on the Multicore OCaml compiler at OCaml Labs in Cambridge. Stephen Dolan, Spiros Eliopoulos, Anil Madhavapeddy, KC Sivaramakrishnan, Leo White, and I put together various bits of work we had done over the past year or so. We wrote it up as a draft paper:

In this draft we argue that effect handlers provide a compelling abstraction for systems programming, providing a direct-style alternative to the predominant callback style programming without sacrificing performance. We evaluate the claim by implementing a web server using effect handlers. We also present an approach to scoped signal handling using asynchronous effects. Stephen presented the draft paper at Trends in Functional Programming this week in Canterbury. Last week I gave brief 10-minute talk about paper during the CDT Pervasive Parallelism Student Showcase event. Read more.

Possession of Knowledge Mandates an Ethical Responsibility

Rod Burstall, Professor Emeritus, School of Informatics, the University of Edinburgh Rod Burstall is one of the founding members of Laboratory for Foundations of Computer Science. The photograph is from Rodney Topor's flickr.

Rod Burstall dropped by the LFCS lab lunch yesterday. Lab lunch is an informal gathering of LFCS members which takes place every Tuesday. On rota a LFCS member gives a (supposedly lightweight) talk which is usually followed by a round of questions. Yesterday, after the questions, Rod stood up to remind us that we, as researchers, carry an ethical responsibility for how our research impact the surrounding society. Read more.


Leslie Lamport congratulates Gordon Plotkin on his 0th birthday. By the end of his talk, Leslie Lamport congratulated Gordon Plotkin.

Today is Gordon Plotkin's 70th birthday! The Laboratory for Foundations of Computer Science at the University of Edinburgh held an event in his honour today to celebrate his birthday. It was a full day of talks by friends, colleagues, and former students of Gordon's.

There is absolutely no doubt that Gordon is my favourite computer scientist. Gordon has made numerous contributions to computer science, and I have been exposed to many of them throughout my undergraduate and postgraduate studies. In fact, my current research topic comes from his line of work. Therefore I am also deeply grateful to be able to take part in the celebration of him on his 70th birthday. Read more.

A Compiler for Multi-shot Effect Handlers

Computer Laboratory entrance, Cambridge The pond at Pembroke College, Cambridge. I have seen deeper rain puddles in Edinburgh.

I recently spent two weeks at OCaml Labs, the University of Cambridge implementing a compiler for the experimental, research language Links with effect handlers. During those two weeks I managed to compile a substantial subset of the Links language to native code, in particular, I managed to compile some programs that use handlers. My Links compiler reuses most of the infrastructure from the OCaml effects/multicore compiler.

At OCaml Labs I was working with KC Sivaramakrishnan, whom is working on the Multicore OCaml project.

In this post I shall discuss numerous three things: I will briefly describe the compiler infrastructure, discuss an example program that compiles, and how I encode multi-shot handlers. Read more.

Visiting OCaml Labs -- Day #1

Computer Laboratory entrance, Cambridge Entrance to the Computer Laboratory, Cambridge.

Today I arrived in Cambridge, where I am staying for next two weeks, while I work on a native backend for Links with effect handlers. My plan is to target either the surface syntax of OCaml or the OCaml IR directly. I have been invited by KC Sivaramakrishnan, whom is working on adding multicore support to OCaml using handlers. I plan to do something similar with Links, albeit my focus at the moment is on concurrency and not on parallelism. However, I might obtain multicore support for free.

KC gave me an overview of the OCaml compiler and the multicore project today. I will give a brief overview/summary of our discussion. Read more.

See the archive for older posts.