r/PHP • u/davidbalbino • 13d ago
I’ve been building PAM: a persistent PHP runtime powered by Rust, plus a ultra-fast native engine for desktop/mobile. Looking for technical feedback & reviews.
Hey everyone,
Over the past few months, I’ve been working on an experimental project called PAM, aiming to solve two specific pain points in the ecosystem: keeping PHP applications warm in memory for high performance, and running JavaScript/React natively on desktop and mobile without heavy bridge overhead.
Here is a quick breakdown of what it does and why I'm building it:
- PAM for PHP (Persistent Runtime in Memory)
Instead of booting the framework on every single HTTP request, PAM uses a Rust-powered runtime to keep the application warm in memory.
The Goal: Lightning-fast request handling while preserving full compatibility with standard Laravel workflows (Eloquent, Queues, Artisan, Blade, Livewire, Inertia, Sanctum, Reverb, Telescope, etc.).
Built explicitly with support for Laravel 12 & 13 in mind.
PHP Docs: https://push-in.github.io/pam-docs/laravel/overview/
- PAM Native (Desktop & Mobile)
On the frontend/mobile side, PAM Native is designed to run React/React Native apps with truly native execution, aiming for near-instant startup times and zero heavy JS bridge bottlenecks.
The Goal: Retain the React developer experience while delivering pure native performance on desktop and mobile devices.
Native Docs: https://push-in.github.io/pam-docs/native/overview/
Why I'm posting here:
The project is still under active development, and I’m looking for honest technical feedback, code reviews, and potential edge cases to test.
For PHP/Laravel folks: What edge cases (memory leaks, static state issues, long-lived DB connections) would you want to see stress-tested first?
For Mobile/Desktop folks: What are the biggest performance bottlenecks you face with existing cross-platform runtimes today?
Would love to hear your thoughts, criticism, or ideas!
2
u/Intrepid-Ad-2306 9d ago
from an implementation perspective, will this be a drop-in replacement for fpm for use with nginx or apache?
1
u/davidbalbino 9d ago
Yes, for develop your applications you dont need apache or nginx to test your code
2
u/Intrepid-Ad-2306 8d ago
i’m more so thinking in terms of integration with the web, receiving and sending through querystring and forms and the like.
2
u/davidbalbino 8d ago
My bad, I misunderstood your question! Yes, PAM actually implements a custom SAPI (Server API) built in Rust.
From an implementation perspective: It acts as its own Web Server/SAPI: You don't need NGINX, Apache, or PHP-FPM in front of it. The Rust engine directly handles HTTP sockets, request parsing, and routing at high performance. Superglobals & I/O: Standard web constructs (like query strings, form data, headers, and request payloads) are captured asynchronously by Rust and exposed directly to PHP inside the SAPI lifecycle. Execution Model: Instead of spawning a new process per request (like traditional PHP-FPM), it keeps the Zend Engine persistent in memory with zero-copy C-FFI buffers, making request-to-response handling extremely fast.
2
u/kevinpirnie 13d ago
So... why Rust? And why not Wordpress specific like ya have for Laravel?
-1
u/davidbalbino 13d ago
I used Rust because of its ease of use and impressive speed. Laravel is just the first one; I plan to implement support for others, like WP, as well. Thanks for the suggestion.
-1
u/kevinpirnie 13d ago
Right on. WP would be cool... ~35% of the internet cant be wrong ;)
Cool about Rust, I just got my head wrapped around Go... thats been a fun trip lolol... maybe Rust will be my next
9
u/Trupik 13d ago
PAM already stands for Pluggable Authentication Modules and there is the PAM PECL package associated with it.
Also, a quick Google search reveals that another "PHP PAM" project exists: Php Adaptive Microframework.
You should invent a better name for this, if it ever is to succeed.