-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serialization? #9
Comments
Serialisation has been attempted before with some people pulling it off. Serialising Continuations is very easy. The tricky part is to deal with everything that might be captured by them. You'll need to replace references to global objects, ensure you capture no file handles, etc. I don't think this library can help much though in serialisation (making its classes serialisable might be a good idea though). I want to explore serialisation eventually because it's such a nice selling point for continuations (even project Loom plans on adding it!). Multi-shot coroutines can do more things than just serialisation though. It can allow cool things like probabilistic programming and logic programming (maybe even making a Prolog-like DSL?) Enabling discussions is a great shout! Done! Edit: accidentally closed the issue lol! |
There's also Section 8 of this paper which touches on the topic briefly. Their approach (storing globals in an array and serialising references to it as indices) is unlikely to be helpful here though. |
Honestly, I've never worked with a language with multi-shot continuations, so I don't have an intuition for what becomes possible. So far the use-case I understand the best is the one for the Parameterize library, but that's about it. I'm very curious what people will build with this power. |
I'll try to collect a few usecases soon, perhaps in a discussion thread. For now, you can see a lot of use cases in the tests, especially the |
I'm having a really hard time grasping how to read these snippets 😅 I think the difficulty comes from the naming, I don't have an intuition for what |
Agreed. The naming is from the literature, but it needs more friendly names. I think |
(Note: some examples don't compile because I'm using
Because the continuation is just a function, you can also pass it to other top-level functions, for instance:
You could even do this with Raise (note, Raise doesn't play nicely with multishot because it locks itself. The library does have ways of creating multishot
Look at that! We just built |
Hi!
I'm trying to understand the consequences of multi-shot continuations and what it would allow us to do.
Since this library apparently works by cloning continuations; would it be possible to serialize a continuation so it can be continued on another machine or later in another execution?
(also, what do you think of enabling Discussions on this repository?)
The text was updated successfully, but these errors were encountered: