Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Delimited continuations #226

Merged
merged 57 commits into from
Aug 27, 2020
Merged

Delimited continuations #226

merged 57 commits into from
Aug 27, 2020

Conversation

1Jajen1
Copy link
Member

@1Jajen1 1Jajen1 commented Aug 26, 2020

The purpose of this pr is to add the new module, which @raulraja @nomisRev and me have been working on lately, which implements delimited continuations in kotlin over suspend. (Or something very close to delimited continuations^^)

These implementations are currently split across capabilities (Nesting scopes, multishot) to provide an overview how each feature works. Ideally we'd have Nested scopes and multishot support but that is kind of complicated and thus not included.

The purpose of this pr is (if I understood @raulraja correctly 🙈) simply adding the module (and api documentation which I will add over the next days) so that further prs can change our existing fx implementations to use delimited continuations in order to slowly chop away the hacky fx code. This should not yet replace fx for nondet carriers (lists/sequences) because I do not consider the multishot included here to be ready. I will create a detailed document/issue for discussion there after this pr is merged.

At some point we also need to have a discussion between folding/binding monadic code versus providing effects directly but thats a different story altogether.

Unless @raulraja or @nomisRev have something to add I'll mark this pr as ready after adding some documentation to each implementation.

Oh and before I forget: I am pretty sure this version does not yet allow interleaving of arbitrary suspend code, so that is also something to look at.

When this pr is merged a few things should happen:

  • replace non-multishot fx with a delimited control implementation (this makes them multiplatform viable and likely faster)
  • discuss how multishot support should look in arrow (there are a few strategies)
  • testing and benchmarking should be set up to see how it performs

raulraja and others added 30 commits June 27, 2020 19:44
Examples are in the "test" class and are based on algebraic effect handlers
1Jajen1 and others added 7 commits August 26, 2020 21:00
Co-authored-by: Rachel M. Carmena <rachelcarmena@users.noreply.github.com>
Co-authored-by: Rachel M. Carmena <rachelcarmena@users.noreply.github.com>
Co-authored-by: Rachel M. Carmena <rachelcarmena@users.noreply.github.com>
Copy link
Member

@raulraja raulraja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @1Jajen1 @nomisRev for this journey on continuations and helping make arrow more accessible!

@raulraja raulraja marked this pull request as ready for review August 27, 2020 17:09
Copy link
Member

@rachelcarmena rachelcarmena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome @1Jajen1 @raulraja @nomisRev Looking forward the next steps!! 🙌

@rachelcarmena rachelcarmena merged commit 62fc835 into master Aug 27, 2020
@rachelcarmena rachelcarmena deleted the rr-continuation-tricks branch August 27, 2020 21:45
@raulraja
Copy link
Member

thank you @rachelcarmena for helping out with the merge 🙌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants