Flutter 1.0 is officially announced on Dec 04, 2018. After that, the demand of dart programmers is gaining popularity now. Because entire flutter app development is completely based on a dart.
It seems that tech-giant Google has some big plans with the language. That’s why dart is implemented on two big projects including flutter and fuchsia OS.
Here is a quick intro of dart’s features, use-cases and its humongous power Which will give you answer why Google choose it for flutter and fuchsia OS.
Dart was first unveiled at the GOTO conference in Denmark on October 10, 2011. Dart 1.0 was released in November 2013 and Dart 2.0 was released in August 2018 with a sound type system.
Dart is a General Purpose Language originally developed by Google.
Dart is a very powerful language that you can use to write from simple scripts to full-featured native apps using flutter. It is mainly used in four platforms including Native Mobile App, Web App, Desktop App, and Server-Side App.
- Designed By — Lars Bak and Kasper Lund
- First appeared — October 10, 2011
- Typing discipline — 1.x: Optional, 2.x: Static
- License — BSD
File Extensions —
- Object Oriented
So if you are from C, Swift, or Java’s background you’ll feel just like hometown in a dart. Its syntax is closer to C.
- Dart VM
- dart2js compiler
- Fuchsia OS
Dart is implemented on a wide range of platforms. So it needs multiple ways to run the dart code depending on the platform. Below are three main ways to run the dart code:
- Through DartVM
- Through the AOT compilation process
Just like Java has JVM, Dart has its own virtual machine for running dart code-named DartVM.
If you want to create console apps or server apps you can use DartVM to run Dart code. DartVM is a highly optimized, powerful and fast virtual machine that can run your Dart code in a fraction of seconds.
DartVM is directly coming with Dart SDK. You just need to setup SDK’s path in your environment variables and you are ready to go. Your imagination is the only limit now…
AOT means Ahead-Of-Time compilation is the process of compilation in which we covert a higher-level code such as C, C++, or an intermediate code such as Java Byte Code or .NET Framework’s CIL code (Common Intermediate Language), into a native machine code which is system dependent code. And that code can be run on a particular machine that understands it.
AOT produces machine-optimized code, just like a standard native compiler.
Apps build with Flutter uses the same AOT compilation process to generate native Android and iOS apps from a single code base.
According to Wikipedia: SnapShot is the state of a system at a particular point in time.
The same concept applies here, SnapShots are files which stores object and other runtime data.
So in the next startup whole program does not need to be compiled, the compiler will take saved data from snapshot files and compile only newly added data. Which results in faster startups and code execution.
Snapshots are a core part of DartVM.
There are two types of SnapShot files in dart:
- Script snapshots
- Full snapshots
Dart programs can be compiled into SnapShots files. These files contain the program code and dependencies pre-parsed and ready to execute. This allows fast start-ups.
The dart core libraries can be compiled into a snapshot file which allows fast loading of the libraries.
Dart VM have a prebuild snapshot for the core libraries which is loaded at runtime. That’s how DartVM provides faster code execution.
So, guys, these are the features and use-cases of a dart. It’s a very powerful language itself. If you’re planning to go into app-development domain then you should definitely start to learn dart and flutter. I’ll try to share as much as I can on dart and flutter. Feel free to let me know if I missed something. I’ll definitely like to learn that.
Wanna get in touch with me? Here are links. I’ll love to become your friend. 😊