Hacker News new | ask | show | jobs
by zelon88 2025 days ago
I hate to be "that guy" but I see no reason not to use PHP for all three of those things.

PHP is faster than Ruby. [1]

PHP from a local script does math just fine. It's the round trip of the request to a PHP server and back that you're associating with poor language performance. In a local scripting environment PHP7 is considerably faster than Python3. [2]

PHP is an extremely popular language as the backend for SaaS, and arguably one of the oldest and most successful. [3]

[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

[2] https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-...

[3] https://insights.stackoverflow.com/survey/2020#most-popular-...

4 comments

> PHP is faster than Ruby.

It's not helpful to be faster than the language that the parent implied wasn't fast enough.

I think the parent's point was that if the startup's raison d'etre involves "chew[ing] through TBs of data every hour", then choosing a language that can do that 10x faster than another might have a tremendous impact on cost and so the company's value. It might be the difference between successful or not.

More generally, "it depends".

> PHP from a local script does math just fine

It depends on the definition of "just fine" really, not to be argumentative. I've written quite a few algorithms processing big numbers (e.g. numbers with digits in the megabytes) and PHP struggles, where other languages like GO are several times faster and often far more easy to parallelise whereas with PHP if I want to try and use the multiple cores my CPU has, I need to look into pthreads or worse, write worker scripts that I execute with backticks or curl, it's clunky for that use-case. I wouldn't even know where to start thinking about how to run my algorithms in the GPU with PHP.

I say this as primarily a PHP developer in my paid profession, and PHP is my go-to for any kind of web development or if I want to prototype an idea - it's a very expressive and intuitive language but there are always use-cases that any language is decidedly unsuited to, even if it's "technically" capable. I wouldn't build a website in native C, even though I know it's "technically" possible for example.

Well, if you have to chew through TBs of data every hour, don't use PHP i think? Unless you're not in a competitive business and you can pretty much throw money at the data?

I think to OC is not well formulated: If you're selling a web app or web SAAS, any language the founders know best is the best. Any other stuff, it is not always the case (but it might be!)

"PHP from a local script does math just fine"

I suspect they meant the kind of heavy math that the PHP 8.x JIT is trying to improve performance for.