(Experiment) Delimited Continuations with shift/reset in Elixir

Hello!

I have been trying to learn more about what continuations are and how
they work, and made an experimental library to explore those
concepts. I selected a few cool examples (or at least I think they are
interesting) of what can be done with it and put them in this blog
post:

https://thalesmg.github.io/posts/2021-08-27-elixir-delimited-continuations.html

It is a probably hackish and inefficient implementation, but, to my
surprise, it manages to make the presented examples work. I’m sharing
this so it may be of interest for someone else, and hopefully they’ll
also find the examples surprising.

Cheers! :beers:

7 Likes

Very interesting! Continuations are curious beasts; difficult to grasp, and not that useful on a day-to-day basis, but super important under the hood to be able to build certain constructs that would otherwise be much more difficult or impossible to create.

Great work! I very much liked the blogpost.

2 Likes

Thanks for the feedback! I’m glad you liked it! :beers:

Great write up, continuations are super important to us and we are trying to work out limitations, a lot of brainstorming to just switch off Elixir completely and contribute more fully to something like Hamler.

1 Like