September 10, 2011

Dart Programming Language, the new Kid on the Block

This week I received a link via Twitter (I don’t remember the source) about a new programming language by Google. As a programming language geek, I was immediately interested in the topic. Yesterday, I found more information at Node.Js group:

- Dash (high risk/high reward): Develop a new language (called Dash) that aims to maintain the dynamic nature of Javascript but have a better performance profile and be amenable to tooling for large projects. Push for Dash to become an open standard and be adopted by other browsers. Developers using Dash tooling will be able to use a cross-compiler to target Javascript for browsers that do not support Dash natively.

That’s the 10,000 foot overview…

…

…The emergence of compelling alternative platforms like iOS has meant that the web platform must compete on its merits, not just its reach. Javascript as it exists today will likely not be a viable solution long-term. Something must change. ..

…

The “evolve Javascript” option is relatively low risk, but even in the best case it will take years and will be limited by fundamental problems in the language (like the existence of a single Number primitive). Javascript has historical baggage that cannot be solved without a clean break. Thus, although it’s low risk, it’s also relatively low reward.

The “clean break” option is extremely high risk–it will be a huge challenge to convince other browser vendors to rally around a new language–but is the only way to escape the historic problems with Javascript. Thus, its high risk is matched by the potential for a very high reward–a classic leapfrog strategy.

….

The only solution is to execute the two strategies in parallel…

It would be interesting to know what are the “fundamental flaws that cannot be fixed merely by evolving the language”. Javascript has good and bad parts. But most of the bad parts can be skipped. My guess: Google guys points to global variables, maybe a bit convoluted inheritance, no types. But they said Dash new language will be able to be cross-compiled. Yes, types! I read:

Dash: The Clean Break Dash is the leapfrog effort that is designed to be a clean break from Javascript. It will seek to keep the parts that have made the Internet so successful, but fill in holes everyone agrees it has.

Dash is designed with three perspectives in mind:

- Performance — Dash is designed with performance characteristics in mind, so that it is possible to create VMs that do not have the performance problems that all EcmaScript VMs must have. - Developer Usability — Dash is designed to keep the dynamic, easy-to-get-started, no-compile nature of Javascript that has made the web platform the clear winner for hobbyist developers. - Ability to be Tooled — Dash is designed to be more easily tooled (e.g. with optional types) for large-scale projects that require code-comprehension features such as refactoring and finding callsites. Dash, however, does not require tooling to be effective–small-scale developers may still be satisfied with a text editor.

Dash is also designed to be securable, where that ability does not seriously conflict with the three main goals.

Dash will be designed to be consumed in a number of locations:

- Browser VM — Our aspiration is that Dash will ultimately be a viable substitute for Javascript as the native client-side language of choice across all browsers. - Front-end Server — Dash will be designed as a language that can be used server-side for things up to the size of Google-scale Front Ends. This will allow large scale applications to unify on a single language for client and front end code. - Dash Cross Compiler — Dash will be designed so that a large subset of it can be compiled to target legacy Javascript platforms so teams that commit to using Dash do not have to seriously limit their reach. Platforms that have a Dash VM can operate on the original Dash code without translation and take advantage of the increased performance. One of the ways we will evolve Harmony is to be a better target for such compiled Dash code.

All this could be an April Joke, but not. A new language is coming, and its name is Dart, not Dash.

Two conferences being held next month, one in Aarhus, Denmark on October 10 and another two weeks later in Portland, Oregon, are scheduled to feature Lars Bak, the designer of the V8 interpreter used in Google Chrome. In Aarhus, Bak will be joined by Gilad Bracha, a Google engineer and co-author of the original Java Language Specification and the creator of the Newspeak programming language, a derivative of Smalltalk.

Newspeak is a class based language. Classes may be nested, as in BETA. This is one of the key differences between Newspeak and Smalltalk. All names in Newspeak are late-bound, and are interpreted as message sends, as in Self.

Newspeak is distinguished by its unusual approach to modularity.[3] The language has no global namespace. Top level classes act as module declarations. Module declarations are first class values (i.e., they may be stored in variables, passed as parameters, returned from methods, etc.) and are stateless.

….The name "Newspeak" is inspired by George Orwell‘s newspeak appearing in the novel Nineteen Eighty-Four. The heading on the programming language’s website says "It’s doubleplusgood". The motivation for the name is that Orwell’s Newspeak language grew smaller with every revision; Bracha views this as a desirable goal for a programming language

For the past 5 years or so, I (like many others) have argued that Javascript is the assembly language of the internet platform. Over this period, some of the obstacles that limit the applicability of said platform have been slowly pushed aside. Things like client side storage, or decent performance.

However, Javascript remains a seriously limited language for platform implementation. Here are some of the problems…

Now, Google has already released one language in recent history — Go — so we can assume that Dart won’t be a C-like system-oriented language. With the “structured web programming” moniker, it’s also likely to be some kind of interpreted, in-the-browser language — so more like JavaScript or Python, and less like Java or other compiled languages. One of the biggest hints, though, is that both Bracha and Bak have worked extensively with Smalltalk in the past — and an interpreted Smalltalkesque language would fit right into the “structured web programming” mold, too.

And this is the official keynote, Dart intro into society, October 10th:

Google to unveil World News at GOTO Aarhus. The whole world will be on alert when Google presents a new programming language "Dart" in the opening keynote speak on conference monday. Join us and GOTO Aarhus and get all the details.

Apparently, there is no published info about syntax, semantic, examples. Dart is a mystery. I started my link collection:

After I initially left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I get 4 emails with the same comment. Perhaps there is a means you can remove me from that service? Thanks!