Friday 15 June 2012

Start Darting ...

Well, before Starting to Dart.. I wanna say few words.. :)
" Its really encouraging to see the audience and the amount of traffic here, in the pre-init phase of my new just born blog! :)
Awesome...!!! :):)
It really amazes, urges, kindles me to read, experiment and write, more and more and more. I wanna thank you all for the same " :)


On Pitch....!! ;)

It was at the GOTO Conference, (International Software Development Conference) 2011 @Aarhus, something unusual was revealed!
It was Dart (or Dash), a web based programming and the catch is "Its a replacement to Java script", by Google !!


Programming languages are hot spicy topics for debate. ;)
Why dump Java script and move on with a new platform? What are its demerits?
" ... Writing a web app can be lots of fun, especially at the beginning when you experience
instant gratification: code, reload, repeat.
Unfortunately, finishing and maintaining a web app are not so fun. Java Script is great
for small scripts, and it has the performance chops to run large apps. But when a script
evolves into a large web app, debugging and modifying that app can be a nightmare,
especially when you have a large team ...
instant gratification: code, reload, repeat.Unfortunately, finishing and maintaining a web app are not so fun. Java Script is greatfor small scripts, and it has the performance chops to run large apps. But when a scriptevolves into a large web app, debugging and modifying that app can be a nightmare,especially when you have a large team ... "
 says a member of Google’s Developer Relations Team!
To be really frank here, this is the memo leaked from the employee of Google, for a pressing need of dart and replacement of Java Script.
Here, it goes:
http://markmail.org/message/uro3jtoitlmq6x7t
The memo goes into some detail on what Dart would be, but doesn't go into much detail on why Dart should be. In other words, it doesn't explicitly state the deficiencies in Java Script.
Need a reason for "The Need" ?

  • Well, to recollect,


- Google with its V8 engine
- Apple with its Nitro engine
- Microsoft with its Chakra
- Mozilla with its Monkeys { No Offense ;) } etc.


 have really struggled a lot to make serious improvements in Java Script execution. So, the order of magnitude is high in the modern browsers with the technique being used is JIT (Just In Time) compilation instead of interpretation. But, its really very challenging to write a high performance scripting engine specially one for java script like this and for all the effort and resources that's put in, the yield from java script is not up to the brim. Call it not "NEED FOR SPEED/ PERFORMANCE" ? (Dart Game.. Not a Car Game) ;)
  • Java script, being a prototype based language is like a boon and a bane! If the engine developers or the users do not want to follow prototypes, then java script should be no where around.
  • Java script has features too and the problem that is conceived while importing third party libraries and the conflicts that occurs, the variable scopes is mind boggling. Java script, sometimes I feel has no good features, speaking accordingly to features. ;)
  • Java script and its holy dynamic typing, has disadvantages too. Just, think of a situation where in the errors that are not detected at compile time, but soon in the browser, as the browser engine is left astray, pops up on the user interface! Ah, man!! This is not a pleasurable experience at all! So, its better to know the pre defined types, it also helps in faster code generation. As, the saying goes.. " It's better to be safe, than to be sorry! " :)
No hard feelings.. Java script has its own community of die hard fans.. when people say, Java script cannot do on the server side, they came up with node.js. So on...
It has all the zeal to do anything and everything, but we must wonder at the cost of what!! :)


Play Darts:
Okay! Have you played Darts??
Let's Start Darting :) It's very similar to the game. (at least with terms) ;)
=> Wanna Say "Hello! Darts" ??
Nice, Goto: http://try.dartlang.org/ , and your code should look like this


// Welcome to try.dartlang.org
//
// Here you can try out the Dart Language from the comfort of your own
// *modern* web browser. When you run the code … it is submitted to AppEngine,
// translated into the equivalent JavaScript, and run right in your browser window.
//
// Ok, your turn!
main() {
print('Hello! Darts');
}



Now, Run the code and see in the console for your output. :)
The code looked similar to something. Feeling familiar ??
Ah!! Well, Google met its requirement :p
Yes!! Google's main intent was to make the language look very familiar like Java or java script.


What to play with ?
  • Dartboard tool which lets you write and run Dart code in your browser.
  • Dart Editor which lets you create,modify, and run Dart apps.
  • SDK contains command-line tools such as a Dart-to-Java Script compiler (which produces Java Script that you can put in any modern browser) and 
  • Dart Virtual Machine (the VM, which lets you run Dart code on servers)
  • The latest tool to become available is a build of the Chromium browser, nicknamed Dartium, that contains a built-in Dart VM.
Well, lots more in store...
Next blog post...
  • New things in Dart
  • Un boxing of Dart
  • Sample codes, libraries, running java script from dart
  • References and where to learn more and more?
Until then,
Happy Learning! :)

No comments:

Post a Comment