Philosophy of Coroutines

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • starfx

    A modern approach to side-effect and state management for web apps.

  • A couple of us have been experimenting with deliminited continuations and I think it’s gonna take off soon:

    https://youtu.be/uRbqLGj_6mI?si=kgKKjpCnehJ9bpIG

    https://github.com/neurosnap/starfx

  • effection

    Structured concurrency and effects for JavaScript

  • https://github.com/thefrontside/effection/tree/v3

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • libcommon

    Library of reusable C++ code

  • If you like Lua coroutines and C++20 coroutines, I have written a piece of code that allows to combine both: https://github.com/CM4all/libcommon/blob/master/src/lua/CoAw...

    It's used for example by our "myproxy" project: https://github.com/CM4all/myproxy/blob/master/src/Connection... (Ctrl-F Lua::CoAwaitable) - a Lua coroutine is launched from within a C++20 coroutine and the C++20 coroutine awaits the Lua coroutine. Everything integrated in a non-blocking I/O event loop.

  • myproxy

    MySQL proxy

  • If you like Lua coroutines and C++20 coroutines, I have written a piece of code that allows to combine both: https://github.com/CM4all/libcommon/blob/master/src/lua/CoAw...

    It's used for example by our "myproxy" project: https://github.com/CM4all/myproxy/blob/master/src/Connection... (Ctrl-F Lua::CoAwaitable) - a Lua coroutine is launched from within a C++20 coroutine and the C++20 coroutine awaits the Lua coroutine. Everything integrated in a non-blocking I/O event loop.

  • continuation

    Delimited Continuations for JavasScript

  • These libraries rely on deliminited continuations:

    https://github.com/thefrontside/continuation

    Because of this tiny implementation we are able to express any async flow construct with less code than relying on something like async/await or callbacks.

  • Async Ruby

    An awesome asynchronous event-driven reactor for Ruby. (by socketry)

  • https://github.com/socketry/async uses coroutines and I think in general it’s been a great model with very few downsides in practice.

  • assembly

    assembly projects (by samsquire)

  • Thank you for your ideas and thoughts.

    This might be relevant - I've been playing around with some assembly to unwind the stack, but it occurred to me I don't need to pop the stack to scan through it. So like C++ exception handling (I learned about it in the Itanium C++ ABI) or algebraic effects, you can scan memory if you have access to the stack start in memory (I do that by storing the rsp somewhere in .global main) in theory it's just data.

    I need to generate sections of lookup data for range information for associating .text code section addresses with function names.

    In theory this would also be useful for coroutines since a coroutine position/state is just a program counter position of code that you can JMP to in your yield function (that isn't a call but an offset)

    To move a coroutine from one thread to another or another machine over the network or persist to disk, let me think. We could do what C++ coroutines does and have a promise struct object that is presumably on the stack when a coroutine resumes by jumping to that coroutines location.

    I think the hard part is being stackless and persisting the current coroutine state. You could mov $COMPILER_DETERMINED_OFFSET into -10(%rbp) that promise object and then when the coroutine resumes it does a JMP -10(%rbp) in a label before the coroutine body.

    I am a beginner to assembly programming but here is my program: https://github.com/samsquire/assembly/blob/main/stackunwind....

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts