Book Image

Learning Dart, Second Edition - Second Edition

By : Ivo Balbaert
Book Image

Learning Dart, Second Edition - Second Edition

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Learning Dart Second Edition
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 http://www.dartlang.org. It was first announced as a public preview on October 10, 2011; it has now reached version 1.10. World class language designers and developers are involved in this project, namely, Lars Bak and Kasper Lund (known for their V8 JavaScript engine embedded in the Chrome browser, which revolutionized performance in the JavaScript world), and Gilad Bracha (a language theorist known for the development of the Strongtalk and Newspeak languages and for the Java specification). Judging 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 https://www.dartlang.org/ site. 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 (JS) (ActionScript) background; you will feel at ease with Dart. However, this does not mean that 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 JS, 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 that it can execute in any browser on any kind of (client) device, including tablets and smartphones, taking advantage of all the features of HTML5, and it 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, there is strong Dart support for the Polymer framework (web components are pieces of the web code containing HTML and Dart or JavaScript that you can reuse in different pages and projects. In other words, it is a reliable infrastructure of widgets). However, 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 to develop 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 among any number of separate processes called isolates, an actor-based concurrency model as in Erlang.