PHP is still very web focused (server side), Javascript is a much better general purpose language, with more domains where it can be used and IMO a way much better language than PHP.
I agree that JS is a better general-purpose language than PHP, but it's still about as "Web focused" as PHP.
As far as general-purpose scripting languages go, it seems like Python has been the go-to choice in a whole bunch of domains for a couple of decades, for example:
- Unix scripting (the reason it's part of almost every distro's base install; I think even OSX includes Python)
- Desktop GUIs (GTK, wxWindows, tk, etc.)
- Non-Web, performance-insensitive games (i.e. pygame); these have always been outnumbered by Web games though, mostly with Flash and recently some with Javascript/HTML5.
- Scientific computing and data analysis (numpy, scipy, pandas, etc.); R, MATLAB, etc. are big too, but I wouldn't call them general-purpose.
About five years ago, I would occasionally run across some non-Web thing written in Ruby; i.e. I would find a CLI program which claimed to solve whatever problem I was tackling, then after about an hour battling with rubygems I'd rage quit and move on.
Within the past couple of years I've noticed a trend that these sorts of projects now tend to be written in Javascript, and its npm which makes me nope out after an hour.
Still, those have only been a tiny proportion of the applications I run across, so I certainly wouldn't recommend Javascript (or Ruby) as a general purpose language for publically distributed, non-Web applications, since a) their installation mechanisms don't seem battle-tested enough and b) very few people seem to be using them in that way.
If we're pulling alternatives out of a hat, I'd say that extrapolating the line from PHP to JS (i.e. more consistency, less bloat, fewer spandrels, safer by default, etc.) we'd reach Racket.
As far as general-purpose scripting languages go, it seems like Python has been the go-to choice in a whole bunch of domains for a couple of decades, for example:
- Unix scripting (the reason it's part of almost every distro's base install; I think even OSX includes Python)
- Desktop GUIs (GTK, wxWindows, tk, etc.)
- Non-Web, performance-insensitive games (i.e. pygame); these have always been outnumbered by Web games though, mostly with Flash and recently some with Javascript/HTML5.
- Scientific computing and data analysis (numpy, scipy, pandas, etc.); R, MATLAB, etc. are big too, but I wouldn't call them general-purpose.
About five years ago, I would occasionally run across some non-Web thing written in Ruby; i.e. I would find a CLI program which claimed to solve whatever problem I was tackling, then after about an hour battling with rubygems I'd rage quit and move on.
Within the past couple of years I've noticed a trend that these sorts of projects now tend to be written in Javascript, and its npm which makes me nope out after an hour.
Still, those have only been a tiny proportion of the applications I run across, so I certainly wouldn't recommend Javascript (or Ruby) as a general purpose language for publically distributed, non-Web applications, since a) their installation mechanisms don't seem battle-tested enough and b) very few people seem to be using them in that way.
If we're pulling alternatives out of a hat, I'd say that extrapolating the line from PHP to JS (i.e. more consistency, less bloat, fewer spandrels, safer by default, etc.) we'd reach Racket.