> In short, the modern PHP ecosystem gives us the best of both worlds: the ability to build quickly and confidently in PHP, while still having powerful options (C, Rust, Go) for performance-critical parts. This hybrid approach lets us stay productive without sacrificing speed where it matters most. I understand this for a large codebase where rewriting is not feasible. But if that wasn't the case, a C# APIs achieves…
The Rise of Hybrid PHP: Blending PHP with Go and Rust
101–110 of 158 posts
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#102Earlier quoted context omitted.
Do we need to post that JS' weird things link here? Of the basics of JS, few things are sound. The "firm foundation" idea doesn't really work for JS. It might even work better for PHP, and I am saying that as someone, who doesn't want to do PHP ever again.
JS is very much a minimal language that has a handful of choices. E.g. arrays being objects with field names that are sequentially numbered integers. The initial equality operator was a mistake, but that was rectified over a decade ago with `===`. Not having a proper int type sucks and holds the language back in a number of ways, but otherwise the language is wonderfully regular. And anyone who complains about the ec…
Saying “at least x isn’t as bad as y” doesn’t further a discussion, it only acknowledges denial about just how bad the problems are with x.
This is particularly true when we weren’t even discussing y (in our case, Python) in the first place.
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#103Joined {{company}} when everything was using 5.4, there was a big distaste of PHP back then. But as PHP have released newer versions I'm convinced our migration away from PHP (which is just finishing) is probably a step backwards _now_ that PHP is awesome. Everyone still thinks it is like 5.x days, it really isn't.
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#104Pasir is like frankenphp, but in Rust. Very promising, but still early in development: https://github.com/el7cosmos/pasir Which uses the following Zend API bindings for Rust: https://github.com/davidcole1340/ext-php-rs There's also all sorts of interesting experiments, like ngx-php, which basically embeds PHP via Zend API inside an nginx binary: https://github.com/rryqszq4/ngx-php And workerman, which has a hybrid ba…
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#105The complexity with debugging and maintenance seem to be overlooked, if you have the option don't do this.
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#106Reminds me of how Yahoo! worked back in the day. All their display logic in PHP, with the hard business logic in c extensions.
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#107When I do stuff like this, I just write the front app in the new/fast language, then reproxy the stuff not written in the fast language to the legacy app. You can even add middlewares or caching or metrics in the new app for requests going to the old one, as you can run (fast) code around both the request and the response. It’s the best of both worlds - the new app gets to see all of the traffic, but doesn’t need to…
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#108I bit the bullet rewriting my app from PHP to Go and it paid off for my company, we're talking 20K lines of PHP code, reduced to 4K lines of Go and with the added efficiency gains with it. I think some orgs just need to take the jump and plan a rewrite, add tests (easier with Go) and just do this if they are a PHP shop, I would say it's worth it. Instead of blending Rust/PHP or Go together and having an unmaintainabl…
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#109This sounds absolutely disgusting to maintain. Where are you going to hire devs that want to work on crap like this?
Re: The Rise of Hybrid PHP: Blending PHP with Go and Rust
#110When I do stuff like this, I just write the front app in the new/fast language, then reproxy the stuff not written in the fast language to the legacy app. You can even add middlewares or caching or metrics in the new app for requests going to the old one, as you can run (fast) code around both the request and the response. It’s the best of both worlds - the new app gets to see all of the traffic, but doesn’t need to…
good idea, which language you choose for that ? also with frankenphp you can just write those required apis to be really fast as go extensions.