Dart: a New Web Programming Experience

Running the Application

If you have chosen to download and install the full Dart editor package, you already have Dartium installed. If, like me, you chose to install only the SDK, you need to grab a copy of Dartium from http://www.dartlang.org/dartium. To install it, I just unzipped the file and created a symlink in my $HOME/bin directory to the chrome program that I extracted:


$ ln -s /path/to/unzipped/folder/chrome dartium

Once it is installed, you can run this application from the command line with the command:


$ dartium fingerpaint.html

Note:

Dartium is an experimental browser, so it should be used only for developing Dart applications locally. Don't use it as your normal browser! There might be security exploits or stability issues that have not been discovered yet.

Figure 1. The finger-paint application running on Dartium, a special fork of Chromium.

Running on Other Browsers

It's okay if you don't have Dartium. Remember that bootstrap script line in fingerpain.html? Aside from starting the Dart VM in Dartium, it also will fall back to a JavaScript application if Dart is not supported. The JavaScript application must have the same name as the Dart application with the extension .dart.js. The Dart SDK comes with a nifty program called dart2js that will convert a Dart browser application into a JavaScript application for use in any browser. To convert this application, you can run dart2js on fingerpaint.dart:


$ dart2js -ofingerpaint.dart.js fingerpaint.dart

When this is done, you will see several new files, including fingerpaint.dart.js.

Now the application will work in any browser that can handle JavaScript. I personally recommend using Dartium for application development and then converting the application to JavaScript for release.

Figure 2. After being converted to JavaScript, the finger-paint application can now run on any browser. Here it is running on Firefox.

State of Dart

I would love to tell you that the community has welcomed Dart with open arms, but that's simply not the case. The people in charge are afraid of Dart becoming the next VBScript and hurting the open Web. So far, Microsoft, Mozilla and Apple have rejected the idea of embedding a Dart runtime into their browsers. As Dart matures and gains popularity, I hope to see this stance reverse, but for now, dart2js is the only way to get Dart projects on-line for all to use.

Conclusion

Dart is a fantastic language that presents an entirely new approach to writing large-scale, client-side, object-oriented applications. I have enjoyed working with it, and I hope you will too. The potential of this language is limitless, and I hope to see wide-spread adoption of it in the future.

Resources

Dart Home Page: http://www.dartlang.org

Dart API Reference: http://api.dartlang.org/docs/bleeding_edge/index.html

Dartium: http://www.dartlang.org/dartium

Dart Source Code and Bug Tracking: http://code.google.com/p/dart

HTML5 for Publishers: http://shop.oreilly.com/product/0636920022473.do

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

This is really useful

lisaedward123's picture

This is really useful information. Thanks for sharing this article.
Java training in chennai

Android mobile development in chennai

android mobile development in chennai's picture

android mobile development in Chennai

Excellent in your post in all process you can explain in line by line clearly it is one one of the new way of thinking.

Panda SEO

jamesagrata's picture

High quality written content along with inbound links performed a essential component throughout ranking assessment and yes it seems Yahoo and google will do identical show up although initial let’s go through the different character which will render SEARCH ENGINE OPTIMISATION. pandalinkbuilders

This is really nice. Thanks

lisaedward's picture

This is really nice. Thanks for your information.
java training institute in Chennai

Reply to comment | Linux Journal

skip hire adelaide's picture

A work mate referred me to your site. Thanks for the details.

キネティックは自動巻き時計と同様にローターを内蔵し、腕の振

laulan's picture

キネティックは自動巻き時計と同様にローターを内蔵し、腕の振りによって発電を行う電池交換不要のクォーツ腕時計である。装着していない時には省電力のため針の動きが自動的に停止し、再び装着され振動が与えられるとそれをバーバリー腕時計感知して自動的に現在時刻に復帰するオートリレー機能を組み込んだ「キネティックオートリレー」、小の月だけでなくうるう年においても正しい日付を示すパーペチュアルカレンダーの「キネティックパーペチュアル」、手巻き充電にも対応し、パワーリザーブ表示機能を持つ「キネティック・ダイレクトドライブ」もある。

キネティックは自動巻き時計と同様にローターを内蔵し、腕の振

laulan's picture

キネティックは自動巻き時計と同様にローターを内蔵し、腕の振りによって発電を行う電池交換不要のクォーツ腕時計である。装着していない時には省電力のため針の動きが自動的に停止し、再び装着され振動が与えられるとそれをバーバリー腕時計感知して自動的に現在時刻に復帰するオートリレー機能を組み込んだ「キネティックオートリレー」、小の月だけでなくうるう年においても正しい日付を示すパーペチュアルカレンダーの「キネティックパーペチュアル」、手巻き充電にも対応し、パワーリザーブ表示機能を持つ「キネティック・ダイレクトドライブ」もある。

good & informative article

Anonymous's picture

I prefer CoffeeScript but after seeing the feature/function integration Dart represents, I've decided to give it a second look.

The more I use it the more I like the "batteries included" approach of the Dart project: Dart Editor, Dart VM, dart2js, pub (package manager), etc.

thanks for a very informative article re subject;

This is really nice. Thanks

lisa's picture

This is really nice. Thanks for your information.
Dot net course in Chennai

Preview comment | Linux Journal

best tire deal's picture

Hi there i am kavin, its my first time to commenting anywhere, when i read
this piece of writing i thought i could
also create comment due to this brilliant piece of writing.

Yes

Clairevoyance's picture

Oui je suis d'accord et merci pour ce bon code php. Pour ma part, j'utilise un code php pour le cache du serveur. Cela me permet de booster mon site de voyance sérieuse et d'offrir gratuitement ce service de voyance gratuitement à tous mes visiteurs.

So when they found it hard to

Anis's picture

So when they found it hard to optimize Javascript some more they invented new language. Great, exactly like if college students write their own questions and answer them instead of teachers questions that are too hard to answer.

Updated examples

jslocum's picture

Things go away and things get

Marjorie Lanphear's picture

Things go away and things get backdated. JavaScript is no longer as great thing as past time. We used to invest prime time on this!

  • Quite some australian gamblers are getting unwell and tired of pubs and land based mostly on line betting site and they are normally getting the changeover to online pokies. You can find a lot of strengths to online wager site.

Very interesting topic will

zeennate's picture

Very interesting topic will bookmark your site to check if you write more about in the future.
voyance gratuite

Google is Evil

Anonymous's picture

As a computer scientist, I'm laughing. Google's Go and now Dart? Why don't you read between the lines of a $25 billion global corporation? Microsoft is a $50 billion global corporation. Today's Google == Evil news: "Google Abandons Open Standards for Instant Messaging". Yesterday, it was more evil news from Google. Wake up you clueless idiots!

Your issue of google talk is

Anonymous's picture

Your issue of google talk is a real issue:
From EFF:
https://www.eff.org/deeplinks/2013/05/google-abandons-open-standards-ins...

privacy conscious users who want to use Off-the-Record encryption where possible, but to keep messages out of their Gmail accounts in any case, are out of luck. And if they wish to continue chatting with their friends on Google chat, they can't even take their business elsewhere.

provide Google with information about the content of their messages, or even when and from where they have logged in.

Comment: the google talk change, looks to be a mandate to compily with federal rules for tracablity.

Reply to comment | Linux Journal

capsiplex news's picture

Do you have a spam issue on this site; I also am a blogger, and I was wondering your situation; we have created some nice methods and we are looking to
exchange techniques with other folks, please shoot me an email if interested.

Dart is BSD License Go is

Anonymous's picture

Dart is BSD License

Go is licensed under the Creative Commons Attribution 3.0 License, and code is licensed under a BSD license

How come as CS scientist you can not us the web to find such thing out.

Oh ya, your a troll, lol

Cloud apps NEED Dart

Jim Birch's picture

AFAICS the push to sophisticated browser-to-cloud applications will necessitate a shift from javascript. JS is great for a a bit of chunky screen animation and a bit of background I/O but I can't see that it is really up to running the big browser applications of the future. It's too messy in too many ways to develop something with a capacity like Photoshop. And this is where Google Docs etc are headed.

I'm not sure

Curtis's picture

I like it that it's a typed language unlike PHP. I question Google's motives, however.

typed language ???

Anonymous's picture

Who need TYPED language at these days, @ WEB & today's resources ?!?

This looks very cool, is Dart

Steeve McCauley's picture

This looks very cool, is Dart embedded in chrome?

Blossom switches from JavaScript to Dart

Thomas Schranz's picture

I've written an article on our decision to switch from JavaScript to Dart. You can read it here
http://www.ramen.io/post/46936028144/we-are-switching-to-dart-why

We hope better than Java

evoanuncios's picture

We hope that Dart will be better than Java..

Thanks

Dart is like Java in browser.

Anonymous's picture

Dart is like Java in browser. Awful.

Dart in the browser

tracker1's picture

Dart is much more like CoffeeScript in the browser... It is a language, and an optional runtime is cross-compile to JavaScript, which is then run in the browser. The biggest wart is that debugging becomes very cumbersome and difficult. Other than that, I don't mind that it exists. There's also TypeScript if you're wanting an extension that cross-compiles to JS. For the record, I'm fine with JS, my style of programming tends to avoid a lot of the warts.

Moving away from class-based thinking, and more about module and functional patterns and passing state objects tends to work better anyhow. YMMV of course, but I happen to like JS as-is. That said, I don't fault anyone wanting to try something new/different.

--
Michael J. Ryan - http://tracker1.info/

Good to know idiocy is

Anonymous's picture

Good to know idiocy is thriving with a comment like that.

Idiocy resorts to name

Anonymous's picture

Idiocy resorts to name calling instead of giving a legitimate critic.

how so? please

eMBee's picture

how so?
please elaborate.

greetings, eMBee.

Reply to comment | Linux Journal

http://www.tablettegraphique123.net/'s picture

Your style is really unique compared to other people I have read stuff from.
Many thanks for posting when you've got the opportunity, Guess I'll just
bookmark this page.

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix