Recs.
Updated
Dart is an open-source, scalable, object-oriented programming language, with robust libraries and runtimes, for building web, server, and mobile apps. It is developed by Google, and it became an ECMA standard.
SpecsUpdate
Pros
Pro Great async language support
Dart is a single threaded programming language. So if any piece of code blocks the execution of the program, the program practically freezes. To avoid this Dart makes use of asynchronous operations which let your program run without getting blocked. This is done through Future objects.
A Future is an object which represent a means for getting a value at a certain point in the future. A function may invoke a Future and when that happens, two outcomes can be achieved:
- The function is unable to return a value, so it queues up work to be done and returns an uncompleted Future object.
- Or later when a value is available to be returned, the Future object completes with that value.
Pro Great standard library
Dart includes a truly comprehensive core library, making it unnecessary to include disparate, external resources for basic functionalities Other than reducing the need to pull in various 3rd-party utilities this also ensures that all Dart code looks and feels the same.
Out of the box, the developer gets core libraries to help with: async, collections, strings, regexps, conversions, formats, file I/O, math, typed data, and more.
Pro A lot of tools are available to help in developing with Dart
Dart has a lot of tools available which help with developing Dart applications. Some examples of those tools include:
- pub - package and dependency management and build tool
- analyzer - static syntax analysis with linter, quick fixes, autocompletion support for easy IDE integration
- test - powerful and flexible testing framework and test runner
- dev_compiler - generate reusable JS instead of tree-shaken minified JS output (work in progress)
- dartfmt_ - source code formatter
- server-side VM
- observatory - a powerful tool for profiling and debugging running Dart code (for Dartium and Dart server code)
Pro Transpiled JavaScript code works on all browsers
In Dart many browser differences (subtle differences and also missing features) are abstracted away or polyfilled. When Dart is transpiled to JS the output works on all supported browsers. There is usually no need to load polyfills or to consider browser differences during development. No need for libraries like jQuery to make the same code work the same on all browsers.
Pro Easy prototyping
Dart has an optional type system which makes Dart a great language for prototyping. It encourages developers to gradually evolve their programs without worrying about types first.
Pro Support of semi-coroutines (generators)
Generators, also known as semicoroutines, are also a generalization of subroutines.
Generators are primarily used to simplify the control of iteration behavior of a loop, the yield
statement in a generator passes a value back to a parent routine.
A generator is very similar to a function that returns an array, in that a generator has a certain number of values. But instead of building and returning an array that contains all the wanted values, a generator returns them one at a time, this saves memory and allows the caller function to start processing the first few values immediately.
Pro Crossplatform
Dart does not just compile to JavaScript, it also compiles to native code on mobile platforms like iOS and Android as demonstrated by flutter.io
Cons
Con Dart SDK does not provide standard (out of the box) way to access SQL-based databases on server side
This missing (but very popular) feature requires to use 3rd-party packages developed by the personal enthusiasts or very small groups of enthusiasts, which is not very convenient because they are all very fragmented in terms of content, the essence and capabilities.
Con May be difficult to use some JavaScript libraries
Dart is much more than a programming language, it's a platform with its own standard libraries and tools. It's a major departure from JavaScript itself (even though it can compile to JS) that it's not possible to directly interact with JavaScript libraries in Dart. Instead, you have to use a special interop library which exposes the wrapped versions of the JavaScript objects that you are accessing.
While this enables Dart to sandbox JavaScript so that its problems do not leak into a Dart application, it also means that it may be cumbersome to use libraries which don't have a wrapper library available.
Recommendations
Comments
Flagged Pros + Cons
Pro A very clear well thought standard library
Out of the box, the developer gets core libraries to help with async, collections, strings, regexps, conversions, formats, file I/O, math, typed data, and more. This reduces the need to pull in various 3rd-party utilities and ensures that all Dart code looks and feels the same.
Pro Many platform targets
Dart targets the browser (after it's transpiled to JS), the server (Dart's VM can be run on Linux, Windows, OSX (Both on Intel and ARM architectures), Android and iOS (work in progress) and embedded systems via Dartino (support is experimental).
Pro Actively developed and maintained
Dart is actively developed and maintained by Google and used by the company, ensuring good project health (even if their plans for the language have changed slightly).
Pro Upcoming support for cross-platform mobile apps with Flutter
Flutter is a new project to help developers build high-performance, high-fidelity, mobile apps for iOS and Android from a single codebase.
Pro Supported by major web frameworks, like Angular 2 and Polymer
Dart is one of three natively supported languages for Angular 2, and it has its own Polymer package.
Pro Dart is used to build web, server and mobile applications, and for Internet of Things (IoT) devices
Dart, like JavaScript, is a dynamically typed language. It adds optional type annotations to help you catch errors earlier. It takes out a few features of JavaScript, such as prototypes and the global object: this streamlines the VM, enables faster execution, and makes it easier to do code completion and refactoring. And Dart adds some goodies. Dart is more than a new syntax, it’s a full language with its own semantics.
When compared to JavaScript, Dart aims to be faster, more regular, and more scalable to large programs.
Pro The fastest and performance driven
With using own VM, Dart is the fastest language for the web. Dart is built with performance in mind. It is a nasty decision by microsoft and apple by not embedding Dart VM in their own browsers. Though, compile to js version is also faster than any other Compile to JS languages
Con No strong community involvement in the work on the specification, grammar, language
Dart developers rarely take suggestions on improving the language in consideration. Although the developers have been suggesting changes since 2011 in the mailing list, these suggestions are rarely included in the Dart Enhancement Proposals (DEP) which is mostly written by Google engineers.
Some people in the Dart community feel that this is inadequate since a lot of programmers who are part of that community are highly respected engineers and professionals who may have valuable input to give.
Pro Supports privacy without verbosity by avoiding the keywords public, protected, and private
Every Dart application is a library, even though it doesn't use a library directive.
Libraries not only provide APIs, but are also a unit of privacy. Although in this area Dart is a little bit different from other languages as since is does not have the private
, protected
or public
keywords. Instead Dart uses underscores (_) to denote private functions or variables.
For example: foo()
is a publicly available function and can be accessed when the library is imported somewhere else. If you want to keep this method hidden, you add an underscore: _foo()
and it behaves like protected, now it can't be accessed when the library is imported somewhere else.
This helps with having less verbose and easier to understand code
Pro Dart to JavaScript compiler designed to create idiomatic, readable JavaScript output
Effective static checking and error detection.
A debugging solution for all modern browsers.
Readable output.
Fast, modular compilation of Dart code.
Easy use of generated code from JavaScript.
Pro Dart SDK v 2.0 coming soon (at the beginning of 2016 )
New version, new features, better performance, new innovative tools and a lot of other useful and interesting things.
Con Slow development
Many features and tools of the language that were promised a long time ago have yet to be implemented raising concerns that these promises may never be fulfilled.
Con Has bad object privacy mechanism with ugly underscores
Library-private members are marked with underscore prefix which is very weird and unreadable syntax.
Pro Runs natively on the server
Dart has its own virtual machine which can be used for developing native Dart code to run on the server without the need to compile it to JavaScript.