SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
Dart	
                 {	
 Google’s  answer  to  Javascript	




Raoul-­‐‑Gabriel  Urma
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
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.
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.”
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  =  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"ʺ;}	
Ñ    }
Ñ  main()  {	
Ñ      num  i;	

Ñ      num  j  =  i  +  5;  //  NPE	

Ñ  }
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
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
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/

Contenu connexe

Tendances

Tendances (20)

core java
core javacore java
core java
 
Groovy Programming Language
Groovy Programming LanguageGroovy Programming Language
Groovy Programming Language
 
Introduction to JAVA
Introduction to JAVAIntroduction to JAVA
Introduction to JAVA
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)Basic Concepts of OOPs (Object Oriented Programming in Java)
Basic Concepts of OOPs (Object Oriented Programming in Java)
 
Introduction To Dotnet
Introduction To DotnetIntroduction To Dotnet
Introduction To Dotnet
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
 
Dart Programming.pptx
Dart Programming.pptxDart Programming.pptx
Dart Programming.pptx
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Seminário - Linguagem Dart: Structured web apps
Seminário - Linguagem Dart: Structured web appsSeminário - Linguagem Dart: Structured web apps
Seminário - Linguagem Dart: Structured web apps
 
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B KuteChapter 02: Classes Objects and Methods Java by Tushar B Kute
Chapter 02: Classes Objects and Methods Java by Tushar B Kute
 
Java Presentation For Syntax
Java Presentation For SyntaxJava Presentation For Syntax
Java Presentation For Syntax
 
Flutter
FlutterFlutter
Flutter
 
Core java concepts
Core java  conceptsCore java  concepts
Core java concepts
 
Java tutorial PPT
Java tutorial PPTJava tutorial PPT
Java tutorial PPT
 
Dart PPT.pptx
Dart PPT.pptxDart PPT.pptx
Dart PPT.pptx
 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
 
C#.NET
C#.NETC#.NET
C#.NET
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 

En vedette

En vedette (7)

Introduction to Dart
Introduction to DartIntroduction to Dart
Introduction to Dart
 
How to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 minsHow to build a Dart and Firebase app in 30 mins
How to build a Dart and Firebase app in 30 mins
 
JavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript ComparisonJavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript Comparison
 
Introduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fastIntroduction to Flutter - truly crossplatform, amazingly fast
Introduction to Flutter - truly crossplatform, amazingly fast
 
TypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript ComparisonTypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript Comparison
 
Structured Apps with Google Dart
Structured Apps with Google DartStructured Apps with Google Dart
Structured Apps with Google Dart
 
Dart como alternativa a TypeScript (Codemotion 2016)
Dart como alternativa a TypeScript (Codemotion 2016)Dart como alternativa a TypeScript (Codemotion 2016)
Dart como alternativa a TypeScript (Codemotion 2016)
 

Similaire à Dart

OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
OWF12/PAUG Conf Days Dart   a new html5 technology, nicolas geoffray, softwar...OWF12/PAUG Conf Days Dart   a new html5 technology, nicolas geoffray, softwar...
OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
Paris Open Source Summit
 
R Introduction
R IntroductionR Introduction
R Introduction
schamber
 
Dart Jump Start
Dart Jump StartDart Jump Start
Dart Jump Start
Haim Michael
 
1.-Introduction-to-Dart.pdf
1.-Introduction-to-Dart.pdf1.-Introduction-to-Dart.pdf
1.-Introduction-to-Dart.pdf
SamySiddhan
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
Janeve George
 
Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?
Stefan Marr
 
AestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in ScalaAestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in Scala
Dmitry Buzdin
 

Similaire à Dart (20)

OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
OWF12/PAUG Conf Days Dart   a new html5 technology, nicolas geoffray, softwar...OWF12/PAUG Conf Days Dart   a new html5 technology, nicolas geoffray, softwar...
OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, softwar...
 
Exploring language classification with spark and the spark notebook
Exploring language classification with spark and the spark notebookExploring language classification with spark and the spark notebook
Exploring language classification with spark and the spark notebook
 
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsightEnterprise Data Workflows with Cascading and Windows Azure HDInsight
Enterprise Data Workflows with Cascading and Windows Azure HDInsight
 
Comparative Study of programming Languages
Comparative Study of programming LanguagesComparative Study of programming Languages
Comparative Study of programming Languages
 
R Introduction
R IntroductionR Introduction
R Introduction
 
Dart
DartDart
Dart
 
Dart Jump Start
Dart Jump StartDart Jump Start
Dart Jump Start
 
Introduction to r
Introduction to rIntroduction to r
Introduction to r
 
1.-Introduction-to-Dart.pdf
1.-Introduction-to-Dart.pdf1.-Introduction-to-Dart.pdf
1.-Introduction-to-Dart.pdf
 
R as supporting tool for analytics and simulation
R as supporting tool for analytics and simulationR as supporting tool for analytics and simulation
R as supporting tool for analytics and simulation
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you code
 
Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?Traits: A New Language Feature for PHP?
Traits: A New Language Feature for PHP?
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
AestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in ScalaAestasIT - Internal DSLs in Scala
AestasIT - Internal DSLs in Scala
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
React Native VS Flutter - Which One is The Best.
React Native VS Flutter - Which One is The Best.React Native VS Flutter - Which One is The Best.
React Native VS Flutter - Which One is The Best.
 
Introduction to Apache Spark
Introduction to Apache Spark Introduction to Apache Spark
Introduction to Apache Spark
 
Chapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptxChapter 2 Flutter Basics Lecture 1.pptx
Chapter 2 Flutter Basics Lecture 1.pptx
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Dernier (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Dart

  • 1. Dart { Google’s  answer  to  Javascript Raoul-­‐‑Gabriel  Urma
  • 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. 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. 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. Fun  with  Dart Ñ  h]p://try.dartlang.org/s/F-­‐‑MX Ñ  Variables  initialized  to  null Ñ  Generics  are  covariant
  • 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. Ñ  main()  { Ñ     num  i; Ñ     num  j  =  i  +  5;  //  NPE Ñ  }
  • 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. 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. 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/