Green Threads vs Async/Await, ergonomics-wise, toward thread-safety

This page summarizes the projects mentioned and recommended in the original post on /r/ProgrammingLanguages

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • xvm

    Ecstasy and XVM

  • In our R&D for the XVM (Ecstasy), we knew that one enormous global mutable space (a la C++, Java, C#, Python, etc.) was a bad idea, because of the specific goals that we had in mind. Based on some advice and a request from Rich Hickey, we initially tried implementing STM (Software Transactional Memory) in the XVM. We invested about a year in that design, before completely giving up (and shortly before Intel gave up on HTM; they disabled it by microcode in 2018, and removing support for it in CPUs starting in 2020). We spent a few months trying to recover from our failure, before finally settling on a hierarchical execution+memory model (lightweight software containers, easily supporting thousands inside a single running process space). To achieve concurrency and memory safety, we rely on a combination of services (with a dynamically configurable re-entrancy policy) and fibers (which are, conceptually, short-lived green threads).

  • http_server

    Pony library for building HTTP server applications.

  • And it's not just the mathematics. The non-type-theoretic paradigm-upending let-it-crash-to-keep-code-correct resilience for which Erlang/Elixir is famous was one of the biggest eye-openers for me in my programming career (which began in 1972 when I was 12). Also, the simple behaviour and very high performance results of contemporary Actorish implementations, especially Akka.io and the in-some-ways-more-impressive ponylang.io and related ORCA GC ("concurrent and parallel garbage collector for actor programs ... does not require any STW steps, or synchronization mechanisms ... zero-copy message passing and sharing of mutable data ... data race free ... [no] read/write barriers"), are eye-catching affirmations of the Actor model's approach.

  • 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