Feasibility of native RTS support for continuations?

Alexis King lexi.lambda at gmail.com
Thu Jan 30 00:55:05 UTC 2020

> On Jan 29, 2020, at 03:32, Simon Peyton Jones <simonpj at microsoft.com> wrote:
> Suppose a thread happens to be evaluating a pure thunk for (factorial 200). […] This stack-freezing stuff is definitely implemented.

That’s fascinating! I had no idea, but your explanation makes sense (as do the papers you linked). That is definitely promising, as it seems like many of the tricky cases may already be accounted for? I’ll see if I can follow the Cmm code well enough to hunt down how it’s implemented.

One other thing I have been thinking about: this is completely incompatible with the state hack, isn’t it? That is not a showstopper, of course—I do not intend to suggest that continuations be capturable in ordinary IO—but it does mean I probably want a way to selectively opt out. (But I’ll worry about that if I ever get that far.)


More information about the ghc-devs mailing list