Introduction of a Dart

Vishal Pethani
5 min readMay 5, 2020

Everyone talking about Flutter, Flutter, Flutter….

What is exactly behind successor of Flutter?

Today I will let you in a deep dive of the successor of flutter is “Dart”.

The dart language is the heart of the Flutter framework. A modern framework like Flutter needs high-level modern programming language to give the best experience to the developer and create awesome mobile applications. Sufficient knowledge of Dart is a prerequisite for building Flutter apps. That is why developers need to know the origins of the modern language Dart”, How the community is working on it, its strengths, and why it is chosen programming language to make a mobile app with Flutter

The evolution of Dart

The dart language is developed by Google, which can be used to develop desktop, web, server-side, and mobile applications. Unveiled in 2011, Dart has been evolving ever since. Dart saw its stable release in 2013 with major changes included in the release of Dart 2.0 toward the end of 2018:

It is molded to be robust and flexible by adding OOP features, keeping the type annotations optional. Dart maintains the two worlds of flexibility and robustness.

It was mainly focused to build web development in its conception, the main goal of replacing JavaScript. Moreover, Dart is focused on mobile development with the flutter as of now.

It has tried to solve the problem of JavaScript. In JavaScript, it does not provide the robustness that many languages provide, So the dart wanted to solve this problem and give big successor to JavaScript.

It offers the best performance and better tools for large-scale projects: Dart has modern and stable tooling provided by IDE plugins. It’s been designed to get the best possible performance while keeping the feel of a dynamic language.

Benefits of Dart language

Garbage Collection: Dart’s runtime includes a garbage collector, a necessary component for allocating and deallocating memory as objects are instantiated and become unusable.

Type annotations: Type annotations is optional in Dart. This is benefit those who want security and consistency to control all of the data in an application

Statically typed: Statically typed is important for finding bugs during compile time. Although type annotations are optional, Dart is type-safe and uses type inference to analyze types in runtime

IDE tooling: This includes tools to analyze code, integrated development environment (IDE) plugins and big package ecosystems.

Portability: This is not only for the web (transpiled to JavaScript), but it can be natively compiled to ARM and x86 code.

How Dart works

To know that where dart’s flexibility came from, we need to know how we can run dart code. This is done in tow ways:

· DVM stands from Dart Virtual Machine

· JavaScript compilations

Compilation of Dart VM and JavaScript

Dart code can be run in a Dart capable environment. A Dart environment provides essential features to an app, such as the following:

· Garbage collectors

· Runtime systems

· Dart core libraries

The execution of Dart code runs in two-mode

Just-In-Time (JIT) compilation: A JIT compilation helps to the source code to loaded and compiled to native machine code by the Dart VM on the fly. It is used to run code when you are developing a mobile app in order to use features such as debugging and hot reloading or in a command-line interface.

Ahead-Of-Time (AOT) compilation: An AOT compilation is where the Dart VM and your code are precompiled and the VM works more like a Dart runtime system, providing a garbage collector and various native methods from the Dart software development kit (SDK) to the application.

Understanding why Flutter uses Dart

The Flutter framework aims to give competition to native mobile app development, with no drawbacks in performance and scalability, providing all of the tools needed for the developer to make awesome applications.

To deliver the best of the development world with high performance that compares to the official native SDKs, Flutter uses the support of Dart to provide tools that contribute to developer productivity in the development phase and to build applications optimized for publication.

Dart is mature enough and robust with many tools that contribute to Flutter’s success.

Why darts programming language has been chosen for Fluttre framework?

Let’s understand why Dart was the perfect choice for the Flutter framework.

Easy learning: To learning a new framework and a new language, could be challenging. However, Dart is inspired by many modern and mature languages such as Java, JavaScript, C#, Swift, and Kotlin. So it is easy to learn

Productivity: The Dart SDK comes with a set of tools that Flutter benefits from to help with common tasks during the development phase, such as the following:

· JIT and AOT compilers

· Profiling, debugging, and logging and Observatory

· Static code analysis with its built-in analyzer

Compiling Flutter apps and hot reload

The hot reload: It is one of its most fabulous features and improved our productivity action. It depends on JIT compilation to make live code swaps while running the app, so we can change our application code and see the result almost in real-time. With the help of IDE plugins, after saving a change, the plugin dispatches the reload and the result is seen quickly.

Debugging Mode: When you’re in developing mode, you will be using the Dart VM with JIT. This helps to utilize features such as profiling tools, hot reloading, and more.

Production Mode: When building your app ready for release, the code will be compiled in AOT and your app will ship with a tiny version of the Dart VM with Dart SDK capabilities such as core libraries and garbage collectors.

To learn dart programing lanugage please go through offical site https://dart.dev/guides

To learn Flutter framework please go through the official site https://flutter.dev/

--

--

Vishal Pethani

iOS Developer | Swift |RxSwift | RxCocoa | MVVM | Flutter | Dart