Channels ▼
RSS

.NET

Microsoft's JavaScript Move


The JavaScript language has had at least nine lives. It made its official debut in 1996 as part of the Netscape browser and has happily survived the first 15 years of the Internet era. JavaScript was designed to be a simple language to help authors make HTML pages more attractive. Instead of being a full-fledged programming language, it was just easy to use — and worked very well. Since then, JavaScript has gone through ups and downs. The low point came in the early 2000s, when the first version of ASP.NET was released with the express purpose of limiting developers' exposure to HTML and JavaScript. A few years later, with the advent of Ajax, JavaScript began its comeback.

More Insights

White Papers

More >>

Reports

More >>

Webcasts

More >>

Although JavaScript used to live within the boundaries of a web-browser engine, smarter and especially faster engines have been created recently that can be hosted outside the browser, giving JavaScript a much broader scope (think Node.js, for example).

Today, JavaScript is a critical skill for developers. And although it's still easy to get acquainted with, it isn't trivial to master its more powerful present incarnation.

JavaScript And ECMA-262

Many people who should know better still perceive JavaScript as the language of the browser and are skeptical about its wide adoption. In reality, the JavaScript language relies on a solid standard defined by the ECMA-262 and ISO/IEC 16262:2011 papers.

So what's all the fuss about?

It's important to understand that "JavaScript" is a generic term. ECMA- 262 is the recognized standard and its many implementations. Of course, a programming language's implementation makes sense only if it takes place in a runtime environment where instructions can be compiled and run. In turn, a runtime environment needs to be hosted somewhere within the context of an executable program. At present, there are several possible scenarios. The most common one is a browser that hosts a scripting engine based on an ECMA-262-compliant language. A concrete example of this would be Google Chrome (the browser) hosting V8 (the scripting engine) and consuming JavaScript (the ECMA-262–compliant language). So, essentially, JavaScript is the name of a dialect based on the ECMA-262 standard. It would be even more precise to say that Google Chrome targets ECMA-262 edition 5. Firefox, which is equipped with Gecko as its scripting engine, also targets ECMA-262 edition 5. Internet Explorer uses its Chakra engine and a dialect named JScript. Adobe Flash hosts a dialect known as ActionScript, and Acrobat Reader hosts a language still called JavaScript that targets ECMA- 262 edition 3. Finally, Opera uses ECMAScript, which is a strict implementation of the standard.

As you will see, confusion about JavaScript goes deeper than the name.

The JavaScript Dialect

A programming language's dialect is subordinate to its standard language. This subordination produces slight differences (mostly extensions) to the standard. For example, JScript offers some additional commands to support access to ActiveX objects and the local computer. This support isn't in the ECMA-262 standard but is supported if you use the dialect. The same can be said for ActionScript.

So what about the JavaScript dialect? It's a sort of sub-standard managed by Mozilla. JavaScript standard follows its own versioning, which indicates which edition of the ECMA standard is being targeted. JavaScript, JScript, ActionScript, and other permutations rely largely on the same standard and can be considered the same.

In 2002, Microsoft shipped the first version of the .NET Framework and included an ad hoc compiler for an adapted version of JScript called JScript.NET. It's safe to say that JScript.NET never conquered the masses: There's no tooling for it today, not even in Visual Studio.

We've seen this pattern too many times to consider it a mere coincidence: Microsoft will produce a great idea but a not-so-great first-time implementation of that idea. Using a Web-friendly language to develop applications for the new .NET Framework was an excellent idea. However, it was challenging to target much more than just the elements in the host document. As a result, Microsoft came up with a managed language that provided direct access to the .NET Framework classes. This allowed use of the syntax of JScript to author, say, Windows Forms applications — however, using the Web paradigm centered on HTML and CSS to build the same Windows Forms application was out of question.

With Windows 8's release, Microsoft is now making JavaScript a first-class platform for building applications: It wisely decided to allow for the classic Web paradigm. Developers use HTML5 to build layout, CSS3 to style it, and quick-and-dirty JavaScript (or, more precisely, ECMA-based script) to manipulate page elements. Developers also have access to a variety of system-provided libraries that offer UI widgets and tools to access Windows 8-specific capabilities, such as live tiles. Microsoft's full embrace of JavaScript in Windows 8 is indeed quite late, but it's most certainly quite welcome.


Dino Esposito is a frequent Dr.Dobb's contributor on Microsoft developer technologies.


Related Reading






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.
 

Video