Your SlideShare is downloading. ×
0
Dart	                 {	 Google’s  answer  to  Javascript	Raoul-­‐‑Gabriel  Urma
What  is  Dart?	Ñ    Dart  is  a  new  class-­‐‑based  programming  language  for        creating  structured  web  appli...
Design  goals	Ñ  Create  a  structured  yet  flexible  programming      language  for  the  web.	Ñ  Make  Dart  feel  fam...
In  a  nutshell…	       Ñ    Class-­‐‑based	       Ñ    Single  inheritance	       Ñ    Pure  (everything  is  an  obje...
Fun  with  Dart	Ñ    h]p://try.dartlang.org/s/F-­‐‑MX	Ñ  Variables  initialized  to  null	Ñ  Generics  are  covariant
Ñ    main()  {	Ñ        List<Banana>  listOfBananas  =  new  List<Banana>();	Ñ        List<Fruit>  listOfFruits  =  lis...
Ñ  main()  {	Ñ      num  i;	Ñ      num  j  =  i  +  5;  //  NPE	Ñ  }
Dart  vs  Newspeak  [1]	  Ñ  Class-­‐‑based  ✓	  Ñ  First-­‐‑class  modules  ✗	  Ñ  Reflection  (coming  soon  -­‐‑  bas...
Dart  vs  CoffeeScript	            Ñ  Pa]ern  matching  ✗ (coming  soon?  [1])            Ñ  Prototype  Based  ✗         ...
Links	Ñ  h]p://code.google.com/p/dart/issues/list	Ñ  h]p://gototoday.dk/2011/10/10/lars-­‐‑bak-­‐‑on-­‐‑    dart/	Ñ  h]...
Upcoming SlideShare
Loading in...5
×

Dart

1,070

Published on

A few slides discussing Dart the new Google language.

Published in: Technology, Sports
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,070
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
70
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Dart"

  1. 1. Dart { Google’s  answer  to  Javascript Raoul-­‐‑Gabriel  Urma
  2. 2. What  is  Dart? Ñ  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. Compiles  to  Javascript Runs  on  VM
  3. 3. Design  goals Ñ  Create  a  structured  yet  flexible  programming   language  for  the  web. Ñ  Make  Dart  feel  familiar  and  natural  to  programmers   and  thus  easy  to  learn. Ñ  Ensure  that  all  Dart  language  constructs  allow  high   performance  and  fast  application  startup. Ñ  Make  Dart  appropriate  for  the  full  range  of  devices   on  the  web—including  phones,  tablets,  laptops,  and   servers. Ñ  Provide  tools  that  make  Dart  run  fast  across  all   major  modern  browsers.
  4. 4. In  a  nutshell… Ñ  Class-­‐‑based Ñ  Single  inheritance Ñ  Pure  (everything  is  an  object) Ñ  Optional  types Ñ  First-­‐‑class  functions Ñ  Java-­‐‑like  syntax  (shorter) Ñ  Null!! Ñ  Actor  model  (isolates  light  vs  heavy) Ñ  Collections  classes  (Set,  Map,  List,  Queue) Ñ  Named  constructors “The  type  system  is  unsound,  due  to  the  covariance  of  generic  types.  This  is  a  deliberate  choice  (and  undoubtedly  controversial).  Experience  has  shown  that  sound  type  rules  for  generics   fly  in  the  face  of  programmer  intuition.  It  is  easy  for  tools  to  provide  a  sound  type  analysis  if  they  choose,  which  may  be  useful  for  tasks  like  refactoring.”
  5. 5. Fun  with  Dart Ñ  h]p://try.dartlang.org/s/F-­‐‑MX Ñ  Variables  initialized  to  null Ñ  Generics  are  covariant
  6. 6. Ñ  main()  { Ñ     List<Banana>  listOfBananas  =  new  List<Banana>(); Ñ     List<Fruit>  listOfFruits  =  listOfBananas; Ñ     listOfFruits.add(new  Apple()); Ñ     print(listOfBananas[0]);  //  apple Ñ  } Ñ  class  Apple  extends  Fruit{ Ñ     toString()  {  return  "ʺapple"ʺ;} Ñ  } Ñ  class  Banana  extends  Fruit{ Ñ         toString()  {  return  "ʺbanana"ʺ;} Ñ  } Ñ  class  Fruit{ Ñ     toString()  {  return  "ʺfruit"ʺ;} Ñ  }
  7. 7. Ñ  main()  { Ñ     num  i; Ñ     num  j  =  i  +  5;  //  NPE Ñ  }
  8. 8. Dart  vs  Newspeak  [1] Ñ  Class-­‐‑based  ✓ Ñ  First-­‐‑class  modules  ✗ Ñ  Reflection  (coming  soon  -­‐‑  based  on  mirrors  [2])  ✓ Ñ  Mixins  ✗ Ñ  Names  as  method  invocation  ✗ Ñ  Immutability  enforcement  ✗ [1]:  h]p://bracha.org/newspeak-­‐‑modules.pdf [2]:  h]p://bracha.org/mirrors.pdf
  9. 9. Dart  vs  CoffeeScript Ñ  Pa]ern  matching  ✗ (coming  soon?  [1]) Ñ  Prototype  Based  ✗ Ñ  List  comprehension  ✗ Ñ  Compiles  to  JS  ✓ [1]  Pa]ern  Matching  for  an  Object-­‐‑Oriented  and   Dynamically  Typed  Programming  Language  –  Gilad  Bracha
  10. 10. Links Ñ  h]p://code.google.com/p/dart/issues/list Ñ  h]p://gototoday.dk/2011/10/10/lars-­‐‑bak-­‐‑on-­‐‑ dart/ Ñ  h]p://bracha.org/Site/Home.html Ñ  h]p://dartinside.com/2011/live-­‐‑from-­‐‑dart-­‐‑ launch/
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×