DART-Programing Language

Dart is a open source wen developing and programming language. It was brought out at the GOTO confeence in Aarhus. The main goal of the dart is to replace the javascript as far as web development at open web platform is concerned. Dart was designed with the motive to make tools for well suited modern app. Also it is capable of high performance implementations.

Dart is is a class based language with c-style syntax. Also with it, it uses the concept of inheritance and the object oreinted language. It supports various features like interfaces, abstract classes and optional typing.

While running the dart code it is necessary to pre-compile the dart code into javascript using the dart2js compiler. It is compatible with all major browsers with no specific browser adoption of dart being required.

Dart programs run in one of the two modes and they are:

1) Checked mode

2) Production mode

One thing should be noted that checked mode is not a default mode and must be turned on and the dynamic type assertions are enabled. On the other hand dart programs run by default in production mode. It runs with all dynamic type assertions being turned off. This is a default mode because it is the fastest mode of running  a dart program.

Now let us come onto the compiler. Dart uses the dart2js compiler which is also called as Dart-to-Javascript Compiler. It is used to implement complete dart specification and semantics. A special version of Chromium(the open source browser at the core of Google Chrome) comes with the dart virtual machine which allows it to run the dart programs.

We can understand this through a simple example:

int fib(int n) => (n>1) ? (fib(n-1)+fib(n-2)) : 1;

void main(){

print('fib(20) = ${fib(20)}');

}

Here we that this is a program to calculate the fibinocii series. So we can say that Dart's syntax is typical of the ALGOL language family, alongside C, Java, C#, Javascript and others.  


Share this post

We are always here to help. If you have a query Send Now