The interface is slightly more flexible than the one on iris.heap_lang to support continuation passing style