Hacker News new | ask | show | jobs
by pjmlp 59 days ago
Depends how the MSIL bytecodes are used, and as long as it is done in a way that the verifier is happy, it goes.
1 comments

I am curious how. I thought quite a lot about targeting MSIL, but i found no way of copying, capturing or slicing the call stack. Nor is it possible to reify even the whole stack as a first class object.

For delimited continuations I only managed to find mostly extremely inefficient ways of doing it. CPS transformations on dotnet are, at least if kept to be useful as delcc, slow as molasses.

Which is ultimately why I chose to compile to c# to use asyncmethodbuilder do do the state machine translation for me.

After some research I stand corrected, apparently only partial support is possible.

https://www.jot.fm/issues/issue_2004_10/article4

I thought otherwise given my recollection of the samples, and that the platform supports C++, thus quite flexible on the opcodes.

In many ways I feel I should have targetted OCaml instead, since I would have gotten a full effect handler system and delimited continuations for free.

Now I am generating two bodies for every defun that touches any suspending function, using asyncmethodbuilder, meaning I don't get any of the runtimeasync benefits coming in dotnet11.

Hopefully they'll give us a new asyncmethodbuilder that is somewhat more constrained but guarantees runtime async.