SlideShare a Scribd company logo
1 of 35
Download to read offline
Dart: a modern web language
       Nicolas Geoffray
           Google
Who am I?
Nicolas Geoffray, software engineer at Google


Projects

●   VVM - Highly dynamic runtime environment
●   VMKit - Framework for writing VMs
●   I-JVM - Better dependability in OSGi
●   Dart - Structured programming for the web
Motivation



     Improve web development
The web is already pretty awesome


● It is easy to develop small applications
  ○ Code runs everywhere (phones, desktops)
  ○ No installation of applications
  ○ Deployment is almost trivial
● JavaScript is very flexible and supports
  incremental development
The rise of JavaScript

                              Crankshaft




             Credit: http://iq12.com/blog/
Why is the web hard to program for?
●   Writing large well-performing applications is hard
●   Hard to reason about the program structure
●   Startup performance is often really bad
●   Difficult to document intent (lack of types)
●   No support for modules, packages, or libraries
Make it easier
● We want to improve the web platform
  ○ Better support for programming in the large
  ○ Faster application startup (especially on mobile)
  ○ More predictable and better runtime performance
  ○ JavaScript is a powerful tool but it has sharp edges
● Keep up the innovation momentum
  ○ The web is evolving at a fantastic pace!
  ○ The developer tools have to keep up
JavaScript is full of ... surprises
● Lots and lots of implicit type conversions
● Most operations produce weird results when
  passed wrong or uninitialized values instead
  of failing in a recognizable way




                 Keep on truckin'
No argument type checking
var   x = 499;
x +   null;
x +   [];
x +   undefined;
x -   {};
No argument type checking
var   x = 499;
x +   null; // => 499
x +   [];
x +   undefined;
x -   {};
No argument type checking
var   x = 499;
x +   null; // => 499
x +   []; // => "499"
x +   undefined;
x -   {};
No argument type checking
var   x = 499;
x +   null; // => 499
x +   []; // => "499"
x +   undefined; // => NaN
x -   {};
No argument type checking
var   x = 499;
x +   null; // => 499
x +   []; // => "499"
x +   undefined; // => NaN
x -   {}; // => NaN
No array bounds checking
var array = new Array(32);
...
array[32];
array[-1];
array[.1];
array[null];
array[array];
No array bounds checking
var array = new Array(32);
...
array[32]; // => undefined
array[-1]; // => undefined
array[.1]; // => undefined
array[null]; // => undefined
array[array]; // => undefined
No array bounds checking
var array = new Array(32);
...
array[32]; // => void 0
array[-1]; // => void 0
array[.1]; // => void 0
array[null]; // => void 0
array[array]; // => void 0
No spell checking?
var request = new XMLHttpRequest();
...
request.onreadystatechange = function() {
   if (request.readystate == 4) {
     console.log('Request done!');
   }
};
No spell checking?
var request = new XMLHttpRequest();
...
request.onreadystatechange = function() {
   if (request.readyState == 4) {
     console.log('Request done!');
   }
};
JavaScript has improved but ...
● JavaScript has fundamental issues at the
  language level that impact productivity
● Performance has improved but mostly for a
  pretty static subset of JavaScript
● It remains very time consuming to build and
  maintain large web apps
The story of Dart
● A few years ago Lars Bak and Kasper Lund prototyped
    Spot
    ○ A new simple programming language for the web
    ○ Based on their experiences from JavaScript/V8
●   Spot was the prelude for the Dart project
What is Dart?
●   Unsurprising object-oriented programming language
●   Class-based single inheritance with interfaces
●   Familiar syntax with proper lexical scoping
●   Single-threaded with isolate-based concurrency
●   Optional static types
And more!
Dart comes with a lot of developer tools:
● DartEditor: Eclipse based Dart editor
● Dartium: Chromium with embedded Dart VM
● dart2js: Dart-to-JavaScript compiler
● Libraries: io, crypto, i18n, ...
Deployment and execution
                                      Dart source
                                      Dart source




                                                          Dart virtual
                         Dart tools
                                                           machine

                                                    in browser or standalone


                                         Dart
                                       snapshot
        JavaScript

runs in all modern browsers
Let's see it in action
● Let's write simple applications with the
  Eclipse-based Dart Editor
Conventional type checking
● Tries to prove that your program obeys the type system
● Considers it a fatal error if no proof can be constructed
● In Dart, you are innocent until proven guilty...
        List<Apple> apples = tree.pickApples();
        printFruits(apples);

        void printFruits(List<Fruit> fruits) {
          for (Fruit each in fruits) print(each);
        }
Optional static types
●   Static types convey the intent of the programmer
●   Checkable documentation for code and interfaces
●   Avoids awkward variable naming or comment schemes
●   Type annotations have no effect on runtime semantics
Isolates
Isolates are lightweight units of execution:
● Run in their own address space like
   processes
● Nothing is shared - nothing needs
   synchronization
● All communication takes place via
   messaging passing
● Supports concurrent execution
Communication
● ReceivePorts:
  ○ enqueues incoming messages
  ○ can not leave their isolate
  ○ can be created on demand


● SendPorts:
  ○   created by a ReceivePort
  ○   dispatches messages to its ReceivePort
  ○   can be transferred (across Isolate boundaries)
  ○   Unforgeable, transferable capability
Dart virtual machine
● Dart has been designed for performance
  ○ Simplicity gives more performance headroom
  ○ Enforced structure leads to better predictability
  ○ Virtual machine performs better than V8 at launch
● Works embedded in browser or standalone
  ○ Experimental Dart-enabled build of Chromium
  ○ SDK includes preliminary server-side libraries

              $ dart hello.dart
Dart-to-JavaScript
● Compiler is implemented in Dart
  ○ Generates JavaScript that runs in modern browsers
  ○ SSA based optimizations
  ○ Uses tree shaking to cut down on code size

    $ dart2js --out=hello.js hello.dart
Flavour of generated JavaScript
class Point {
  var x, y;
  Point(this.x, this.y);
  toString() => "($x,$y)";
}


Isolate.$defineClass("Point", "Object", ["x", "y"], {
  toString$0: function() {
    return '(' + $.toString(this.x) + ',' +
                 $.toString(this.y) + ')';
  }
});
Performance
Open source
● Dart is available under a BSD license
● Developed in the open (code reviews, build bots, etc.)

Online resources

●   Primary site - http://www.dartlang.org/
●   Code - http://dart.googlecode.com/
●   Libraries - http://api.dartlang.org/
●   Specification - http://www.dartlang.org/docs/spec/
Summary
● Dart is an unsurprising, object-oriented
  language that is instantly familiar to most
● Dart allows you to write code that tools and
  programmers can reason about
● Dart applications runs in all modern
  browsers through translation to JavaScript
Dart allows rapid prototyping and
                                        structured development.
   Dart was designed with
   performance in mind.




                        Thank you!
                                                  Dart is open source and
                                                  instantly familiar to lots of
                                                  programmers.
Dart runs everywhere JavaScript does.

More Related Content

What's hot

Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, DarrrtJana Moudrá
 
TypeScript Modules
TypeScript ModulesTypeScript Modules
TypeScript ModulesNoam Kfir
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practicesIwan van der Kleijn
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideNascenia IT
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practicesfelixbillon
 
Typescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentTypescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentJoost de Vries
 
SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...
 SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros... SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...
SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...South Tyrol Free Software Conference
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins Udaya Kumar
 
Introduction about type script
Introduction about type scriptIntroduction about type script
Introduction about type scriptBinh Quan Duc
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScriptOffirmo
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersRutenis Turcinas
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painSander Mak (@Sander_Mak)
 

What's hot (20)

Dart, Darrt, Darrrt
Dart, Darrt, DarrrtDart, Darrt, Darrrt
Dart, Darrt, Darrrt
 
TypeScript Modules
TypeScript ModulesTypeScript Modules
TypeScript Modules
 
Dart
DartDart
Dart
 
AngularConf2015
AngularConf2015AngularConf2015
AngularConf2015
 
Type script - advanced usage and practices
Type script  - advanced usage and practicesType script  - advanced usage and practices
Type script - advanced usage and practices
 
TypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation GuideTypeScript: Basic Features and Compilation Guide
TypeScript: Basic Features and Compilation Guide
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practices
 
Typescript: enjoying large scale browser development
Typescript: enjoying large scale browser developmentTypescript: enjoying large scale browser development
Typescript: enjoying large scale browser development
 
TypeScript 101
TypeScript 101TypeScript 101
TypeScript 101
 
SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...
 SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros... SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...
SFScon 2020 - Juri Strumpflohner - Beyond Basics - Scaling Development acros...
 
Typescript in 30mins
Typescript in 30mins Typescript in 30mins
Typescript in 30mins
 
Start dart
Start dartStart dart
Start dart
 
Introduction about type script
Introduction about type scriptIntroduction about type script
Introduction about type script
 
Power Leveling your TypeScript
Power Leveling your TypeScriptPower Leveling your TypeScript
Power Leveling your TypeScript
 
TypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack DevelopersTypeScript - Silver Bullet for the Full-stack Developers
TypeScript - Silver Bullet for the Full-stack Developers
 
Typescript
TypescriptTypescript
Typescript
 
TypeScript
TypeScriptTypeScript
TypeScript
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
TypeScript Overview
TypeScript OverviewTypeScript Overview
TypeScript Overview
 

Similar to OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, software engineer at google

Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools Yulia Shcherbachova
 
Dart presentation
Dart presentationDart presentation
Dart presentationLucas Leal
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGlobalLogic Ukraine
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Priyanka Tyagi
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...Ambassador Labs
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsOWASP Kyiv
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Priyanka Tyagi
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodeKris Buytaert
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...Sang Don Kim
 
TypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript ComparisonTypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript ComparisonHaim Michael
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil FrameworkVeilFramework
 
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...Dan Farrelly
 
Higher Level Malware
Higher Level MalwareHigher Level Malware
Higher Level MalwareCTruncer
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Waysmalltown
 
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
 
Developing with-devstack
Developing with-devstackDeveloping with-devstack
Developing with-devstackDeepak Garg
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentDavid Galeano
 

Similar to OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, software engineer at google (20)

Dart
DartDart
Dart
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Dart Jump Start
Dart Jump StartDart Jump Start
Dart Jump Start
 
Dart presentation
Dart presentationDart presentation
Dart presentation
 
Go Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii ShapovalGo Is Your Next Language — Sergii Shapoval
Go Is Your Next Language — Sergii Shapoval
 
Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)Developing Cross platform apps in flutter (Android, iOS, Web)
Developing Cross platform apps in flutter (Android, iOS, Web)
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
 
Andriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tipsAndriy Shalaenko - GO security tips
Andriy Shalaenko - GO security tips
 
Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)Developing cross platform apps in Flutter (Android, iOS, and Web)
Developing cross platform apps in Flutter (Android, iOS, and Web)
 
Pipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as CodePipeline as code for your infrastructure as Code
Pipeline as code for your infrastructure as Code
 
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
[Td 2015] what is new in visual c++ 2015 and future directions(ulzii luvsanba...
 
TypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript ComparisonTypeScript, Dart, CoffeeScript and JavaScript Comparison
TypeScript, Dart, CoffeeScript and JavaScript Comparison
 
The State of the Veil Framework
The State of the Veil FrameworkThe State of the Veil Framework
The State of the Veil Framework
 
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...
Building a Pluggable, Cloud-native Event-driven Serverless Architecture - Rea...
 
Nodejs
NodejsNodejs
Nodejs
 
Higher Level Malware
Higher Level MalwareHigher Level Malware
Higher Level Malware
 
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps WayDevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
DevOpsDays Taipei 2019 - Mastering IaC the DevOps Way
 
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)
 
Developing with-devstack
Developing with-devstackDeveloping with-devstack
Developing with-devstack
 
mloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game developmentmloc.js 2014 - JavaScript and the browser as a platform for game development
mloc.js 2014 - JavaScript and the browser as a platform for game development
 

More from Paris Open Source Summit

#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...
#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...
#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...Paris Open Source Summit
 
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...Paris Open Source Summit
 
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...Paris Open Source Summit
 
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, ArduinoParis Open Source Summit
 
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...Paris Open Source Summit
 
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...Paris Open Source Summit
 
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, ZabbixParis Open Source Summit
 
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, InriaParis Open Source Summit
 
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...Paris Open Source Summit
 
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches ...
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches  ...#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches  ...
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches ...Paris Open Source Summit
 
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...Paris Open Source Summit
 
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...Paris Open Source Summit
 
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...Paris Open Source Summit
 
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...Paris Open Source Summit
 
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...Paris Open Source Summit
 
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...Paris Open Source Summit
 
#OSSPARIS19 - Table ronde : souveraineté des données
#OSSPARIS19 - Table ronde : souveraineté des données #OSSPARIS19 - Table ronde : souveraineté des données
#OSSPARIS19 - Table ronde : souveraineté des données Paris Open Source Summit
 
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...Paris Open Source Summit
 
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...Paris Open Source Summit
 
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...Paris Open Source Summit
 

More from Paris Open Source Summit (20)

#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...
#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...
#OSSPARIS19 : Control your Embedded Linux remotely by using WebSockets - Gian...
 
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
#OSSPARIS19 : A virtual machine approach for microcontroller programming : th...
 
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...
#OSSPARIS19 : RIOT: towards open source, secure DevOps on microcontroller-bas...
 
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino
#OSSPARIS19 : The evolving (IoT) security landscape - Gianluca Varisco, Arduino
 
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...
#OSSPARIS19: Construire des applications IoT "secure-by-design" - Thomas Gaza...
 
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...
#OSSPARIS19 : Detecter des anomalies de séries temporelles à la volée avec Wa...
 
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix
#OSSPARIS19 : Supervision d'objets connectés industriels - Eric DOANE, Zabbix
 
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria
#OSSPARIS19: Introduction to scikit-learn - Olivier Grisel, Inria
 
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...
#OSSPARIS19 - Fostering disruptive innovation in AI with JEDI - André Loesekr...
 
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches ...
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches  ...#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches  ...
#OSSPARIS19 : Comment ONLYOFFICE aide à organiser les travaux de recherches ...
 
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...
#OSSPARIS19 : MDPH : une solution collaborative open source pour l'instructio...
 
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...
#OSSPARIS19 - Understanding Open Source Governance - Gilles Gravier, Wipro Li...
 
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...
#OSSPARIS19 : Publier du code Open Source dans une banque : Mission impossibl...
 
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...
#OSSPARIS19 : Libre à vous ! Raconter les libertés informatiques à la radio -...
 
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...
#OSSPARIS19 - Le logiciel libre : un enjeu politique et social - Etienne Gonn...
 
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...
#OSSPARIS19 - Conflits d’intérêt & concurrence : la place de l’éditeur dans l...
 
#OSSPARIS19 - Table ronde : souveraineté des données
#OSSPARIS19 - Table ronde : souveraineté des données #OSSPARIS19 - Table ronde : souveraineté des données
#OSSPARIS19 - Table ronde : souveraineté des données
 
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...
#OSSPARIS19 - Comment financer un projet de logiciel libre - LUDOVIC DUBOST, ...
 
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...
#OSSPARIS19 - BlueMind v4 : les dessous technologiques de 10 ans de travail p...
 
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...
#OSSPARIS19 - Tuto de première installation de VITAM, un système d'archivage ...
 

OWF12/PAUG Conf Days Dart a new html5 technology, nicolas geoffray, software engineer at google

  • 1. Dart: a modern web language Nicolas Geoffray Google
  • 2. Who am I? Nicolas Geoffray, software engineer at Google Projects ● VVM - Highly dynamic runtime environment ● VMKit - Framework for writing VMs ● I-JVM - Better dependability in OSGi ● Dart - Structured programming for the web
  • 3. Motivation Improve web development
  • 4. The web is already pretty awesome ● It is easy to develop small applications ○ Code runs everywhere (phones, desktops) ○ No installation of applications ○ Deployment is almost trivial ● JavaScript is very flexible and supports incremental development
  • 5. The rise of JavaScript Crankshaft Credit: http://iq12.com/blog/
  • 6. Why is the web hard to program for? ● Writing large well-performing applications is hard ● Hard to reason about the program structure ● Startup performance is often really bad ● Difficult to document intent (lack of types) ● No support for modules, packages, or libraries
  • 7. Make it easier ● We want to improve the web platform ○ Better support for programming in the large ○ Faster application startup (especially on mobile) ○ More predictable and better runtime performance ○ JavaScript is a powerful tool but it has sharp edges ● Keep up the innovation momentum ○ The web is evolving at a fantastic pace! ○ The developer tools have to keep up
  • 8. JavaScript is full of ... surprises ● Lots and lots of implicit type conversions ● Most operations produce weird results when passed wrong or uninitialized values instead of failing in a recognizable way Keep on truckin'
  • 9. No argument type checking var x = 499; x + null; x + []; x + undefined; x - {};
  • 10. No argument type checking var x = 499; x + null; // => 499 x + []; x + undefined; x - {};
  • 11. No argument type checking var x = 499; x + null; // => 499 x + []; // => "499" x + undefined; x - {};
  • 12. No argument type checking var x = 499; x + null; // => 499 x + []; // => "499" x + undefined; // => NaN x - {};
  • 13. No argument type checking var x = 499; x + null; // => 499 x + []; // => "499" x + undefined; // => NaN x - {}; // => NaN
  • 14. No array bounds checking var array = new Array(32); ... array[32]; array[-1]; array[.1]; array[null]; array[array];
  • 15. No array bounds checking var array = new Array(32); ... array[32]; // => undefined array[-1]; // => undefined array[.1]; // => undefined array[null]; // => undefined array[array]; // => undefined
  • 16. No array bounds checking var array = new Array(32); ... array[32]; // => void 0 array[-1]; // => void 0 array[.1]; // => void 0 array[null]; // => void 0 array[array]; // => void 0
  • 17. No spell checking? var request = new XMLHttpRequest(); ... request.onreadystatechange = function() { if (request.readystate == 4) { console.log('Request done!'); } };
  • 18. No spell checking? var request = new XMLHttpRequest(); ... request.onreadystatechange = function() { if (request.readyState == 4) { console.log('Request done!'); } };
  • 19. JavaScript has improved but ... ● JavaScript has fundamental issues at the language level that impact productivity ● Performance has improved but mostly for a pretty static subset of JavaScript ● It remains very time consuming to build and maintain large web apps
  • 20. The story of Dart ● A few years ago Lars Bak and Kasper Lund prototyped Spot ○ A new simple programming language for the web ○ Based on their experiences from JavaScript/V8 ● Spot was the prelude for the Dart project
  • 21. What is Dart? ● Unsurprising object-oriented programming language ● Class-based single inheritance with interfaces ● Familiar syntax with proper lexical scoping ● Single-threaded with isolate-based concurrency ● Optional static types
  • 22. And more! Dart comes with a lot of developer tools: ● DartEditor: Eclipse based Dart editor ● Dartium: Chromium with embedded Dart VM ● dart2js: Dart-to-JavaScript compiler ● Libraries: io, crypto, i18n, ...
  • 23. Deployment and execution Dart source Dart source Dart virtual Dart tools machine in browser or standalone Dart snapshot JavaScript runs in all modern browsers
  • 24. Let's see it in action ● Let's write simple applications with the Eclipse-based Dart Editor
  • 25. Conventional type checking ● Tries to prove that your program obeys the type system ● Considers it a fatal error if no proof can be constructed ● In Dart, you are innocent until proven guilty... List<Apple> apples = tree.pickApples(); printFruits(apples); void printFruits(List<Fruit> fruits) { for (Fruit each in fruits) print(each); }
  • 26. Optional static types ● Static types convey the intent of the programmer ● Checkable documentation for code and interfaces ● Avoids awkward variable naming or comment schemes ● Type annotations have no effect on runtime semantics
  • 27. Isolates Isolates are lightweight units of execution: ● Run in their own address space like processes ● Nothing is shared - nothing needs synchronization ● All communication takes place via messaging passing ● Supports concurrent execution
  • 28. Communication ● ReceivePorts: ○ enqueues incoming messages ○ can not leave their isolate ○ can be created on demand ● SendPorts: ○ created by a ReceivePort ○ dispatches messages to its ReceivePort ○ can be transferred (across Isolate boundaries) ○ Unforgeable, transferable capability
  • 29. Dart virtual machine ● Dart has been designed for performance ○ Simplicity gives more performance headroom ○ Enforced structure leads to better predictability ○ Virtual machine performs better than V8 at launch ● Works embedded in browser or standalone ○ Experimental Dart-enabled build of Chromium ○ SDK includes preliminary server-side libraries $ dart hello.dart
  • 30. Dart-to-JavaScript ● Compiler is implemented in Dart ○ Generates JavaScript that runs in modern browsers ○ SSA based optimizations ○ Uses tree shaking to cut down on code size $ dart2js --out=hello.js hello.dart
  • 31. Flavour of generated JavaScript class Point { var x, y; Point(this.x, this.y); toString() => "($x,$y)"; } Isolate.$defineClass("Point", "Object", ["x", "y"], { toString$0: function() { return '(' + $.toString(this.x) + ',' + $.toString(this.y) + ')'; } });
  • 33. Open source ● Dart is available under a BSD license ● Developed in the open (code reviews, build bots, etc.) Online resources ● Primary site - http://www.dartlang.org/ ● Code - http://dart.googlecode.com/ ● Libraries - http://api.dartlang.org/ ● Specification - http://www.dartlang.org/docs/spec/
  • 34. Summary ● Dart is an unsurprising, object-oriented language that is instantly familiar to most ● Dart allows you to write code that tools and programmers can reason about ● Dart applications runs in all modern browsers through translation to JavaScript
  • 35. Dart allows rapid prototyping and structured development. Dart was designed with performance in mind. Thank you! Dart is open source and instantly familiar to lots of programmers. Dart runs everywhere JavaScript does.