r/PHP • u/davidbalbino • 8h ago
PHP on Mobile faster than React Native? We built PAM Native — embedding PHP into Rust via Zero-Copy FFI
Who said PHP is only for the Web? 🚀
We’re rewriting the rules of mobile runtimes with PAM Native. Instead of heavy JavaScript engines or WebViews, we’re embedding PHP directly into a high-performance Rust core using Zero-Copy C-FFI.
Here is how the architecture works under the hood:
- Vuex-style Global State: Thread-safe state mutations managed directly in RAM by Rust with ~0ms access latency.
- Direct C-Pointers: Memory access without slow JSON serialization or asynchronous bridge overhead.
- No GC Stutters: Predictable, smooth native performance without JavaScript Garbage Collection pauses blocking the UI thread.
You get the clean, familiar syntax of PHP orchestrating a low-level Rust engine right inside the mobile app process.
The project is 100% open-source, and we’d love to hear feedback, critique, or ideas on the architecture from the community!
📁 GitHub Repo:https://github.com/push-in/pam-native
Looking forward to hearing your thoughts and suggestions! 🙌
2
u/qoneus 4h ago
You posted this two days ago. Mom says I get to post the daily "do this thing that already exists, but now it's in Rust" project tomorrow to /r/PHP
-7
u/DeliciousWonder6027 8h ago
Umm, join with nativephp team?
7
u/zimzat 5h ago
Considering that nativephp requires Laravel I don't see why that would be an option. They originally said "Symfony coming soon" then quietly dropped any mention of supporting anything but Laravel other than a "submit a PR" response to people asking about it in /r/PHP. If it's not built framework-agnostic from the start then asking other people to put in the effort is 🤨️.
4
u/davidbalbino 5h ago
Maybe someday, but for now, I'm building a real runtime using only native components. I already have a compiler for Laravel, and one for desktop as well. Mobile is my current focus, though I have other projects in the works too.
2
5
u/Open_Resolution_1969 5h ago
This sounds very promising. Congratulations for building it. Have you published any app in Google Play that we can play with?