Hybrid is a high-performance polyglot programming language engineered to solve the friction between high-level scripting and systems-level programming. It allows developers to embed Python and Rust blocks directly within a unified Hybrid source file, leveraging the strengths of each language without the burden of complex build systems or FFI boilerplate.
"Write the orchestration in Hybrid, the data logic in Python, and the bottlenecks in Rust."
- Native Polyglot Execution: Define
#pythonand#rustblocks that execute as first-class citizens within the Hybrid runtime. - Strongly Typed Architecture: A robust type system including
int,float,string,bool,array, andmap. - Automated Interoperability: Transparent JSON-based data marshalling between language boundaries.
- Built-in LSP Support: Full Language Server Protocol implementation providing real-time diagnostics and autocompletion.
- Developer-First Tooling: Zero-configuration environment—simply run
hybrid run.
- Rust:
cargo1.70+ - Python:
python3.10+ - Node.js:
npm(for IDE extensions)
-
Build the Core CLI:
git clone https://github.com/Creating-Real/hybrid.git cd hybrid/language cargo install --path .
-
Environment Check:
hybrid doctor
-
IDE Extension:
- Navigate to the
extension/directory. - Initialize dependencies and compile:
npm install && npm run compile. - Install the generated
.vsixfile to VS Code.
- Navigate to the
Create main.hyb:
// Native Hybrid declaration
string const project = "Hybrid Engine";
// Compute heavy tasks in Rust
#rust
int block fibonacci(int n) {
if n <= 1 { return n; }
let (mut a, mut b) = (0, 1);
for _ in 0..n {
let temp = a;
a = b;
b = temp + b;
}
b
}
// Data processing in Python
#python
string block welcome_msg(string title) {
import datetime
ts = datetime.datetime.now().strftime("%H:%M:%S")
return f"[{ts}] Initializing {title}..."
}
// Orchestration in Hybrid
speak(welcome_msg(project));
int var result = fibonacci(12);
speak("Computation Result:", result);Run the program:
hybrid run main.hybHybrid operates as a tree-walk interpreter written in Rust. It utilizes a sophisticated Runtime Manager to handle bridge communication:
- AST Transformation: Hybrid parses source code into an Abstract Syntax Tree, isolating foreign blocks.
- Stateless Bridging: Arguments are serialized to JSON and passed via standard streams to specialized language shims.
- Dynamic Execution: Python blocks use transient subprocesses, while Rust blocks are compiled on-demand in a temporary workspace for maximum performance.
Detailed documentation: docs/ARCHITECTURE.md
- Native Control Flow & Dynamic Scoping
- Initial Polyglot Bridges (Python & Rust)
- VS Code Extension & Language Server (LSP)
- Standard Library: File IO, Networking, and Cryptography
- Process Daemons: Persistent runtimes for low-latency foreign calls
- Hybrid Orchestrator: Direct piping between foreign runtimes
We are an open-source project and welcome all types of contributions! Please read our Contributing Guide to get started.
- Official Website: devhybrid.org
- Email: contact@devhybrid.org
