Chapter 1. Hello Dart
This chapter covers
- Basics of the Dart development platform
- A look at the Dart language
- Tools for building Dart applications
Dart is an exciting language that raises the possibility of building complex web applications more quickly and accurately than ever before. In this chapter, you’ll find out how the Dart language and its tool ecosystem fit together, you’ll discover some of the key features of the Dart language, and you’ll see how you can you use Dart to begin building single-page web applications.
Dart is an open source, structured programming language for creating complex, browser-based web applications. You can run applications created in Dart either by using a browser that directly supports Dart code or by compiling your Dart code to JavaScript. Dart has a familiar syntax, and it’s class-based, optionally typed, and single-threaded. It has a concurrency model called isolates that allows parallel execution, which we discuss in chapter 15. In addition to running Dart code in web browsers and converting it to JavaScript, you can also run Dart code on the command line, hosted in the Dart virtual machine, allowing both the client and the server parts of your apps to be coded in the same language.
The language syntax is very similar to Java, C#, and JavaScript. One of the primary goals for Dart was that the language seem familiar. This is a tiny Dart script, comprising a single function called main: