Book Image

Dart By Example

By : David Mitchell
Book Image

Dart By Example

By: David Mitchell

Overview of this book

Table of Contents (17 chapters)
Dart By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The origins of Dart


Google has a lot of experience with both large web applications and writing web browsers. They clearly have a strong self-interest in a better web platform (so people search more) and an improved developer productivity (to stay ahead of the competition). It is mentioned in Google presentations that a single code change in their Gmail web application takes around 20 minutes to rebuild the site for the developer to test it out.

This harks back to software build times decades ago. The project to fix this problem was started, and Google wanted to share and work with the development community as an open source project.

In 2011, at the GOTO conference, the Dart language and virtual machine was unveiled to the world. Dart is designed to be a "batteries included" project—a complete stack for writing, compiling, testing, documenting, and deploying web applications.

Developed by the Chrome team, the project was founded by Lars Bak (the developer of the Java HotSpot VM and JavaScript V8 Engine) and Kasper Lund (a V8 developer). The aim was both to improve the open web platform by opening up new avenues for high performance client web applications and to improve developer productivity.

The upstart language was designed to have a familiar 'curly brackets' syntax similar to Java, C-sharp, and JavaScript, run on both the client and the server, and to support the full range of modern web browsers by being able to compile to regular JavaScript. New language features were only added to Dart if they could be compiled satisfactorily to JavaScript.

Dart is often referred to as DartLang to avoid confusion with other "darts." Keep this in mind when searching the Web for better results. The Dart language, like JavaScript, is not only meant for the web browser; it is also available for server applications and command-line applications. Future targets are mobile applications on iOS and Android.

That is the history, the challenge, and the reaction of the biggest Internet company in the world. So, what is Dart all about, then? The remainder of this chapter will compare and contrast Dart and JavaScript and take you into building your first Dart application so that you can see for yourself.

The rest of this book will take you on a tour of Dart through a set of interesting projects, exploring all of Dart's habitats. We will be building useful applications straight away and using increasingly powerful features.