Hello guys,
If you are reading this blog then you must have already gone through so much trauma of "Php is dead".
But I'm not going to say that, neither disrespect any language. I have always respected experience and PHP has experience of handling 70% internet of 30 years.
I have also 8+ years experience on PHP and js, but always kept learning working model of other languages like JS, Python, Julia, Ruby, Java, Scala, Rust etc
My this interest has led me to think what technology has evolved in 30 years which php can't adapt. With respect PHP or any other technology has to support already created projects, they just can't do total refactoring for the sake keeping alive internet.
So the answer was
- Async programming like JS, Dart and Rust.
- Fiber and co-routine based thread use.
- Go and Rust like parallel programming.
- Memory safety like Rust borrow checker.
- Type-safety like rust and typescript.
- List, Dictionary, Set and Hashmap datatype like JS and Python.
- Simplicity of running command like "run dev, run build"
- Binary build
- Secure environment without eval, $$, extract()
- Numpy and dataframe ML tools like Python,R
- Power of system language inside high-level language.
Some more questions I have
- Why can't we add types to variable automatically if type-safety increases program speed?
- Why shouldn't a programming language have it's own linter, python dart has strict linting rules.
And the frustration I had comes from following issues:
- The mental model of php of having global functions is too much difficult for human to remember, even with IDE helpers it's difficult to ease the use. That's why Laravel which had improved this has become biggest player in market.
- PHP array are way too bad designed for modern era, you simply cannot make optimization at system language level, every other programming language follows a different and common approach of List, dict, set etc.
- There are no classless objects, we have to just use array/stdObject, for this drawback laravel made collection.
- Providing dynamic or optional type-safety is good feature of php, but should have been also given for basic datatype declaration, Nested types(BelongsTo)
- I still struggle to find right linting tool and right vscode extenstion phpstan, php intelliphense, php cs fixer, pretty-php, mago(latest and finest) I know having multiple tools around language is proof of excellence but these tools in itself solve different problem, can't be used together, different member of team sometimes end up using different formatting. Although this issue has been solved by Mago (rust based linter, formater for php) and I'm inspired by that.
- I had to use a Concurrency facade in laravel, then it asked for some php extension to enable (have to done on all environments), then realized it's actually producing slower result then normal way. believe me every php parallel processing like swoole, octane, FrankenPHP each is not as easy as said and is way difficult to implement. on top of that Laravel Defer and Concurrency should have been language features.
- Cyclic reference and Need of garbage collector. if every request runs inside VM with dedicated memory and time limit, then what is the need of removing &$x from function declaration in php5.
- Now the php devs are trying to enter into Mobile app space, but here also the language itself is constraint if you read about how react native and dart uses system level optimization for rendering and performance.
- Why thousands of lines of code have to boot with each request.
To solve this issues I have created a new programming language
RHP: Rust powered php successor
if you want to explore more on the idea please have a look.
If you know a feature or core function not implemented yet in RHP please create a issue.
If you like the idea please help us fork the php packages and upgrade them to RHP.
If you know rust please help us improve helper classes/functions written in rust or help us create new packages in rust for RHP.
If you know some core compiler basics please help me refactor AI code to hand written code.
Your help, even via vibe coding will be huge help to open source.
The Goal of RHP is to give
- Better Developer experience to power rust developers develop website in high level language.
- Keeping Rust level performance.
- Easy Laravel application upgrade.
- More Type-safety.
- Single Boot for web runtime.
- Async, multi thread, multi process and multi core functionality via runtime.
- Give chance to PHP developers to learn rust or shift to rust for better salary.
Thanks and Regards,
Yogesh Galav
Top comments (0)