Why Rust for PHP Embedding (Not Go)
I'm a Go developer building a PHP application server in Rust. Here's the FFI reasoning, the C wrapper it forced on me, and what cgo actually costs when you measure it.
Go is my primary language and has been for a long time. When I started building ePHPm
a few weeks ago the obvious move was to write it in Go. ePHPm is a PHP application server. It’s one binary that embeds
the real PHP interpreter (libphp, the Zend engine) and puts an HTTP server, TLS, a KV cache and a database proxy
around it. A PHP app doesn’t need nginx + php-fpm + Redis to run. FrankenPHP already proved
the “PHP inside a Go web server” idea works, and it works well. I…
