Monday, February 20, 2012

Datr language new way of cliant side scripting




Dart language
Back in October 2011, Google introduced Dart, structured web programming language as alternate to JavaScript language to develop web applications.
Dart is a new class-based programming language for creating structured web applications. Developed with the goals of simplicity, efficiency, and scalability, the Dart language combines powerful new language features with familiar language constructs into a clear, readable syntax.
It has introduced by Google Inc. by getting influence by JavaScript which is most popular client side language, developed by Netscape. And it also developed to replace the functionality of java script. Now latest version of some browser is supporting Dart program.
Google has launched a browser called Dartium which having a VM(Virtual machine) to parse and exhicute Datr coding.

Advantage of Dart
·         Java script having some problems of security. Google hoping that the security problem will no more holding the hand of Dart.
·         JavaScript is not fully object oriented language. It’s a object based language .So in case of large scale development there is some bounding in JavaScript. But Dart is fully object oriented and very fit for large scale application.
·         Google is demanding that, exhicution speed is higher than JavaScript.
So these are the reason to get popularity of Dart.

Features of Dart
Classes
Classes and interfaces provide a well understood mechanism for efficiently defining APIs. These constructs enable encapsulation and reuse of methods and data.
Optional types
Dart programmers can optionally add static types to their code. Depending on programmer preference and stage of application development, the code can migrate from a simple, untyped experimental prototype to a complex, modular application with typing. Because types state programmer intent, less documentation is required to explain what is happening in the code, and type-checking tools can be used for debugging.
Libraries
Developers can create and use libraries that are guaranteed not to change during runtime. Independently developed pieces of code can therefore rely on shared libraries.
Tooling
Dart will include a rich set of execution environments, libraries, and development tools built to support the language. These tools will enable productive and dynamic development, including edit-and-continue debugging and beyond—up to a style where you program an application outline, run it, and fill in the blanks as you run.

Some example code of Dart language
Hello world in Dart.
main()
{
 print(‘Hello world’);
}
How to run Dart.
You can run Dart code various ways.
1)      Compile Dart code to JavaScript  and run any modern browser.
2)      Use Dartbord to write ,modify and execute program
3)      You can download VM and can run in your computer. But Still now google not lunched VM for Computer.

 
New MIME type
You will be able to embed a Dart program directly on an HTML page, or you will be able to use a #import or #source statement to pull in external files. Here is the proposed new MIME type, “application/dart”:
<html>
  <body>
    <script type="application/dart">
      main() {
        Element element = document.getElementById('message');
        element.innerHTML = 'Hello from Dart';
      }    
    </script>
    <div id="message"></div>
  </body>
</html>

 
Google’s Dartium browser, nickname of  Cromium + Dart VM
Google hopes that Dart programming language will replace JavaScript in world wide web development. It's now taken another small step towards that goal by releasing a "technical preview" of the Chromium web browser with the Dart virtual machine built right in. Nicknamed "Dartium," the app allows developers to run Dart code directly within the browser, avoiding an additional compilation stage. It's currently available for Mac and Linux computers, and windows version is coming soon.
Google also inspiring Microsoft ,Mozilla ,Netscape and opera to incorporate there VM of there browser .
Google also giving warning that  ,Dart browser is not fully stable and advising that not to use it as a primary version.
You can download a dartium for Mac and Linux from following link


No comments:

Post a Comment