The Universal Polyglot Runtime - Write Python, C, Rust, Java in one file with shared state
Project description
The Universal Polyglot Runtime
Write Python, C, Rust, Go, Java, and TypeScript in a single file with shared state and event streams.
🚀 The Singularity for Code
Qyro breaks down language barriers. It allows you to define an entire distributed system—backend logic, high-performance kernels, and frontend UI—in a single .qyro file.
The Qyro Orchestrator parses this file, compiles native code (C/Rust/Go) on the fly, launches microservices, and connects them via a high-speed Shared Memory Event Bus (Redis) and Reliable Event Streaming (Kafka).
✨ Key Features
| Feature | Description |
|---|---|
| 🏳️🌈 Polyglot | Mix Python, C, Rust, Go, Java, TypeScript, and React in one file. |
| 🧠 Shared State | Zero-latency variable sharing across languages via Redis. |
| 📡 Event Driven | Built-in Kafka integration for reliable, scalable messaging. |
| 🛡️ Self-Healing | Automatic process supervision, crash detection, and exponential backoff. |
| ⚡ High Performance | Compile native modules on-the-fly for critical paths. |
| 🌐 API Gateway | Integrated WebSocket/HTTP gateway for external access. |
🏗️ Architecture
Qyro isn't just a runner; it's a complete operating environment.
graph TD
%% Styling
classDef core fill:#1e1e1e,stroke:#00d4ff,stroke-width:2px,color:#fff
classDef polyglot fill:#2d2d2d,stroke:#00ff9d,stroke-width:2px,color:#fff
classDef store fill:#1e1e1e,stroke:#ff00aa,stroke-width:2px,color:#fff
classDef stream fill:#1e1e1e,stroke:#fff,stroke-width:2px,color:#fff
subgraph Singularity["The Singularity (main.qyro)"]
direction TB
Src["Source Code"] -->|Parser| Parse["Qyro Parser"]
end
Parse -->|Compiles| BinC["C/Rust/Go Binaries"]
Parse -->|Prepares| ScriptPy["Python/TS Scripts"]
subgraph Runtime["Runtime Environment"]
direction TB
Orch["Qyro Orchestrator"]
P1["Process 1 (Python)"]
P2["Process 2 (C/Rust)"]
P3["Process 3 (Node)"]
Orch -->|Supervises| P1
Orch -->|Supervises| P2
Orch -->|Supervises| P3
GW["API Gateway"] <-->|WS/HTTP| P1
end
P1 <-->|Read/Write| Redis[("Redis Shared State")]
P2 <-->|Read/Write| Redis
P3 <-->|Read/Write| Redis
P1 <-->|Pub/Sub| Kafka{"Kafka Event Bus"}
P2 <-->|Pub/Sub| Kafka
%% Apply styles
class Src,Parse,Orch,GW core
class P1,P2,P3,BinC,ScriptPy polyglot
class Redis store
class Kafka stream
⚡ Quick Start
Prerequisites
- Python 3.8+
- Redis (Optional, for shared state)
- Kafka (Optional, for event streaming)
Installation
git clone https://github.com/qyro-dev/qyro.git
cd qyro
pip install -r requirements.txt
Running Your First App
Create a file named hello.qyro:
>>>schema:global
# Define shared state variables
counter: int
>>>python:p1
import time
from qyro.lib import shared
print("Python: Starting counter...")
while True:
val = shared.get("counter") or 0
shared.set("counter", val + 1)
time.sleep(1)
>>>c:p2
#include <stdio.h>
// C code runs natively!
int main() {
printf("C Module: Watching shared memory...\n");
while(1) {
// Pseudo-code for brevity
sleep(1);
}
return 0;
}
Run it:
python run.py hello.qyro
📚 Documentation
Detailed documentation is available in the Wiki.
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 Distribution
Built Distribution
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 qyro-2.0.0.tar.gz.
File metadata
- Download URL: qyro-2.0.0.tar.gz
- Upload date:
- Size: 92.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df3a7f81a186e3b637cc6b34a23e3abc0a9db9fcdba2c932b26497427c9d6178
|
|
| MD5 |
6dd846f070b8acb01253c70235f5d053
|
|
| BLAKE2b-256 |
2f852e828a203632b692608c057b7a6a7516adda02d73f09df2027761512ed8f
|
File details
Details for the file qyro-2.0.0-py3-none-any.whl.
File metadata
- Download URL: qyro-2.0.0-py3-none-any.whl
- Upload date:
- Size: 104.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41b14d917904eaee4c28c39b1f456a3cc0d5dd07405e80c235e43e478bf5dce2
|
|
| MD5 |
cf38a04e806b2d43bf4dd4263187b763
|
|
| BLAKE2b-256 |
8513f2d11793b5bce5fb13bb2124f622d13533340671b46bf5998a7b38a688a0
|