5 ms·
It's right there in the Wikipedia article you linked to: Although it was developed under the name Mocha, the language was officially called LiveScript when it
by cygx 12y ago
It's right there in the Wikipedia article you linked to:
Although it was developed under the name Mocha, the language was officially called LiveScript when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, but it was renamed JavaScript when it was deployed in the Netscape browser version 2.0B3.
The change of name from LiveScript to JavaScript roughly coincided with Netscape adding support for Java technology in its Netscape Navigator web browser. The final choice of name caused confusion, giving the impression that the language was a spin-off of the Java programming language, and the choice has been characterized as a marketing ploy by Netscape to give JavaScript the cachet of what was then the hot new web programming language.
It was a marketing thing.
- sambeau 12y agoThat's explains how LiveScript became Javascript but it doesn't answer the more interesting question: how did Netscape end up using a Sun trademark?
- pluma 12y agoAs I understand it from Crockford's retelling and what I've read on the web and heard in podcasts, Sun was concerned that LiveScript could be seen as a competitor to Java if both were present in the browser. Netscape wanted Java but wasn't willing to kill off their scripting language, so they agreed to name it JavaScript to make it sound like the two are related (and JS being "merely" a scripting language, people would still prefer Java for "real" programs). Apparently LiveScript was also originally planned to be more Lisp-like but then they went with C-like syntax because that was more popular at the time (see Java). And the entire language was cobbled together in a ridiculously short time frame (something like a couple of weeks?) and intended to be "beginner friendly", which is where a lot of the language's quirks come from. Considering the original JS already contained the syntax Crockford would eventually define as JSON, you could say they managed to create not one but two languages at once. Say what you will about JS being a good language or not, but you have to respect that achievement. Considering JS only became ECMAScript because Netscape was scared of incompatible copycats, you could argue JS as it is today wouldn't exist without Microsoft, too. Strange world, eh?
- Stratoscope 12y ago> Considering the original JS already contained the syntax Crockford would eventually define as JSON, you could say they managed to create not one but two languages at once. No, the original version of JavaScript did not include object literals and array literals - the two foundations of JSON. Object and array literals were introduced in JavaScript 1.2: https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_in_JavaScript/1.2 https://developer.mozilla.org/en-US/docs/Web/JavaScript/New_... This is why old-school JavaScript programming had so much code like this: var obj = new Object; obj.prop = 'value'; and: var ary = new Array; ary[0] = 'first'; ary[1] = 'second';
- BrendanEich 12y agoRight, and note to grand-parent post: Crockford was not at Netscape so he's not the eyewitness you're looking for. I created JS1.2 and SpiderMonkey in fall 1996, as described in that JS Jabber podcast. Find this part in the transcript: "I started to rewrite the VM, pay off technical debt, and I wrote what became SpiderMonkey. The original Mocha VM was not SpiderMonkey." Object and array initialiser syntax was inspired by Python of the time (1996 would be Python 1.x, x around 6 IINM), but I made property names literals when spelled without quotes, as identifiers (same as the implicitly quoted name on the right of dot in member expressions). In ES6 (in imitation of computed property access using square brackets) you can finally compute property names in object initialisers too: var obj = { [nameExpr]: valueExpr };
- Telematica 12y agoAmazing. There is a bunch of stuff to ask for about JS API...
- pluma 12y agoOkay, so you didn't create the syntax JSON was based on until JS1.2? What I was getting at remains true then, though: you created JS and you created the object and array literal syntax that Crockford then "discovered" (to quote Crockford) and defined as JSON. Even if you didn't do it in the same couple of days it took you to create the original JS itself ;)
- cygx 12y agoI don't really understand what remains unclear. The cited section explains that when Java got put into the browser, executives of both companies got together and decided that it would be good PR to rename LiveScript into JavaScript. As Java was a trademark by Sun, they obviously had to register JavaSript as well (if they hadn't already done so - I did not look up the timeline, but it's not really relevant to the argument). Getting a license from Sun made it possible for Netscape to use the name without the Java trademark becoming diluted. Remember, if you don't defend your trademark, you'll lose it.
- ralmidani 12y agoBut Sun and Oracle have not demanded other users of Javascript obtain licenses.
- pluma 12y agoTrue, but for a long time the only noteworthy "other user" was Microsoft and they kept calling it JScript for years even after they adopted the standard. I'm not sure what exactly happened, but at some time after or during the lifetime of IE9 they stopped referring to their dialect of ECMAScript as "JScript" and began calling it "JavaScript". The most recent stuff I can find about JScript is about JScript.NET, which seems to be discontinued. There's this issue filed on the Mozilla project back in 2000 that addresses this problem: https://bugzilla.mozilla.org/show_bug.cgi?id=44841 https://bugzilla.mozilla.org/show_bug.cgi?id=44841 As Google, Apple and Microsoft are openly using the JavaScript trademark (without marking it as a trademark) these days, I'm going to go out on a limb here and guess that it's okay to use the term "JavaScript" to refer to an ECMAScript implementation that is compatible with the original JavaScript language developed by Netscape. This would probably preclude Adobe's ActionScript and other "enhanced" flavours of ES (e.g. JSX? I've never seen Facebook refer to JSX as "JavaScript <something>" in a way that would imply JSX is simply JavaScript).
- cpach 12y agoGah. It’s such a weird naming choice. I still have peers confusing Java and Javascript...
- _random_ 12y agoIt's sort of elegant, nicely rounds up the whole collection of weird choices in JavaScript's design.
- chrisdevereux 12y agoI heard that if you try to run Java in a Javascript VM, it is silently coerced into almost the right JS code.
- chc 12y agoMost Java programs won't even parse.