Why Flutter Uses Dart Language?
Before answering the question “Why Flutter uses Dart as Core Language?” let’s understand briefly about Dart Language first.
The Dart Language, developed and maintained by Google, is a modern object-oriented programming language that can be used for creating web, desktop, server-side and mobile apps. The Dart language is present at the core of the Flutter framework and is used to code the Flutter applications.
Dart has come a long way since it was unveiled in 2011 and a stable release in 2013. Significant changes have been made to the version of the Dart Language.
Features of Dart:
Code Compilation Proficiency
Dart supports both Just-In-Time (JIT) and Ahead-Of-Time (AOT) compiling.
Dart’s Just-in-Time (JIT) Compilation loads the source code and converts it to the native machine code using the Dart’s VM on the fly.
JIT compilation enables important features, like, hot reload/restart/debugging feature that helps us to quickly and efficiently experiment with UIs and bug fixes without losing application state.
This compilation process increases the speed and runtime of the application. The JIT compiler also speeds up the Flutter app development process.
Ahead-of-Time (AOT) compilation comes into the picture when the flutter app is ready for production. When the app loads on the device the AOT compiles the flutter libraries to native ARM or X64 Machine code.
The AOT Compiled app runs the app smoothly, provides better performance, minimum size, and removes dependencies needed for the development environment.
Flutter app development is achieved using a dart, the native source code can be generated using the following command.
dart2native bin/main.dart -k aot
Flutter uses Dart to build the User Interface (UI) or the state of the application. Flutter redraws the UI and generates a new instance of the widget as the state of the app changes. Dart makes Flutter fast with the UI construction process.
The app is rendered at 60 frames per second (fps) and 120 fps for the devices that support it. Dart makes it easy to seamlessly render the UI with animations and transitions.
Dart has a built-in Garbage Collector that deals with memory de-allocation. Automatically de-allocates the application memory that is occupied by objects that are no longer in use.
Get Started to App Development, Read Introduction to Flutter App Development.
Read the FAQ Section at the Official Flutter site.