News for hackers. Stuff that matters.
Re:PHP 8.0.0 Alpha 1 available for testing by ragnese on Friday June 26, 2020 @10:04AM (#23652066)
What? PHP is a language primarily for backend web server code. Having async is huge for performance on the backend, which is mostly IO bound, rather than CPU bound.

So, I think you have it backwards. Async is unnecessary in many places, but backend is the place where it's very important.

Re:PHP 8.0.0 Alpha 1 available for testing by zowanet on Friday June 26, 2020 @11:33AM (#23653130)
JavaScript's async features are made possible because of its event loop (Node.js is essentially V8 + libuv).

You can use one of many event loop implementations with PHP, including libuv, if you so wish.

Re:PHP 8.0.0 Alpha 1 available for testing by ragnese on Friday June 26, 2020 @11:40AM (#23653206)
Sure. But JavaScript has Promise built in to the language these days. With PHP you'd have to use a third party extension, like swoole, if you want something like that. Or write your own, of course.

But should we need to do this for a 25 year old backend language?

Re:PHP 8.0.0 Alpha 1 available for testing by mns on Friday June 26, 2020 @10:29AM (#23652335)
PHP started as a scripting language and had/has many other issues and fundamentals that had/has to get right first. Don't blame PHP or Javascript for things they were not initially built and meant for, when there are other languages out there that can do what you need and have a more solid and tested foundation.
Re:PHP 8.0.0 Alpha 1 available for testing by ragnese on Friday June 26, 2020 @11:16AM (#23652926)
So what is PHP for, then? Everyone seems to be using it for backend web projects.

In my opinion, it has no valid use case that isn't done better by something else. The only thing I can think of is for shell scripting when your bash script is a little too long.

It's also been around for, what, 30 years, and still hasn't changed its broken fundamentals. And it isn't going to. It needs to be deprecated. It's run its course.

Re:PHP 8.0.0 Alpha 1 available for testing by mekster on Sunday June 28, 2020 @09:13AM (#23668488)
And your recommendations are?
Re:PHP 8.0.0 Alpha 1 available for testing by ragnese on Sunday June 28, 2020 @04:40PM (#23671867)
For backend? Kotlin. Hands down. All the benefits of the mature Java ecosystem, but with a language that is vastly superior to Java, itself.

You get coroutines, threads, strong static typing, etc. Not the perfect type system, because it's still limited by the JVM, but much much better than Java, PHP, etc.