ECMAScript and JScript: Two of a Kind

John Swenson
MSDN Online

November 19, 1997

I stayed home from the madness of COMDEX this week for the first time since 1990. With MSDN Online editor Norvin Leach covering all the speeches, presentations, and parties in Vegas, I'm free to roam the halls of Microsoft and write about exciting topics such as . . . scripting!

Scripting isn't a topic you're likely to hear much about at COMDEX, where most of the attention is focused on flashy products that are able to grab attention on the noisy, crowded show floor. Microsoft has an important story to tell about its scripting technology, however. The story has to do with standards, and how Microsoft came to support a strange-sounding specification called ECMAScript-262.

Because of the odd name, and because Microsoft and Netscape each offer their own scripting languages similar to ECMAScript, developers face a confusing picture of which scripting language to use in their Web applications.

A new standard

ECMAScript is important because it's the Web's only standard scripting language. The committee that developed it this year was comprised of scripting experts from Microsoft, Netscape, IBM, Sun Microsystems, Borland International, and other software companies. The group started work on the specification in January 1997 and managed to get the final version completed and ratified just 10 months later, in October. Microsoft's representative on the ECMAScript committee, Andrew Clinick, says it's surprising that the group was able to complete its work so quickly considering the many differences between the member companies.

"Initially it was tough," he says. "You'd think Microsoft and Netscape wouldn't talk to each other. But despite the marketing rhetoric, Microsoft and Netscape did work together quite well on this. Once the marketing people left, some real work got done." The technical people on the committee realized that their most important goal should be to create the best scripting language they could all agree on, not bicker over marketing differences, explains Clinick, who in addition to his committee duties is program manager for the Microsoft Scripting team.

The committee began its work because of the need to create a standard scripting language for the Web, one that could replace JavaScript, a proprietary language owned by Netscape. (JavaScript doesn't actually have anything to do with Java, but that's another story.) The committee started out basing their specification on JavaScript, but ended up basing it more on Microsoft JScript, Clinick says.

With the ECMAScript specification now finished, Microsoft suggests that developers view ECMAScript as the successor to JavaScript. "In essence, you can think of ECMAScript as JavaScript 1.1 with all its problems fixed. The core language hasn't really changed," Clinick says.

The ECMAScript-262 specification is available on the Web at http://www.ecma.ch/stand/ecma-262.htm. Microsoft fully supports the specification through JScript 3.0, the scripting engine built into Microsoft Internet Explorer version 4.0, Internet Information Server version 4.0, and eventually other Microsoft products. Details about JScript and Microsoft's other scripting technologies are available on the Microsoft Scripting Web site (http://www.microsoft.com/scripting/).

Netscape goes its own way

Microsoft hopes Netscape eventually will follow through with its pledge to support ECMAScript, rather than continue to go its own way with JavaScript. The new version 1.2 of JavaScript that Netscape put in Netscape Navigator version 4.0 contains extra scripting features that aren't supported in ECMAScript.

Microsoft matched those new features in JScript 3.0 and added some of its own, such as COM support. But despite the enhancements to Microsoft's own scripting language, JScript 3.0 maintains full compatibility with the base ECMAScript specification, unlike JavaScript 1.2, Clinick says. Microsoft has promised to submit all its JScript 3.0 additions to the ECMAScript committee, for inclusion in the next version of the ECMAScript specification.

With JScript 3.0, Microsoft now has a scripting language that works on both the server and client side, is 100 percent compatible with the ECMAScript standard, and matches all the new features in the latest version of Netscape's proprietary scripting language, which works only in Netscape Navigator.

One difference to remember

Developers who want to add scripting to their Web applications don't have to understand all the differences between ECMAScript, Microsoft JScript, and Netscape JavaScript. The one important difference to remember, Clinick says, is that Microsoft JScript fully complies with the new ECMAScript standard, while Netscape JavaScript does not.

There's also no need to understand how a strange name like ECMAScript came to be, but in case you're curious, here's the answer. At Netscape's request, the committee formed to create the standard did so under the auspices of ECMA, a European-based standards group previously named the European Computer Manufacturers Association. (The association now goes just by its initials.) Since Netscape retains the rights to the JavaScript name, the group had to call its scripting standard something else.

The committee slapped the ECMA name on its project as a temporary solution. "The reason we came up with the ECMAScript name is it's the worst one we could all think of," Clinick recalls. "We knew we'd be compelled to go change it afterward."

But committee members couldn't unanimously agree on a better name later and were stuck with ECMAScript. That name is unlikely to change as the committee develops the second version of the ECMAScript specification, due out sometime next year.

Substance, not flash

So there's the brief history of ECMAScript and how it relates to Microsoft JScript. Expect to hear Microsoft get more vocal about its scripting technology in the months to come, with more news due around the time of Internet World (December 10–12 in New York City.)

In the meantime, as you read the hundreds of Comdex stories coming from the small army of reporters gathered in Las Vegas this week, remember: The most important news isn't always flashy.

Comments? Please send us e-mail.