A Swift library providing structured concurrency, coroutines, and CSP channels for macOS and Linux.
Venice is a Swift library that implements structured concurrency and Communicating Sequential Processes (CSP) for macOS and Linux. It provides coroutines, channels, and cancellation mechanisms to write safe, concurrent code with clean lifetime management. The library wraps a fork of the C library libdill to bring these concurrency primitives to Swift.
Swift developers building concurrent applications on macOS or Linux who need lightweight concurrency with guaranteed cleanup and CSP-style communication patterns.
Developers choose Venice for its strict structured concurrency model, which prevents background coroutine leaks, and its CSP channels that simplify safe communication between concurrent tasks. It offers a more controlled alternative to traditional threading or callback-based async code.
Coroutines, structured concurrency and CSP for Swift on macOS and Linux.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Ensures coroutine lifetimes are nested and cleaned up properly, preventing background leaks as illustrated in the call tree diagrams and cancellation examples.
Provides typed channels with send-only and receive-only variants, enabling safe and controlled data flow between coroutines, central to the CSP model.
Uses coroutines instead of OS threads for concurrent execution, reducing resource consumption and context-switching costs.
Supports coroutine cancellation that propagates errors, allowing defer blocks to run for resource cleanup, as shown in the malloc/free example.
Requires installing and maintaining a fork of libdill via brew or apt, adding setup complexity and potential versioning issues outside Swift's package manager.
Only compatible with macOS and Linux, excluding iOS and other Swift platforms, which restricts its use in cross-platform or mobile development.
The project's documentation and badges indicate Swift 3.1, making it potentially incompatible or unsupported with newer Swift versions and modern concurrency features.
Coroutines and handles are confined to their creating thread, preventing cross-thread usage and reducing flexibility in multi-threaded applications.