Google’s Dart may be the code to make web apps shine

DartsGoogle (s goog) today unveiled its effort to create a programming language solely for building web apps. Much like there’s a shift in computer hardware to take advantage of a more connected and mobile world, Google is attempting to push a concurrent shift in software.

Dart: What it is and what it isn’t

Google started building Dart last year under the name Dash, with the goal of making it easier to program web applications that run on servers inside a data center. The resulting language unveiled Monday is suggested to become a JavaScript killer, although we’ll have to see if it can take over the king of scripting languages and the lingua franca of bridging the static and dynamic programming divide on the web.

Google states its goals for Dart fairly clearly. The idea is to build a scripting language that can be built easily and quickly, but is also powerful enough to support a webscale applications and be maintained easily by more than just the author of the original code. The idea is that user-friendly languages like JavaScript allows a hobbyist-level developer to build out something quickly and easily, but the way the developer does writes the code can create hidden costs down the line as the application scales and requires more code and more people.

JavaScript requires a programmer to deliver a single chunk of unified code, whereas other languages such as Java (s orcl) and C++ allow for more modularity. Thanks to object-oriented programming, a programmer working with Java can reuse modules or previously written code to build a program. Other people can add to it and easily see how it was made. So where Java and other object-oriented programming are akin to building something with LEGO, JavaScript and other scripting languages are more like using paper-mache. In one, you can see what it is and how it was built in order to maintain or replicate it. In the other, you see the result but figuring out the underlying structure is almost impossible.

Fast is beautiful

Dart hopes to offer the ease of JavaScript coding with the modularity of object-oriented programming languages by using snapshots. In a post over at CNet, based on an interview with Lars Bak, the project leader for Dart, Bak explains a concept called snapshotting:

Google is evaluating the best way to integrate Dart directly into its Chrome browser, something Bak is keen on. One reason: it will enable a “snapshotting” technology that dramatically improves a Web app’s startup time. Snapshotting involves taking an application and “serializing” it into a single block of data.

In one test of snapshotting, a 55,000-line Dart program loaded in 60 milliseconds compared to 640 milliseconds without it, Bak said. A conventional JavaScript program would load in comparable time as Dart without snapshotting, he said. “I can see a lot of optimizations that’ll be applicable to Dart” when it’s integrated directly into a browser, he added.

Snapshots may also be the first hit of the Dart drug that gets developers addicted, if it can speed up load times like Bak says. So if Google integrates the Dart framework into its Chrome browser, that means that folks using Dart to build their web pages will see blazing fast load times while other sites wait for their JavaScript to load. Google still apparently plans to keep pushing JavaScript development in case Dart doesn’t catch developers’ eyes, but it’s clearly hoping it can continue pushing faster web pages for the modern computing era in a way that developers will latch onto. Axel Rauschmayer offers an in-depth post on why developers and browser makers might want to duck and avoid Dart.

But wait, there’s more!

Another stated goal of Dart is to build a framework that allows developer to code both the front end and the back in the same way. A new crop of languages and frameworks are being built, such as Node.js that allow this homogenous programming, because it makes life easier on developers., which combined with ease of building and maintaining code, and faster web sites, is just another way Google wants to entice developers into giving Dart a try.

Google is making the tools available via open source, which does show how committed Google is to pushing this out to the rest of the world. Google understands that any effort to rethink the underlying programming tools for web applications needs broad adoption from those building apps in their spare time to those hired to code for the Fortune 500. It also helps Google get in on the ground floor and potentially dominate a standards effort around what it hopes will become a standard for developing web-based applications.

So we’ll see Dart can deliver on the need for speed and the desire for a scripting language with the modularity of an object-oriented language. If it can, it may indeed be a JavaScript killer. Otherwise, it’s just another Google attempt to make the web faster by rethinking the way things are done.

Additional reporting by Cyndy Aleo.