News
Google's Dart 2 Reboot Targets Client-Side Mobile, Web Development
- By David Ramel
- February 23, 2018
Google has revamped its Dart programming language, adding strong typing and other optimizations for client-side development of mobile and Web apps.
Dart 2, announced in a pre-release preview, is a breaking-change release and major reboot of the six-year-old,
open source language that was originally primarily optimized for Web development. Google
introduced the
Flutter mobile app development framework in 2015 leveraging Dart, and is further emphasizing its mobile, client-centric optimizations in the new release.
Chief among those optimizations is the strengthening of its type system, adding by default the type-safe functionality formerly implemented by opting in for "strong mode," described as "a sound static type system that uses a combination of static and runtime checks to ensure your code is type safe."
"This helps Dart developers catch bugs earlier in the development process, better scale to apps built by large teams, and increase overall code quality," Google said in a Feb. 22 post.
In other words, stronger typing lets developers catch errors at compile time rather than at run time, as it will flag, for example, the assignment of a String variable to an int type, something that's fine in loosely typed languages such as JavaScript.
Google also emphasized new "UI as code" functionality that is said to cut down on context switching, such as moving from UI markup language -- XAML in .NET development, for example -- to programming code for app logic and so on.
These changes and more are especially suited for client-side development of mobile iOS and Web apps wherein much of the codebase -- gauged at 50 percent to 70 percent -- can be reused.
"One of the most significant uses of Dart is for Flutter, Google’s new mobile UI framework to craft high-quality native interfaces for iOS and Android," the company said. "Flutter uses a reactive programming style and controls the entire UI pixel by pixel. For Flutter, Dart fits the bill in terms of ease of learning, reactive programming, great developer velocity, and a high-performance runtime system with a fast garbage collector."
And for Web development, the company said: "Dart is a proven platform for mission-critical Web applications. It has Web-specific libraries like dart:html along with a full Dart-based Web framework. Teams using Dart for Web development have been thrilled with the improvements in developer velocity."
Interested developers can go here for guidance on trying the Dart 2 preview in Flutter.
About the Author
David Ramel is an editor and writer at Converge 360.