A generic, macro-based, stackless coroutine builder for Clojure and ClojureScript.
cloroutine is a library that adds coroutine support to Clojure and ClojureScript through a macro-based, stackless builder. It solves the problem of managing suspendable computations, providing a low-level foundation for implementing patterns like generators and async/await without imposing a specific concurrency model.
Clojure and ClojureScript developers building custom abstractions for asynchronous programming, sequence generation, or data processing who need fine-grained control over coroutine behavior.
Developers choose cloroutine for its simplicity, generic design, and concurrency agnosticism, allowing it to serve as a versatile base for higher-level libraries without locking them into a particular execution strategy.
Coroutine support for clojure
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides coroutine functionality for both Clojure and ClojureScript using a single macro (`cr`), enabling code reuse across platforms as stated in the GitHub description.
Deliberately avoids imposing a concurrency model, allowing integration with various libraries like core.async or Manifold, per the philosophy section.
Serves as a foundation for implementing generators, async/await, transducers, and more, as demonstrated in the provided guides.
Exposes only one macro in a single namespace, making it lightweight and focused, which aligns with its goal of being a simple, generic tool.
Does not include thread-safe constructs, requiring users to handle synchronization manually in concurrent environments, as admitted in the README's rationale.
As a low-level library, it necessitates building custom wrappers for common use cases, increasing development time compared to more opinionated solutions.
Setting up coroutines with specific concurrency models requires additional code and understanding of both cloroutine and external libraries, which can be daunting.