Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Channels ▼

Web Development

The New Intermediate Language of Choice

Last month, Google unveiled Dart, a new language it developed for internal use that provides a variety of useful features and generates, not C, not native binaries, but JavaScript. The initial reception has been mixed: some developers liking the idea, others wondering about the need for another Google-sponsored language, and a third group complaining about yet another programming language, regardless of who sponsored it. I don't share the viewpoint of the third group at all. One of the most fertile areas of innovation in computing is in language design. And today, we're seeing a bountiful harvest of new languages bringing all kinds of interesting features, many of which are being picked up by established mainstream languages. It's precisely because of the richness of this innovation that we at Dr. Dobb's run a regular "Language of the Month" feature. Our biggest challenge with the column is getting to all the interesting languages fast enough.

A theme that is emerging in new languages such as Dart is the use of JavaScript as a universal intermediate language. In addition to Dart, Fantom (our Language of the Month in February this year) and CoffeeScript do this. Moreover, some Web frameworks, such as Google Web Toolkit (GWT) do something similar, namely translating other languages (in the case of GWT, Java) into JavaScript.

The choice of JavaScript in many ways parallels the choice of C for this role in years past. The prime reason for its adoption is portability. Every browser supports JavaScript and supports it well. There is active competition today between the major execution engine (Google's V8, Mozilla's xMonkey, and the recently announced Chakra from Microsoft), so performance is another reason for adoption. Finally, like C, it's comparatively easy to drop down to the low level of the emitted language and program some special functionality, if needed.

A key part of the first two benefits derives from the fact that JavaScript is the province of no single vendor. In this regard, pushing JavaScript through the standardization process years ago as ECMAscript was an event of greater importance than it appeared at the time. In so doing, JavaScript was moved out of the shadow of Netscape and Mozilla and became a universal language, not quite native, and not quite high-level enough to impose heavy start-up costs. In other words, it's a language suited to being an intermediate language.

What JavaScript does not share with C, though, is the latter language's elegance. As a leaked memo from Google states, part of the motivation for Dart (then called "Dash") is to get around the fact that "Javascript has fundamental flaws that cannot be fixed merely by evolving the language." Google believes that there is little likelihood that going the standardization route will be an effective remedy for these issues, as changes to the standard "will take years and will be limited by fundamental problems in the language (like the existence of a single Number primitive)."

The memo, being internally directed, does not give reasons why a user should prefer Dart over CoffeeScript or Fantom. And, at this point, it's far too early to compare the languages and provide any recommendation. All three languages are new: Fantom began generation of JavaScript within the last year, CoffeeScript was started in 2009 and reached v. 1.0 in 2010, and Dart is very much in beta. We will, of course, track the languages at Dr. Dobb's as they mature, but I'm betting that before any of them reaches a tipping point, they'll be joined by new languages that also use JavaScript as their output.

— Andrew Binstock,
Editor in Chief
[email protected]

Related Reading

More Insights

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.