SlideShare a Scribd company logo
London Dart Community

            Chris Buckett
Why unicorns and rainbows?
              Unicorns for:
       "Hey – look at that!"
             String s = 12345;
             int i = "Hello World";
             print("$i $s");

             //outputs "Hello World 12345"

                         Optional Typing
  Rainbows for:          Great Tools
  "Aah, that's nice!"
This is Dart…
 A language
 And a tool ecosystem
 For creating complex webapps
 In teams
 Single threaded
    But isolates provide "shared-nothing" concurrency
 Optionally typed
 Runs in a Browser Virtual Machine
 Or a Server Virtual Machine
 Can be converted to JavaScript
Technical Preview…
 What you may see today, may change tomorrow…


 Enable us (as potential end users) to influence the
 language and provide feedback

 Eventual goal is standardization
Why Dart…
 What do Google build?
 Single page web-apps    Browser
    Instant search       Apps
    Docs
    Google Plus           Server
    Blogger               side
    Analytics             APIs
    Maps
    … etc …
Why Dart?
 Complex applications
 Team development //javascript…
 Easily “toolable”   //process a & b.
                      function process(a,b) {
                         return a+b;
                      };
    //javascript
    document.write(process(1,2,3));
    document.write(process("Hello", "World"));

    document.write(process({name:'objectA'},
                           {name:'objectB'}));
Why Dart – the alternatives?
 GWT
    Still around and will be driven by Google's use cases
 CoffeeScript
    Closer to JavaScript, syntax inspired by Ruby, Python
 JavaScript + Framework X
    The default option


 Dart is not a replacement, but an option.
Design Goals - Flexibility
 Flexible, but with structure

   Optional types provide flexibility


   Libraries to organize code


   Classes and Interfaces to provide structure


   Tools catch errors
Design goals - Familiar
 Be Familiar
    main() {
      var anInt = 1;
      var aStr = "String";
      var anObj = new Object();
      var result = doSomething(anInt,aStr,anObj);
    }

    doSomething(a,b,c) {
      return "blah";
    }
Design goals - Familiar
 Be Familiar
    void main() {
      int anInt = 1;
      String aStr = "String";
      Object anObj = new Object();
      String result = doSomething(anInt,aStr,anObj);
    }

    String doSomething(int a, String b, Object c) {
      return "blah";
    }
Design Goals - Perfomance
 Performance as a feature
    Currently not as fast as V8


    (But D8 is faster at launch than V8 was at launch)


    Converted JS should be as fast as or faster than
     equivalent hand written JavaScript.
Design goals
 Great developer         IDE
 experience


                          Dart     Dart
              dart2js
                        Language   VM




                         Native
                         Browser
Dartium (Chromium with Dart VM)
Dart IDE (Lightweight Eclipse IDE)
Demo… debugging and dartium
Dart2js: Dart to JS Converter
#import('dart:html');

class MyApp {
  MyApp() { }

    void run() {
      write("Hello World!");
    }

    void write(String message) {
      document.query('#status').innerHTML = message;
    }
}

void main() {
  new MyApp().run();
}
dart2js: Dart to JS Converter
//...snip library code...
// ********** Code for MyApp **************
function MyApp() {}

MyApp.prototype.run = function() {
  this.write("Hello World!");
}

MyApp.prototype.write = function(message) {
  get$$document().query("#status").innerHTML = message;
}

// ********** Code for top level **************
function main() {
  new MyApp().run();
}
Embed within HTML
<html>
<body>
  <script type="application/dart">
    main() {
       print("Hello Dart");
    }
  </script>
</body>
</html>

                      <html>
                      <body>
                        <script type="application/dart"
                                src="MyApp.dart"></script>
                      </body>
                      </html>
A quick tour of some interesting
      language features…
Dart: Classes and interfaces
   Familiar (to Java and C# developers)                 Optional
   But a couple of nice features                        paramters

    class Duck implements Quackable {
      var colour;

        Duck([this.colour="red"]) { }

        Duck.yellow() {                                Named
          this.colour = "yellow";                    constructors
        }
                                        //Usage
        String sayQuack() => "quack";
                                        var duck1 = new Duck();
    }
                                        var duck2 = new Duck("blue");
Unsurprising                Function    var duck3 = new Duck.yellow();
    this                   shorthand    print(duck3.sayQuack());
Dart: Classes and interfaces
 Familiar (to Java and C# developers)
 But a couple of nice features

     interface Quackable default Duck {
       String sayQuack();
     }




                                  //Usage
                                  var duck1 = new Quackable();
Dart: Classes and interfaces
 All classes are also interfaces
    class Person implements Duck { … }
 Class properties can be interchanged with getters and setters
    duck.colour = "yellow"; //setter, or property?


    class Duck {
         var _colour;                   //private property

         get colour() => _colour;       //getter

         set colour(value) {            //setter
            _colour=value;
         }
     }
Demo… classes and interfaces
Dart: Libraries and Source
 Break up single source code file into multiple,
  independent files.    #library("myLibrary");

                        #import("./libs/otherLib.dart");

                        #source("./myFile1.dart");
                        #source("./myFile2.dart");

 Break logical parts of an app into libraries.
 Import your own and third party libraries.
 Privacy declarations apply at a library level
  (not a class level)
Dart: Optional Types
 Add documentation to code

 Documentation readable by humans and tools

 "Innocent until proven guilty"

 Types have no effect on the running application

         var i = 1;                 int i = 1;
         var s = "Hello";           String s = "Hello";
                      String i = 1;
                      int s = "Hello";   Probably wrong, but not
                                         proved to be wrong.
Dart: Optional Types
 Optional types can be useful in the early days of developing
  an app
class Person {
  sayQuack(){
     return "ouch…quack";
  }
}


pokeDuck(duck) {
  duck.sayQuack();
}

                        //Usage
 But is that what the
                        pokeDuck(new Duck());
  library designer
                        pokeDuck(new Person()); //runs fine
      intended?
Dart: Optional Types
 But as you add structure, types can help you…
class Person {
  sayQuack(){
     return "ouch…quack";
  }
}


pokeDuck(duck) {
  duck.sayQuack();
  duck.swimAway();
}
                         //Usage
 This now fails with a   pokeDuck(new Duck());
   noSuchMethod          pokeDuck(new Person()); //throws exception
      exception
Dart: Optional Types
 Adding type info provides documentation to tools and
  humans.
class Person {
  sayQuack(){
     return "ouch…quack";
  }
}


pokeDuck(Duck duck) {
   duck.sayQuack();
   duck.swimAway();
}
   Now the tools can     //Usage
  provide warnings (or   pokeDuck(new Duck());
    errors in checked    pokeDuck(new Person()); //tools warn
         mode).
Demo… Libraries
and optional types
Dart: noSuchMethod
 All classes can have a noSuchMethod method
class Person {
  sayQuack(){                            Similar to ruby's
     return "ouch…quack";                method_missing
  }

    noSuchMethod(name, args) {             Side note: Any
      if (name == "swimAway") {             object can be
        throw "I'm not really a duck";      thrown as an
      }                                       exception
    }
}
Dart: Functions
 Simple function syntax                      Different
    main() {                               syntax, same
                                               effect
         var myFunc = (a,b) {
            return a,b;
          }
                                            Functions as
         var myFunc = (a,b) => a+b;         arguments
         myFunc(a,b) => a+b;
         doSomething(c,d, myFunc);             Anonymous
         doSomething(c,d, (a,b) => a+b);        function
         var result = myFunc(101,202);
  }                                         Unsurprising
                                            function call
Libraries: Dart:html
 Client side library for interacting with the DOM
 Uses Dart constructs for DOM manipulation
       var foo = elem.query("#foo");       //return a foo
       var foos = elem.queryAll(".foo");   //list of foo


 Events:
       foo.on.click.add((event) {
          //do something
        });
Libraries: dart:io
 Server side libraries:
    Processes
    File IO
    Sockets
    Http Client & Server
Typical Async code with
module.handle("data", (result) {
                //on success
              },
              (err) {
                //on error
              }
);
Could be re-written with Futures
Future conn = module.handle("data");

conn.then((result) {
 //on success
});

conn.handleException((error) {
  //on error
});
Demo… futures
Still a technical preview
 Time to get involved…
    www.dartlang.org
    Join the active mailing list
    Search #dartlang on Google +


 Resources:
    http://api.dartlang.org
    http://synonyms.dartlang.org
    http://try.dartlang.org
Ad

More Related Content

What's hot (19)

Introduction to Dart
Introduction to DartIntroduction to Dart
Introduction to Dart
RameshNair6
 
What Makes Objective C Dynamic?
What Makes Objective C Dynamic?What Makes Objective C Dynamic?
What Makes Objective C Dynamic?
Kyle Oba
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse Con
Sven Efftinge
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
Dr. Jan Köhnlein
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Johnny Sung
 
Start dart
Start dartStart dart
Start dart
Hiroshi Mimori
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
Garth Gilmour
 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
Guillaume Laforge
 
Parte II Objective C
Parte II   Objective CParte II   Objective C
Parte II Objective C
Paolo Quadrani
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
Bartosz Kosarzycki
 
Google Dart
Google DartGoogle Dart
Google Dart
Eberhard Wolff
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
Holger Schill
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
msemenistyi
 
The Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana IsakovaThe Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana Isakova
Vasil Remeniuk
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
Kai Koenig
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
Hoat Le
 
ADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developersADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developers
Bartosz Kosarzycki
 
Groovy 2.0 webinar
Groovy 2.0 webinarGroovy 2.0 webinar
Groovy 2.0 webinar
Guillaume Laforge
 
Introduction to Dart
Introduction to DartIntroduction to Dart
Introduction to Dart
RameshNair6
 
What Makes Objective C Dynamic?
What Makes Objective C Dynamic?What Makes Objective C Dynamic?
What Makes Objective C Dynamic?
Kyle Oba
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Flutter 是什麼?用 Flutter 會省到時間嗎? @ GDG Devfest2020
Johnny Sung
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
Garth Gilmour
 
Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013Lift off with Groovy 2 at JavaOne 2013
Lift off with Groovy 2 at JavaOne 2013
Guillaume Laforge
 
Kotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projectsKotlin Developer Starter in Android projects
Kotlin Developer Starter in Android projects
Bartosz Kosarzycki
 
Using Xcore with Xtext
Using Xcore with XtextUsing Xcore with Xtext
Using Xcore with Xtext
Holger Schill
 
Javascript Basics
Javascript BasicsJavascript Basics
Javascript Basics
msemenistyi
 
The Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana IsakovaThe Kotlin Programming Language, Svetlana Isakova
The Kotlin Programming Language, Svetlana Isakova
Vasil Remeniuk
 
Coding for Android on steroids with Kotlin
Coding for Android on steroids with KotlinCoding for Android on steroids with Kotlin
Coding for Android on steroids with Kotlin
Kai Koenig
 
eXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction TrainingeXo SEA - JavaScript Introduction Training
eXo SEA - JavaScript Introduction Training
Hoat Le
 
ADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developersADG Poznań - Kotlin for Android developers
ADG Poznań - Kotlin for Android developers
Bartosz Kosarzycki
 

Similar to Dart, unicorns and rainbows (20)

Dart
DartDart
Dart
Andrea Chiodoni
 
Bringing your app to the web with Dart - Chris Buckett (Entity Group)
Bringing your app to the web with Dart - Chris Buckett (Entity Group)Bringing your app to the web with Dart - Chris Buckett (Entity Group)
Bringing your app to the web with Dart - Chris Buckett (Entity Group)
jaxLondonConference
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
STX Next
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
Ali Parmaksiz
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConfPatterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Vitaly Gordon
 
What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Ladd
jaxconf
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
Christian Heilmann
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
Núcleo de Electrónica e Informática da Universidade do Algarve
 
Dart Workshop
Dart WorkshopDart Workshop
Dart Workshop
Dmitry Buzdin
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
daewon jeong
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
ahfast
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based Games
Ray Toal
 
GDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptxGDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptx
GDSCVJTI
 
Object-oriented Basics
Object-oriented BasicsObject-oriented Basics
Object-oriented Basics
Jamie (Taka) Wang
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
Atlassian
 
Bringing your app to the web with Dart - Chris Buckett (Entity Group)
Bringing your app to the web with Dart - Chris Buckett (Entity Group)Bringing your app to the web with Dart - Chris Buckett (Entity Group)
Bringing your app to the web with Dart - Chris Buckett (Entity Group)
jaxLondonConference
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
Kotlin Developer Starter in Android - STX Next Lightning Talks - Feb 12, 2016
STX Next
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConfPatterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedInScalable and Flexible Machine Learning With Scala @ LinkedIn
Scalable and Flexible Machine Learning With Scala @ LinkedIn
Vitaly Gordon
 
What’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth LaddWhat’s new in Google Dart - Seth Ladd
What’s new in Google Dart - Seth Ladd
jaxconf
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
daewon jeong
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
ahfast
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Modeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based GamesModeling Patterns for JavaScript Browser-Based Games
Modeling Patterns for JavaScript Browser-Based Games
Ray Toal
 
GDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptxGDSC Flutter Forward Workshop.pptx
GDSC Flutter Forward Workshop.pptx
GDSCVJTI
 
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
No Coding Necessary: Building User Macros and Dynamic Reports Inside Confluen...
Atlassian
 
Ad

Recently uploaded (20)

Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Cybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure ADCybersecurity Identity and Access Solutions using Azure AD
Cybersecurity Identity and Access Solutions using Azure AD
VICTOR MAESTRE RAMIREZ
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Ad

Dart, unicorns and rainbows

  • 1. London Dart Community Chris Buckett
  • 2. Why unicorns and rainbows? Unicorns for: "Hey – look at that!" String s = 12345; int i = "Hello World"; print("$i $s"); //outputs "Hello World 12345" Optional Typing Rainbows for: Great Tools "Aah, that's nice!"
  • 3. This is Dart…  A language  And a tool ecosystem  For creating complex webapps  In teams  Single threaded  But isolates provide "shared-nothing" concurrency  Optionally typed  Runs in a Browser Virtual Machine  Or a Server Virtual Machine  Can be converted to JavaScript
  • 4. Technical Preview…  What you may see today, may change tomorrow…  Enable us (as potential end users) to influence the language and provide feedback  Eventual goal is standardization
  • 5. Why Dart…  What do Google build?  Single page web-apps Browser  Instant search Apps  Docs  Google Plus Server  Blogger side  Analytics APIs  Maps  … etc …
  • 6. Why Dart?  Complex applications  Team development //javascript…  Easily “toolable” //process a & b. function process(a,b) { return a+b; }; //javascript document.write(process(1,2,3)); document.write(process("Hello", "World")); document.write(process({name:'objectA'}, {name:'objectB'}));
  • 7. Why Dart – the alternatives?  GWT  Still around and will be driven by Google's use cases  CoffeeScript  Closer to JavaScript, syntax inspired by Ruby, Python  JavaScript + Framework X  The default option  Dart is not a replacement, but an option.
  • 8. Design Goals - Flexibility  Flexible, but with structure  Optional types provide flexibility  Libraries to organize code  Classes and Interfaces to provide structure  Tools catch errors
  • 9. Design goals - Familiar  Be Familiar main() { var anInt = 1; var aStr = "String"; var anObj = new Object(); var result = doSomething(anInt,aStr,anObj); } doSomething(a,b,c) { return "blah"; }
  • 10. Design goals - Familiar  Be Familiar void main() { int anInt = 1; String aStr = "String"; Object anObj = new Object(); String result = doSomething(anInt,aStr,anObj); } String doSomething(int a, String b, Object c) { return "blah"; }
  • 11. Design Goals - Perfomance  Performance as a feature  Currently not as fast as V8  (But D8 is faster at launch than V8 was at launch)  Converted JS should be as fast as or faster than equivalent hand written JavaScript.
  • 12. Design goals  Great developer IDE experience Dart Dart dart2js Language VM Native Browser
  • 14. Dart IDE (Lightweight Eclipse IDE)
  • 16. Dart2js: Dart to JS Converter #import('dart:html'); class MyApp { MyApp() { } void run() { write("Hello World!"); } void write(String message) { document.query('#status').innerHTML = message; } } void main() { new MyApp().run(); }
  • 17. dart2js: Dart to JS Converter //...snip library code... // ********** Code for MyApp ************** function MyApp() {} MyApp.prototype.run = function() { this.write("Hello World!"); } MyApp.prototype.write = function(message) { get$$document().query("#status").innerHTML = message; } // ********** Code for top level ************** function main() { new MyApp().run(); }
  • 18. Embed within HTML <html> <body> <script type="application/dart"> main() { print("Hello Dart"); } </script> </body> </html> <html> <body> <script type="application/dart" src="MyApp.dart"></script> </body> </html>
  • 19. A quick tour of some interesting language features…
  • 20. Dart: Classes and interfaces  Familiar (to Java and C# developers) Optional  But a couple of nice features paramters class Duck implements Quackable { var colour; Duck([this.colour="red"]) { } Duck.yellow() { Named this.colour = "yellow"; constructors } //Usage String sayQuack() => "quack"; var duck1 = new Duck(); } var duck2 = new Duck("blue"); Unsurprising Function var duck3 = new Duck.yellow(); this shorthand print(duck3.sayQuack());
  • 21. Dart: Classes and interfaces  Familiar (to Java and C# developers)  But a couple of nice features interface Quackable default Duck { String sayQuack(); } //Usage var duck1 = new Quackable();
  • 22. Dart: Classes and interfaces  All classes are also interfaces  class Person implements Duck { … }  Class properties can be interchanged with getters and setters  duck.colour = "yellow"; //setter, or property?  class Duck { var _colour; //private property get colour() => _colour; //getter set colour(value) { //setter _colour=value; } }
  • 23. Demo… classes and interfaces
  • 24. Dart: Libraries and Source  Break up single source code file into multiple, independent files. #library("myLibrary"); #import("./libs/otherLib.dart"); #source("./myFile1.dart"); #source("./myFile2.dart");  Break logical parts of an app into libraries.  Import your own and third party libraries.  Privacy declarations apply at a library level (not a class level)
  • 25. Dart: Optional Types  Add documentation to code  Documentation readable by humans and tools  "Innocent until proven guilty"  Types have no effect on the running application var i = 1; int i = 1; var s = "Hello"; String s = "Hello"; String i = 1; int s = "Hello"; Probably wrong, but not proved to be wrong.
  • 26. Dart: Optional Types  Optional types can be useful in the early days of developing an app class Person { sayQuack(){ return "ouch…quack"; } } pokeDuck(duck) { duck.sayQuack(); } //Usage But is that what the pokeDuck(new Duck()); library designer pokeDuck(new Person()); //runs fine intended?
  • 27. Dart: Optional Types  But as you add structure, types can help you… class Person { sayQuack(){ return "ouch…quack"; } } pokeDuck(duck) { duck.sayQuack(); duck.swimAway(); } //Usage This now fails with a pokeDuck(new Duck()); noSuchMethod pokeDuck(new Person()); //throws exception exception
  • 28. Dart: Optional Types  Adding type info provides documentation to tools and humans. class Person { sayQuack(){ return "ouch…quack"; } } pokeDuck(Duck duck) { duck.sayQuack(); duck.swimAway(); } Now the tools can //Usage provide warnings (or pokeDuck(new Duck()); errors in checked pokeDuck(new Person()); //tools warn mode).
  • 30. Dart: noSuchMethod  All classes can have a noSuchMethod method class Person { sayQuack(){ Similar to ruby's return "ouch…quack"; method_missing } noSuchMethod(name, args) { Side note: Any if (name == "swimAway") { object can be throw "I'm not really a duck"; thrown as an } exception } }
  • 31. Dart: Functions  Simple function syntax Different  main() { syntax, same effect  var myFunc = (a,b) { return a,b; } Functions as  var myFunc = (a,b) => a+b; arguments  myFunc(a,b) => a+b;  doSomething(c,d, myFunc); Anonymous  doSomething(c,d, (a,b) => a+b); function  var result = myFunc(101,202); } Unsurprising function call
  • 32. Libraries: Dart:html  Client side library for interacting with the DOM  Uses Dart constructs for DOM manipulation  var foo = elem.query("#foo"); //return a foo  var foos = elem.queryAll(".foo"); //list of foo  Events:  foo.on.click.add((event) { //do something });
  • 33. Libraries: dart:io  Server side libraries:  Processes  File IO  Sockets  Http Client & Server
  • 34. Typical Async code with module.handle("data", (result) { //on success }, (err) { //on error } );
  • 35. Could be re-written with Futures Future conn = module.handle("data"); conn.then((result) { //on success }); conn.handleException((error) { //on error });
  • 37. Still a technical preview  Time to get involved…  www.dartlang.org  Join the active mailing list  Search #dartlang on Google +  Resources:  http://api.dartlang.org  http://synonyms.dartlang.org  http://try.dartlang.org