If JavaScript Were Such A Great Language ...
... why aren't its extra-web-browser versions being used widely.
Here's my observation: If people wanted to, they can use JavaScript for:
- Windows shell scripting (JScript Windows scripting host)
- General purpose Windows/.NET programming (JScript.NET)
- General purpose dynamic language programming for the JVM (Rhino)
- General purpose Unix shell scripting (xpcshell)
- Scripting applications (for C++, Java, .NET applications through one of the above technologies)
All of the above technologies have existed for at least five years, some even ten. But if people are using JavaScript for non-web programmings, they are not talking about it.
Something to think about on a Monday morning.
Re: If JavaScript Were Such A Great Language ...
Re: If JavaScript Were Such A Great Language ...
JS is a great language - unfortunately, it was thought of as a toy language until recently (3-4 years) till a slew of 'AJAX' applications flooded the market.
Even today many ppl are counfused between the browsers DOM API and the JS language and tend to blame JS for all of DOM APIs pain.
However, recently JS is popping in all kinds of places. as the previous post points out - Action Script is a great example.
- Java6 comes bundled with Rhino (see http://www.onjava.com/pub/a/onjava/2006/04/26/mustang-meets-rhino-java-se-6-scripting.html)
- Jaxer is a server side platform based on JS
All these are signs that JS is here to stay! Js has its wrinkles but now that it is in the limelight, the deficiencies in the language will get attention - only time will tell if the wrinkles will be ironed out or in the name of making it better it gets more wrinkled :)
Re: If JavaScript Were Such A Great Language ...
I think there are several underlying reasons. First of all, EcmaScript 3 has some notable drawbacks - a very minimal library system, lack of built-in support for many higher-level abstractions, etc. This makes languages like Python often more attractive for tasks like extensions and scripting. Many of these drawbacks are dealt with in ES4, but that's not finalized yet.
Second, on a more social note, Javascript has a heavy stigma attached to it. Despite folks like Steve Yegge and Douglas Crockford evangelizing it, Javascript has a reputation as a "web language" which one wouldn't want to use for real programming. It's going to take a lot to overcome that.
Finally, each of the implementations listed have their own issues. JScript is tied to Windows, JScript.NET to .NET (and maybe Windows, too; I'm not sure about the status of it with respect to Mono), and Rhino to the JVM (although it is used in various Java projects). SpiderMonkey, the engine behind Firefox and xpcshell, is neither developed nor marketed as a language for general-purpose scripting. I haven't tried, but I imagine it would be much harder to use it to do some trivial file manipulation than it would to use, say, Perl or Bash.