Talyn: A robust, stable, and realistically fast Zig-powered event loop for Python's asyncio.
Project description
Talyn: Robust, Stable Asyncio Event Loop for Python
Talyn is a robust, exceptionally stable, and realistically fast asyncio event loop drop-in replacement for Python, powered by the asynchronous capabilities of Zig and io_uring.
Talyn prioritizes correctness, complete system safety, and high usability over artificial micro-benchmark superiority. It is fully compatible with CPython's standard single-threaded and free-threaded (GIL-disabled) runtimes.
🚀 Features
- Realistic Speed: Designed to deliver solid and reliable I/O performance on Linux by leveraging
io_uring's native kernel-side asynchronous completion queues. - Robust & Crash-Resistant: Meticulously hardened against circular reference memory leaks, stack alignment faults, signal interrupt deadlocks, and use-after-free bugs.
- Full Asyncio Compatibility: Passes 100% of standard Python
asyncio,subprocess,transports, and connection-lifecycle test suites. - Modern Packaging: Fully migrated to PEP 517/518 standard declarative
pyproject.tomlconfiguration. - GIL-Disabled Free-Threading Ready: Fully compatible with
python3.13tandpython3.14twithout memory races.
📜 Requirements
- Python:
>= 3.13(Tested and verified under CPython3.13,3.14,3.13t(free-threaded), and3.14t(free-threaded)) - Linux Kernel:
>= 7.0(Verified on Linux Kernel7.0.x) - Zig Compiler (for source builds):
0.16.0(Fedora packages)
[!NOTE] Tested Platform Verification: Talyn has been built, compiled, and verified extensively under Fedora 43-44 on an x86_64 architecture equipped with an Intel(R) Core(TM) Ultra 7 265 processor. Compatibility with other Linux distributions, older kernels, or alternative hardware architectures (e.g. AArch64) has not been verified yet. We welcome feedback and pull requests for other environments!
🔧 Installation
To compile and install Talyn locally, run:
pip install -e .
📦 Basic Usage
import talyn
import asyncio
async def main():
print("Hello from Talyn!")
await asyncio.sleep(1)
print("Goodbye from Talyn!")
# Run using Talyn event loop
talyn.run(main())
💝 Historical Credits & Origin
Talyn is spun off from Leviathan, an event loop originally pioneered by Enrique Mora (@kython28). Enrique Mora's creative spark and vision of merging Zig, io_uring, and asyncio laid the critical foundation and architecture of this project.
As Talyn evolved, the implementation underwent a complete systems-level refactoring to transition from a theoretical prototype to a production-grade, crash-resistant runtime:
- Eliminated multi-crossing Zig/Python vectorcall overhead by implementing a native C step trampoline.
- Redesigned completion handlers into flat, GC-safe ring buffers.
- Fully audited and resolved all memory-leak reference cycles under concurrent connections.
To honor the project's roots and Enrique's early work:
- The original Leviathan README can be viewed at: docs/historical/leviathan-readme.md
- The original preliminary benchmarks can be viewed at: docs/historical/leviathan-benchmark.md
📄 License
This project is licensed under the MIT License. See LICENSE.md for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file talyn-0.4.0-cp314-cp314t-manylinux_2_36_x86_64.whl.
File metadata
- Download URL: talyn-0.4.0-cp314-cp314t-manylinux_2_36_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.14t, manylinux: glibc 2.36+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efa1dad5c6c3d265c1b6ed6dfe1bef62a6f00869dae2da46b18f100ecd2f779b
|
|
| MD5 |
d8d5bf059b3e83532d402e1dea907fcf
|
|
| BLAKE2b-256 |
fa830bbe6598412e32b713cf00846470772159e83001fc7928d38c0a59e6ac74
|
File details
Details for the file talyn-0.4.0-cp314-cp314-manylinux_2_36_x86_64.whl.
File metadata
- Download URL: talyn-0.4.0-cp314-cp314-manylinux_2_36_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.14, manylinux: glibc 2.36+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da0cd9295f61b22acb300e7d688d3b506532a52b86a0c8962dce6c24c4144ac5
|
|
| MD5 |
76e5204bee38235a5ffd09e64e07e75e
|
|
| BLAKE2b-256 |
c222f5a978e9954a96129240bc989a730a8e073ad9b65ef83f5f895145f116f9
|
File details
Details for the file talyn-0.4.0-cp313-cp313t-manylinux_2_36_x86_64.whl.
File metadata
- Download URL: talyn-0.4.0-cp313-cp313t-manylinux_2_36_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.13t, manylinux: glibc 2.36+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
776c8d6148b049e4488e01356517fb9a36455ed06070fb03b17db5adf9a4009c
|
|
| MD5 |
c5cabdc8192df48fcad2b21c37a72763
|
|
| BLAKE2b-256 |
562cb82f678c170592fda72b92d77437be9af1ba711e8061ebfc6b755b95fe8c
|
File details
Details for the file talyn-0.4.0-cp313-cp313-manylinux_2_36_x86_64.whl.
File metadata
- Download URL: talyn-0.4.0-cp313-cp313-manylinux_2_36_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.13, manylinux: glibc 2.36+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78b0f95655e5f864719ffa6bc224b9cbff7eefaf4f97d4ec27c0ac6e1c432b27
|
|
| MD5 |
0a699d82c139bc599c6db57b5e5b31e6
|
|
| BLAKE2b-256 |
b39d4ec86b49ca108626ab8706fe09a2a21d96c07aa46c1efd8f018561a1a8af
|