Saturday, July 19, 2008

Is JavaScript a type of Java?

Nope, JavaScript and Java are completely different languages. Java is a language officially developed by the Java Community Process, but in practice Sun Microsystems is its author and maintainer (because their version is nearly universal). Java is a completely system-independent ('portable') language with syntax similar to C++, implemented for the main operating systems (Windows, GNU/Linux, Mac, Unix) and maybe some others. It's a multipurpose language like C++ but of a slightly higher level (generally less efficient but safer and easier to understand).

A language originally named Mocha was invented by Netscape for Netscape Navigator; they renamed it to LiveScript until buying (from whom I don't know exactly, but mainly Sun) the right to re-rename it JavaScript. This was during the "browser wars" between Netscape and Microsoft, I think in the mid-90s. Determined to compete, Microsoft made a work-alike language named JScript for Internet Explorer. The European Computer Manufacturers Association later standardized the language, officially named ECMAScript to appease both Netscape and Microsoft. Microsoft ultimately won the browser wars and Netscape's source code, named Mozilla, was released as an open-source project. The current Mozilla Foundation carried it from there and derived its entire set of programs from it, the most notable being Firefox. (ActionScript is Adobe's ECMAScript implementation for Flash.)

ECMAScript is normally known as JavaScript, except where clarity (or politics) is needed, but Microsoft generally uses JScript. Curiously, Opera Software and Apple Computer seem to get away with calling it JavaScript for their browsers Opera and Safari.