A Rust-Powered,
PHP-Family Language
for Fast Web Backends
Supercharge Laravel-style apps with the raw speed, memory safety, and zero-GC predictability of Rust. Eliminate per-request bootstrapping without complex workarounds.
Or via Cargo: cargo install rhp
// 1. Native Rust-backed collection pipeline
list $orders = Arr::list([120, 45, 890, 15, 330])
->filter(fn($price) => $price > 50)
->map(fn($price) => $price * 1.08);
// 2. Non-blocking Tokio fiber concurrency
[$user, $metrics] = Future::wait([
fn() => DB::table('users')->find(42),
fn() => HTTP::get('https://api.internal/metrics')->json()
]);
// 3. Post-response cleanup hook
Future::defer(fn() => Log::info("Served user #{$user->id}"));
// 4. Instant verification: zero GC pauses
Sys::print("Peak memory: " . Memory::peak() . " bytes");Why RHP? Built from the ground up in Rust
Solve the core scalability and architectural limits of traditional dynamic runtimes without sacrificing developer velocity.
Persistent Parent Architecture
Eliminates PHP-FPM's per-request bootstrap overhead. Your application code, routing, and framework state are compiled once into immutable Arc<EngineState>.
// Bootstrapped once in Parent Process
singleton class AppEngine {
public static function boot(): void {
DB::pool(min: 10, max: 100);
}
}Native Rust Collection Subtypes
Standard arrays map directly to high-performance Rust heap structures with Copy-On-Write (COW) semantics and CPU cache locality.
// Explicit Rust collection subtypes
list $nums = Arr::list([1, 2, 3]);
dict $user = Arr::dict(['name' => 'Alice']);
set $tags = Arr::set(['fast', 'rust']);Tokio Async Concurrency & Fibers
Synchronous by default on local fibers, but non-blocking when needed. Run background tasks or parallel queries with Dart-inspired Futures.
// Parallel queries evaluated cleanly
[$orders, $stats] = Future::wait([
fn() => DB::table('orders')->recent(),
fn() => HTTP::get('https://analytics')->json()
]);Dual-Engine Execution Strategy
Tree-walking AST interpreter for sub-millisecond dev cold starts and hot-reload. Lowers to Register Bytecode VM with Cranelift JIT in production.
// Development (picks index.rhp in pwd)
rhp run dev
// Production (specify target via --file)
rhp run build --file="/your-path/server.rhp"Zero-GC Deterministic RAII
No stop-the-world garbage collection sweeps or pause times. Request memory is deallocated in O(1) time via bump arena resets.
// Bump arena reclaimed in O(1)
Memory::scope(function() {
$temp = File::read('heavy.csv');
// Drops instantly on return
});
print(Memory::gcPauseMs()); // 0.0AST-Guided Lint & Auto-Typing
Integrated toolchain inspired by Mago. Formats code to 4-space standard, automatically infers variable type hints, and normalizes casing.
// Before: $fullName = 'alice';
// After 'rhp run lint':
string $full_name = 'alice';The Same Backend Task, Compared
See how RHP balances Laravel's developer velocity with Rust's thread-safe concurrency and memory guarantees.
// RHP: Clean expressive syntax, Tokio non-blocking fibers, zero GC
function getUserDashboard(int $user_id): dict {
// Run both network & DB queries concurrently without thread locking
[$profile, $orders] = Future::wait([
fn() => DB::table('users')->find($user_id),
fn() => HTTP::get("https://api.orders.internal/{$user_id}")->json()
]);
// Native Rust list filtering & transformation
list $high_value = Arr::list($orders)->filter(fn($o) => $o['total'] > 100);
// Post-response hook: flushes to client first, logs in background
Future::defer(fn() => Log::info("Dashboard rendered for {$user_id}"));
return Arr::dict(['user' => $profile, 'recent_orders' => $high_value]);
}Arc<EngineState> memory.RHP Playground App
An interactive desktop scratchpad to run RHP scripts instantly and debug Local, Docker, or Remote applications — just like TweakPHP for your PHP & RHP workflows.

Instant Script Runner
Test RHP syntax, native collection pipelines (`Arr::list`), and Tokio async futures without boilerplate, scaffolding, or server boots.
Local, Docker & Remote SSH
Connect directly to your local projects, Docker containers, or live staging/production servers over SSH to evaluate code in context.
TweakPHP-Style Workflow
Query application databases, call service classes, verify fixes, and inspect output with real-time memory and GC telemetry.
Ecosystem & Development Roadmap
Transparent progress from initial language design to register VM execution and enterprise production stability.
Command-Line Toolchain
Single static binary rhp handling direct dev interpretation, production bytecode JIT compilation, and linting.
VS Code & Neovim Extensions
Syntax highlighting grammars, semantic tokens, and Tree-sitter parsers for modern code editors.
Language Server (LSP)
Real-time diagnostic checks, symbol completion, type inference tooltips, and jump-to-definition.
Rust FFI & Tier 2 Plugins
Include custom high-speed Rust crates and compile native shared libraries directly into your engine.
Milestone Timeline
Language Foundation & AST Engine
- ✓Logos zero-copy DFA lexer and Pratt expression parser
- ✓Tier 1 native facades (Arr, Str, Future, Memory, Sys)
- ✓Direct AST dev interpreter (<5ms cold start)
- ✓AST auto-formatter & boundary typing (rhp run lint)
Register VM & JIT Pipeline
- •Compact register-based linear IR bytecode emission
- •Cranelift JIT hot-path native compilation
- •Multi-worker Tokio fiber execution pool
- •Persistent parent process immutable Arc<EngineState>
Package Ecosystem & Composer Bridge
- •Dedicated RHP package registry and dependency solver
- •Transparent Composer autoload bridge for legacy vendor packages
- •Full Debug Adapter Protocol (DAP) server for IDEs
- •WebAssembly browser-compiler distribution
LTS Release & Framework Kernel
- •Complete Laravel-compatible drop-in HTTP router & ORM
- •Long-term API stability and strict semver guarantee
- •Automated migration toolchain from PHP 8.x codebase
- •Enterprise production benchmarking harness
Up and Running in 30 Seconds
Three simple steps to install the toolchain, write your first script, and run it at sub-millisecond speeds.
Install with Homebrew
Install the official standalone RHP binary for macOS or Linux using Homebrew.
Write hello.rhp
Write clean PHP-style syntax utilizing Rust-backed static facades like Str and Sys.
string $slug = Str::slug("Hello RHP");
print($slug);Execute with rhp CLI
Run instantly with the AST development interpreter, or compile to bytecode VM via production mode.
Join the Future of High-Performance Web
RHP is 100% open source under the MIT license. Connect with contributors, contribute to language design, and help build the runtime.
GitHub Repository
Explore the Rust codebase, track active pull requests, and star the project.
github.com/vuenice/rhp →Discord Community
Chat with core language engineers, discuss syntax RFCs, and seek assistance.
Join server →Contributing Guide
Setup Rust 2024, run the integration test harness, and submit your first PR.
Read guide →Sponsor the Project
Help fund our automated benchmarking infrastructure and developer tooling.
Become a sponsor →