Hello everyone! ![]()
I’d like to share an experimental project I’ve been working on recently: phpurs, a brand new PureScript backend that transpiles CoreFn directly to modern PHP syntax.
Why PHP? While the broader JS ecosystem has heavily leaned towards TypeScript, the PHP world (which still powers roughly 70% of the web) has somewhat been left without a true, strictly-typed functional alternative. Furthermore, a massive portion of the web relies on legacy shared hosting or containerless VPS environments where escaping the PHP runtime is either impossible, financially unviable, or technically difficult. Just a few examples: cPanel/Plesk, GoDaddy, Bluehost, SiteGround, standard HostGator/OVH shared plans, basic LAMP stacks…
Recently, we’ve observed a genuine surge of interest for strict typing and functional concepts within the PHP community (with recent PHP versions and RFCs: short closures, match expressions, pipe operators and partial application), although the frustration that comes with its current limitations is just as real. So… phpurs aims to provide a “comfort tool” for any PHP developer looking to finally take the leap towards a much safer paradigm. It opens a door for those who want the elegance of a purely functional language like PureScript, completely bypassing the JS/TS ecosystem, while keeping deployment as simple as an FTP upload of .php files. A massive win for legacy or small projects, which constitute the majority of the web today.
For the PureScript ecosystem, I think this is a strategic opportunity to gain visibility and traction by tapping directly into the largest demographic of web developers in the world.
To prove the viability of the concept, I built a universal multi-runtime pedagogical benchmark (altbak.pub), which runs identical PureScript code across Node.js, Arista ES, Chez Scheme, Erlang BEAM… and now natively on PHP. You can find the benchmark here.
This project is still in its infancy. It is very much a proof-of-concept, the codebase is currently quite messy, highly experimental, and heavily AI-copiloted.
If anyone is interested in parsing CoreFn, optimizing PHP code generation (e.g., proper tail call optimizations for mutual recursion, inlining), or just exploring how to bridge pure FP with the PHP runtime, your help would be obviously welcome!
You can find the project here.
Love ![]()