SlideShare a Scribd company logo
London Ajax User Group


             Chris Buckett
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
 Easily “toolable”
        //process a & b.
        function process(a,b) {
          return a+b;
        };


        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
               Frog
                      Language   VM




                       Native
                       Browser
Dartium (Chromium with Dart VM)
Dart IDE (Lightweight Eclipse IDE)
Frog: 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();
}
Frog: 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 = 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;
         }
     }
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).
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
Still a technical preview
 Time to get involved…
    www.dartlang.org
    Join the active mailing list
    Search #dartlang on Google +


 More still to be built
   Reflection!
   Libraries providing higher levels of abstraction:
        UI frameworks
        Server frameworks
Ad

More Related Content

What's hot (18)

Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
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
 
Dart
DartDart
Dart
anandvns
 
Dart programming language
Dart programming languageDart programming language
Dart programming language
Aniruddha Chakrabarti
 
C# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XMLC# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XML
Mohammad Shaker
 
Kotlin
KotlinKotlin
Kotlin
YeldosTanikin
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
Heiko Behrens
 
Andy On Closures
Andy On ClosuresAndy On Closures
Andy On Closures
melbournepatterns
 
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
 
Let's Play Dart
Let's Play DartLet's Play Dart
Let's Play Dart
Jana Moudrá
 
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
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse Con
Sven Efftinge
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
Betclic Everest Group Tech Team
 
Google Dart
Google DartGoogle Dart
Google Dart
Eberhard Wolff
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented Php
Michael Girouard
 
The Xtext Grammar Language
The Xtext Grammar LanguageThe Xtext Grammar Language
The Xtext Grammar Language
Dr. Jan Köhnlein
 
Introduction To Groovy 2005
Introduction To Groovy 2005Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
 
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
 
C# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XMLC# Advanced L03-XML+LINQ to XML
C# Advanced L03-XML+LINQ to XML
Mohammad Shaker
 
Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009Building DSLs with Xtext - Eclipse Modeling Day 2009
Building DSLs with Xtext - Eclipse Modeling Day 2009
Heiko Behrens
 
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
 
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
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
Jorg Janke
 
A Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented PhpA Gentle Introduction To Object Oriented Php
A Gentle Introduction To Object Oriented Php
Michael Girouard
 

Viewers also liked (20)

Sesión 4
Sesión 4Sesión 4
Sesión 4
Michael Andrés Calderón Ferreira
 
QUALITY MANAGEMENT
QUALITY MANAGEMENTQUALITY MANAGEMENT
QUALITY MANAGEMENT
smcci
 
Projeto AN9 - Uberlândia
Projeto AN9 - UberlândiaProjeto AN9 - Uberlândia
Projeto AN9 - Uberlândia
Filipe Detrey
 
Examen sybase - Administration base de donnees
Examen sybase - Administration base de donneesExamen sybase - Administration base de donnees
Examen sybase - Administration base de donnees
webreaker
 
Dat202 Techdays Paris 2015: PowerBI un an après
Dat202 Techdays Paris 2015: PowerBI un an aprèsDat202 Techdays Paris 2015: PowerBI un an après
Dat202 Techdays Paris 2015: PowerBI un an après
Isabelle Van Campenhoudt
 
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Isabelle Van Campenhoudt
 
To g chapter season 2 chapter 6.cv
To g chapter season 2 chapter 6.cvTo g chapter season 2 chapter 6.cv
To g chapter season 2 chapter 6.cv
Max Kerkula
 
Cycle Power BI Part1
Cycle Power BI Part1Cycle Power BI Part1
Cycle Power BI Part1
Isabelle Van Campenhoudt
 
Smci
SmciSmci
Smci
smcci
 
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
SPC Adriatics
 
Relational databases & NoSQL databases
Relational databases & NoSQL databasesRelational databases & NoSQL databases
Relational databases & NoSQL databases
Cédric Villa
 
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit JesterSharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
Etienne Bailly
 
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศบทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
เจริญขวัญ นาคประดิษฐ์
 
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday CambridgeSharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
serge luca
 
Présentation JSS2015 - Le Query Store de SQL Server 2016
Présentation JSS2015 - Le Query Store de SQL Server 2016Présentation JSS2015 - Le Query Store de SQL Server 2016
Présentation JSS2015 - Le Query Store de SQL Server 2016
Guillaume Nocent
 
PowerBI v2, Power to the People, 1 year later
PowerBI v2, Power to the People, 1 year laterPowerBI v2, Power to the People, 1 year later
PowerBI v2, Power to the People, 1 year later
serge luca
 
Powerbi 365
Powerbi 365Powerbi 365
Powerbi 365
Isabelle Van Campenhoudt
 
SQL Saturday 510 Paris 2016 - Query Store session - final
SQL Saturday 510 Paris 2016 - Query Store session - finalSQL Saturday 510 Paris 2016 - Query Store session - final
SQL Saturday 510 Paris 2016 - Query Store session - final
Philippe Geiger
 
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groupsUnbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Isabelle Van Campenhoudt
 
QUALITY MANAGEMENT
QUALITY MANAGEMENTQUALITY MANAGEMENT
QUALITY MANAGEMENT
smcci
 
Projeto AN9 - Uberlândia
Projeto AN9 - UberlândiaProjeto AN9 - Uberlândia
Projeto AN9 - Uberlândia
Filipe Detrey
 
Examen sybase - Administration base de donnees
Examen sybase - Administration base de donneesExamen sybase - Administration base de donnees
Examen sybase - Administration base de donnees
webreaker
 
Dat202 Techdays Paris 2015: PowerBI un an après
Dat202 Techdays Paris 2015: PowerBI un an aprèsDat202 Techdays Paris 2015: PowerBI un an après
Dat202 Techdays Paris 2015: PowerBI un an après
Isabelle Van Campenhoudt
 
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Tuning Sql Server for SharePoint--- Community Day Belgium 2013
Isabelle Van Campenhoudt
 
To g chapter season 2 chapter 6.cv
To g chapter season 2 chapter 6.cvTo g chapter season 2 chapter 6.cv
To g chapter season 2 chapter 6.cv
Max Kerkula
 
Smci
SmciSmci
Smci
smcci
 
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
Microsoft BI demystified: SharePoint 2016 BI or for PowerBI v2?
SPC Adriatics
 
Relational databases & NoSQL databases
Relational databases & NoSQL databasesRelational databases & NoSQL databases
Relational databases & NoSQL databases
Cédric Villa
 
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit JesterSharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
SharePoint 2016 les nouveautés / yosTour Lyon / Etienne Bailly | Benoit Jester
Etienne Bailly
 
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศบทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
บทที่ ๔ สื่อการสอนและห้องเรียนภาษาไทยในฐานะภาษาต่างประเทศ
เจริญขวัญ นาคประดิษฐ์
 
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday CambridgeSharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
SharePoint 2016 BI or PowerBI v2 - SharePoint Saturday Cambridge
serge luca
 
Présentation JSS2015 - Le Query Store de SQL Server 2016
Présentation JSS2015 - Le Query Store de SQL Server 2016Présentation JSS2015 - Le Query Store de SQL Server 2016
Présentation JSS2015 - Le Query Store de SQL Server 2016
Guillaume Nocent
 
PowerBI v2, Power to the People, 1 year later
PowerBI v2, Power to the People, 1 year laterPowerBI v2, Power to the People, 1 year later
PowerBI v2, Power to the People, 1 year later
serge luca
 
SQL Saturday 510 Paris 2016 - Query Store session - final
SQL Saturday 510 Paris 2016 - Query Store session - finalSQL Saturday 510 Paris 2016 - Query Store session - final
SQL Saturday 510 Paris 2016 - Query Store session - final
Philippe Geiger
 
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groupsUnbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Unbreakable Sharepoint 2016 With SQL Server 2016 availability groups
Isabelle Van Campenhoudt
 
Ad

Similar to Dart structured web apps (20)

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
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
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
 
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
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConfPatterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
Ali Parmaksiz
 
"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
 
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
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
Javascript Best Practices
Javascript Best PracticesJavascript Best Practices
Javascript Best Practices
Christian Heilmann
 
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
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
daewon jeong
 
Having Fun with Play
Having Fun with PlayHaving Fun with Play
Having Fun with Play
Clinton Dreisbach
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
ahfast
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
Hugo Gävert
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Data Con LA
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Devtools cheatsheet
Devtools cheatsheetDevtools cheatsheet
Devtools cheatsheet
Dr. Volkan OBAN
 
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
 
CSharp presentation and software developement
CSharp presentation and software developementCSharp presentation and software developement
CSharp presentation and software developement
frwebhelp
 
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
 
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
 
Patterns for JVM languages JokerConf
Patterns for JVM languages JokerConfPatterns for JVM languages JokerConf
Patterns for JVM languages JokerConf
Jaroslaw Palka
 
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
 
Smoothing Your Java with DSLs
Smoothing Your Java with DSLsSmoothing Your Java with DSLs
Smoothing Your Java with DSLs
intelliyole
 
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
 
Scala is java8.next()
Scala is java8.next()Scala is java8.next()
Scala is java8.next()
daewon jeong
 
Structured web programming
Structured web programmingStructured web programming
Structured web programming
ahfast
 
Introduction to Scalding and Monoids
Introduction to Scalding and MonoidsIntroduction to Scalding and Monoids
Introduction to Scalding and Monoids
Hugo Gävert
 
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Big Data Day LA 2015 - Compiling DSLs for Diverse Execution Environments by Z...
Data Con LA
 
Framework engineering JCO 2011
Framework engineering JCO 2011Framework engineering JCO 2011
Framework engineering JCO 2011
YoungSu Son
 
Ad

Recently uploaded (20)

HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
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
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
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
 
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
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
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
 
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
 
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
 
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
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
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
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
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
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
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
 
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptxDevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
DevOpsDays Atlanta 2025 - Building 10x Development Organizations.pptx
Justin Reock
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
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
 
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
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
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
 
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
 
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
 
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
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
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
 

Dart structured web apps

  • 1. London Ajax User Group Chris Buckett
  • 2. 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
  • 3. 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
  • 4. Why Dart…  What do Google build?  Single page web-apps Browser  Instant search Apps  Docs  Google Plus Server  Blogger side  Analytics APIs  Maps  … etc …
  • 5. Why Dart?  Complex applications  Team development  Easily “toolable” //process a & b. function process(a,b) { return a+b; }; document.write(process(1,2,3)); document.write(process("Hello", " World")); document.write(process({name:'objectA'}, {name:'objectB'}));
  • 6. 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.
  • 7. Design Goals - Flexibility  Flexible, but with structure  Optional types provide flexibility  Libraries to organize code  Classes and Interfaces to provide structure  Tools catch errors
  • 8. 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"; }
  • 9. 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"; }
  • 10. 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.
  • 11. Design goals  Great developer IDE experience Dart Dart Frog Language VM Native Browser
  • 13. Dart IDE (Lightweight Eclipse IDE)
  • 14. Frog: 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(); }
  • 15. Frog: 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(); }
  • 16. 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>
  • 17. A quick tour of some interesting language features…
  • 18. 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());
  • 19. 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 = Quackable();
  • 20. 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; } }
  • 21. 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)
  • 22. 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.
  • 23. 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?
  • 24. 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
  • 25. 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).
  • 26. 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 } }
  • 27. 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
  • 28. 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 });
  • 29. Libraries: dart:io  Server side libraries:  Processes  File IO  Sockets  Http Client & Server
  • 30. Still a technical preview  Time to get involved…  www.dartlang.org  Join the active mailing list  Search #dartlang on Google +  More still to be built  Reflection!  Libraries providing higher levels of abstraction:  UI frameworks  Server frameworks