Book Image

Learning Dart

Book Image

Learning Dart

Overview of this book

Table of Contents (19 chapters)
Learning Dart
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

What is Dart?


Dart is a new general and open source programming language with a vibrant community developed by Google Inc. and its official website is https://www.dartlang.org. It was first announced as a public preview on October 10, 2011. Dart v1.0, the first production release, came out on November 14, 2013, guaranteeing a stable platform upon which production-ready apps can be built. World class language designers and developers are involved in this project, namely, Lars Bak and Kasper Lund (best known from their V8 JavaScript engine embedded in the Chrome browser, which revolutionized performance in the JavaScript world) and Gilad Bracha (a language theorist known from the development of the Strongtalk and Newspeak languages and from the Java specification). Judged by the huge amount of resources and the number of teams working on it, it is clear that Google is very serious about making Dart a success.

Tip

Take your time to familiarize yourself with the site dartlang.org. It contains a wealth of information, code examples, presentations, and so on to supplement this book, and we will often reference it.

Dart looks instantly familiar to the majority of today's programmers coming from a Java, C#, or JavaScript/ActionScript background; you will feel at ease with Dart. However, this does not mean it is only a copy of what already exists; it takes the best features of the statically typed "Java-C#" world and combines these with features more commonly found in dynamic languages such as JavaScript, Python, and Ruby. On the nimble, dynamic side Dart allows rapid prototyping, evolving into a more structured development familiar to business app developers when application requirements become more complex.

Its main emphasis lies on building complex (if necessary), high-performance, and scalable-rich client apps for the modern web. By modern web we mean it can execute in any browser on any kind of (client) device, including tablets and smart phones, taking advantage of all the features of HTML5, and is ported to the ARM-architecture and the Android platform. Dart is designed with performance in mind, by the people who developed V8. Because the Dart team at Google believes web components will be the foundation for the next evolution of web development, Dart comes out of the box with a web component library (web components are pieces of web code containing HTML and Dart or JavaScript that you can re-use in different pages and projects, in other words it is a reliable infrastructure of widgets).

But Dart can also run independently on servers. Because Dart clients and servers can communicate through web sockets (a persistent connection that allows both parties to start sending data at any time), it is in fact an end-to-end solution. It is perfect on the frontend for developing web components with all the necessary application logic, nicely integrated with HTML5 and the browser document model (DOM). On the backend server side, it can be used to develop web services, for example, to access databases, or cloud solutions in Google App Engine or other cloud infrastructures.

Moreover, it is ready to be used in the multicore world (remember, even your cell phone is multicore nowadays) because a Dart program can divide its work amongst any number of separate processes, called isolates, an actor-based concurrency model as in Erlang.