Skip to content

Commit c2d7d1b

Browse files
julioestjulioest
authored andcommitted
add corosio beta post
1 parent faf2a54 commit c2d7d1b

1 file changed

Lines changed: 93 additions & 0 deletions

File tree

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
---
2+
layout: post
3+
nav-class: dark
4+
categories: ruben
5+
title: "Corosio Beta: Coroutine-Native Networking for C++20"
6+
author-name: Mark Cooper
7+
---
8+
9+
# Corosio Beta: Coroutine-Native Networking for C++20
10+
11+
*The C++ Alliance is releasing the Corosio beta, a networking library designed from the ground up for C++20 coroutines. We are inviting serious C++ developers to use it, break it, and tell us what needs to change before it goes to Boost formal review.*
12+
13+
---
14+
15+
## The Gap C++20 Left Open
16+
17+
C++20 gave us coroutines. It did not give us networking to go with them. Boost.Asio has added coroutine support over the years, but its foundations were laid for a world of callbacks and completion handlers. Retrofitting coroutines onto that model produces code that works, but never quite feels like the language you are writing in. We decided to find out what networking looks like when you start over.
18+
19+
---
20+
21+
## What Corosio Is
22+
23+
Corosio is a coroutine-only networking library for C++20. It provides TCP sockets, acceptors, TLS streams, timers, and DNS resolution. Every operation is an awaitable. You write `co_await` and the library handles executor affinity, cancellation, and frame allocation. No callbacks. No futures. No sender/receiver.
24+
25+
```c
26+
auto [socket] = co_await acceptor.async_accept();
27+
auto n = co_await socket.async_read_some(buffer);
28+
co_await socket.async_write(response);
29+
```
30+
31+
Corosio runs on Windows (IOCP), Linux (epoll), and macOS (kqueue). It targets GCC 12+, Clang 17+, and MSVC 14.34+, with no dependencies outside the standard library. Capy, its I/O foundation, is fetched automatically by CMake.
32+
33+
---
34+
35+
## Built on Capy
36+
37+
Corosio is built on Capy, a coroutine I/O foundation library that ships alongside it. The core insight driving Capy's design comes from Peter Dimov: *an API designed from the ground up to use C++20 coroutines can achieve performance and ergonomics which cannot otherwise be obtained.*
38+
39+
Capy's *IoAwaitable* protocol ensures coroutines resume on the correct executor after I/O completes, without thread-local globals, implicit context, or manual dispatch. Cancellation follows the same forward-propagation model: stop tokens flow from the top of a coroutine chain to the platform API boundary, giving you uniform cancellation across all operations. Frame allocation uses thread-local recycling pools to achieve zero steady-state heap allocations after warmup.
40+
41+
---
42+
43+
## What We Are Asking For
44+
45+
We are looking for feedback on correctness, ergonomics, platform behavior, documentation, and performance under real workloads. Specifically:
46+
47+
* Does the executor affinity model hold up under production conditions?
48+
* Does cancellation behave correctly across complex coroutine chains?
49+
* Are there platform-specific edge cases in the IOCP, epoll, or kqueue backends?
50+
* Does the zero-allocation model hold in your deployment scenarios?
51+
52+
We are inviting serious C++ developers, especially if you have shipped networking code, to use it, break it, and tell us what your experience was. The Boost review process rewards libraries that arrive having already faced serious scrutiny.
53+
54+
---
55+
56+
## Get It
57+
58+
```shell
59+
git clone https://github.com/cppalliance/corosio.git
60+
cd corosio
61+
cmake -S . -B build -G Ninja
62+
cmake --build build
63+
64+
```
65+
66+
Or with CMake FetchContent:
67+
68+
```
69+
include(FetchContent)
70+
FetchContent_Declare(corosio
71+
GIT_REPOSITORY https://github.com/cppalliance/corosio.git
72+
GIT_TAG develop
73+
GIT_SHALLOW TRUE)
74+
FetchContent_MakeAvailable(corosio)
75+
target_link_libraries(my_app Boost::corosio)
76+
```
77+
78+
**Requires:** CMake 3.25+, GCC 12+ / Clang 17+ / MSVC 14.34+
79+
80+
---
81+
82+
## Resources
83+
84+
[Corosio on GitHub](https://github.com/cppalliance/corosio)https://github.com/cppalliance/corosio
85+
86+
[Corosio Docs](https://master.corosio.cpp.al/)https://develop.corosio.cpp.al/
87+
88+
[Capy on GitHub](https://github.com/cppalliance/capy)https://github.com/cppalliance/capy
89+
90+
[Capy Docs](https://master.capy.cpp.al/)https://develop.capy.cpp.al/
91+
92+
[File an Issue](https://github.com/cppalliance/corosio/issues)https://github.com/cppalliance/corosio/issues
93+

0 commit comments

Comments
 (0)