Remix.run Logo
77pt77 2 days ago

The fact that we're still pretending PHP is a valid solution for almost anything after all these years is a joke.

Not only that, but now we have these "frankenstein" solutions with all the interop problems on top of PHP.

Just shows that as a species humans really can't learn.

avan1 2 days ago | parent | next [-]

author here. thanks for reading my post. i didn't suggest php for all type of projects. i don't choose that myself. what i just mentioned if the only reason to choose something else for responding some apis faster you still may continue in php for that.

phendrenad2 2 days ago | parent | prev [-]

PHP really isn't that different from Ruby or Python these days. But, I can see the perspective where none of those 3 are valid solutions given newer better options like NodeJS and Rust.

const_cast 2 days ago | parent | next [-]

NodeJS is, like, 10 steps back from PHP 8. Worse type system, less safe, package ecosystem is a hot mess, slower... I mean the list goes on and on.

We can "lipstick pig" a lot of those problems by using typescript or whatever, but now we're compiling JS and the output isn't even fast. At that point use a competent compiled language like C# or Rust.

77pt77 a day ago | parent [-]

As someone who is not a fan of npm/ts I must say I find this almost delusional.

TS is way better than PHP and node is much faster.

const_cast a day ago | parent [-]

TS type system is virtually identical to PHP - structurally typed, union types, etc. I don't know why people think PHP is untyped - it's not 5.4 anymore. The type system is very full featured.

The difference is TS has to be compiled, PHP doesn't. If we have to compile stuff we might as well use a more safe language like C#.

Also no, Node is not fast. I don't know why people think Node/JS is fast. JS has very poor performance characteristics and it can't be fixed because it's a factor of the language design - although, PHP has similar problems.

Chromium is very optimized, for specific scenarios. Its still a dynamically typed, garbage collected language - and optimizing a for loop in a play pretend medium blog doesn't change that.

77pt77 a day ago | parent [-]

> Also no, Node is not fast. I don't know why people think Node/JS is fast

Node is not fast. It's faster than PHP and that is very clear.

The most cursory search and hands on experience will tell you that.

const_cast 18 hours ago | parent [-]

I don't think Node is faster than PHP because you can pretty aggressively optimize PHP. Between opcache cache, hot interpreters, JIT, frankenphp...

Chromium optimizes JS, sure, but not for that use case. It optimizes it for the frontend. I'm sure a huge part of that is how fast you can compile it - which means less aggressive optimize. I'm sure chromium absolutely does not optimize for long-lived JS processes.

Although, to be fair, I don't actually know which is faster. Just based off of my own experience, JS has been shockingly slow, and PHP quick in production. But that could be React clouding my view.

All in all, JS and PHP are pretty similar. The same stuff that makes JS slow is the stuff that makes PHP slow. Its not like JS has some magic sauce to turn an interpreted dynamically typed language into a performant one.

sneak 2 days ago | parent | prev [-]

Yeah, I use php colab all of the time to run numpy stuff on gpus, I learned about it in my php data science class in university.

They’re basically equivalent now.

phendrenad2 2 days ago | parent | next [-]

You're right, there is one area where Python has an advantage over PHP, but it has nothing to do with the language, really, and more to do with tools people have built to transform the language for other purposes. So it's sort of like saying Python and Ruby are completely different because Rails exists for one and not the other.

77pt77 2 days ago | parent | prev [-]

>I learned about it in my php data science class in university.

I rest my case...

phendrenad2 a day ago | parent [-]

Ah, another data scientist, I should have known.