you are viewing a single comment's thread.

view the rest of the comments →

[–]SoCo 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 1 fun -  (0 children)

Great article. While it is the right answers for the context of those looking for a high level comparison as the article is targeted..the deeper-dive of details are, as usual, more involved.

(PHP) Web-oriented only / no multi-threaded

While PHP is just another scripting language, like JavaScript, and can be utilized anyway you'd like....but it is very much focused on it's original purpose, to preprocess and markup HTML. It has features that make it particularly geared towards easily generating text.

Like, JavaScript, PHP is just a script language with no built-in multi-threading support, but also like JavaScript, PHP has a several ways to run scripts concurrently and a few ways to give actual multi-threading support with extensions.

The pthreads library bindings allow PHP to use full multi-threading through API calls. While API calls are a little more bulky, they are familiarly similar to use of the same APIs in C/C++.

Node.js provides the extension for multi-threading to JavaScript and simplifies the threading API usage so it seems built-in to the JavaScript language, like the other node improvements to JS.

I've not used them, but PHP has both PECL and PEAR "extension libraries." I'm not sure how that differs from a package manager, like Node.js's NPM. I would expect it to be a little more clunky to use, not because of PHP particularly, but because of the PHP or webserver(Appache)'s module enabling/disabling system. Yet most webhosts have a reasonably easy-to-use user interface for managing Apache modules, PHP extensions, and usually PECL and/or PEAR in their cpanel.

I had once, just for fun, tried out the wxWidgets binding for PHP, to make a cross-platform GUI desktop application:

https://www.wxphp.org

So, as the article says, despite being old, frequently hated, and sometimes clunky, PHP has established a lot of support. I think plain JavaScript is regarded quite similarly, before Node.js makes it better. Maybe PHP will some day be revitalized with a similar extension. One day, there could there be a Node.php...