Anders Sandholm Wednesday, November 23, 2011 DART: A STRUCTURED WEB - - PowerPoint PPT Presentation

anders sandholm
SMART_READER_LITE
LIVE PREVIEW

Anders Sandholm Wednesday, November 23, 2011 DART: A STRUCTURED WEB - - PowerPoint PPT Presentation

Anders Sandholm Wednesday, November 23, 2011 DART: A STRUCTURED WEB PROGRAMMING LANGUAGE Public preview Oct 10 A programming language Programming tools Open source project Wednesday, November 23, 2011 SPEAKER


slide-1
SLIDE 1

Anders Sandholm

Wednesday, November 23, 2011
slide-2
SLIDE 2

DART: A STRUCTURED WEB PROGRAMMING LANGUAGE

  • Public preview Oct 10
  • A programming language
  • Programming tools
  • Open source project
Wednesday, November 23, 2011
slide-3
SLIDE 3

SPEAKER INTRODUCTION

V8 Devtools Text

Anders Sandholm

Dart

Wednesday, November 23, 2011
slide-4
SLIDE 4

AGENDA

  • Motivation
  • Language
  • Samples
  • Tools
  • Open source project
Wednesday, November 23, 2011
slide-5
SLIDE 5

CURRENT WEB: THE GOOD PARTS

  • Developing small applications is easy
  • Platform independence
  • No installation of applications
  • Supports incremental development
  • ... and it is everywhere
Wednesday, November 23, 2011
slide-6
SLIDE 6

CURRENT WEB: THE BAD PARTS

  • Developing large scale applications is hard
  • Hard to find the program structure
  • Lack of static types
  • No support for libraries
  • Tools support is weak
  • Startup performance is bad
Wednesday, November 23, 2011
slide-7
SLIDE 7

WHAT ARE THE GOALS FOR DART?

  • Real support for programming in the large
  • Ultra-fast startup
  • Predictable performance
  • Incremental execution
  • Backwards compatibility
Wednesday, November 23, 2011
slide-8
SLIDE 8

THE DART PROGRAMMING LANGUAGE

A simple and unsurprising OO programming language

  • Class-based single inheritance
  • Interfaces with default implementation
  • Optional static types
  • Real lexical scoping
  • Single-threaded
Wednesday, November 23, 2011
slide-9
SLIDE 9

LET’S TRY SOME DART CODE

  • Fun with classes, closures, and optional types
  • Easy to experiment with at try.dartlang.org
Wednesday, November 23, 2011
slide-10
SLIDE 10

A DIFFERENT TYPE-CHECKER

  • A conventional type-checker is a simplified theorem prover
  • Tries to prove programs obey type system
  • If it can't construct a proof - program is considered invalid

“Guilty until proven innocent”

  • In Dart, you are innocent until proven guilty
Wednesday, November 23, 2011
slide-11
SLIDE 11

OPTIONAL STATIC TYPES

  • Static types convey the intent of the programmer
  • Checkable documentation for code and interfaces
  • Avoids awkward variable naming schemes
  • Type annotations have no effect on the runtime semantics...
Wednesday, November 23, 2011
slide-12
SLIDE 12

TYPES ON THE DARTBOARD

  • Let’s explore a few illustrative examples
Wednesday, November 23, 2011
slide-13
SLIDE 13

ISOLATES

  • Lightweight units of execution
  • Runs in their own address space like processes
  • Nothing is shared - nothing needs synchronization
  • All communication takes place via message passing
  • Supports concurrent execution
Wednesday, November 23, 2011
slide-14
SLIDE 14

SENDING AND RECEIVING MESSAGES

Wednesday, November 23, 2011
slide-15
SLIDE 15

PORTS

  • Receive ports accept and enqueue incoming messages
  • Live inside a specific isolate
  • Can be created on demand
  • A send port allows sending to a certain receive port
  • It is an unforgeable, transferrable capability
Wednesday, November 23, 2011
slide-16
SLIDE 16

BACKWARDS COMPATIBILITY

  • Breaking the web is not an option
  • Translation strategy to JavaScript is crucial
  • Performance when translated must be comparable
Wednesday, November 23, 2011
slide-17
SLIDE 17

DART EXECUTION

Dart Source

JavaScript Engine Dart VM

Tools Snapshot

Text DartC

Wednesday, November 23, 2011
slide-18
SLIDE 18

BACKWARDS COMPATIBILITY IMPACT

  • No non-local-return
  • Threading not possible
  • Number hierarchy

num integer double

Wednesday, November 23, 2011
slide-19
SLIDE 19

PROGRAMMING IN THE LARGE

  • Flexible development modes
  • Static type checking
  • Runtime type validation
  • Declared application and libraries
  • Isolates, actor-like concurrency model
Wednesday, November 23, 2011
slide-20
SLIDE 20

DART PERFORMANCE

Relative performance compared to JavaScript on V8 Benchmark VM Dart->JS Compiler Mandelbrot 18.1% 101.0% DeltaBlue 60.5% 85.0% Richards 49.9% 79.9% NBody 37.5% 83.2% BinaryTrees 70.3% 99.9% Fannkuch 58.4% 78.9% Meteor 48.2% 99.4% Details:

  • V8 revision 3.5.5.
  • Dart revision 1331
Wednesday, November 23, 2011
slide-21
SLIDE 21

WEB APPLICATION IN DART

  • Newsreader completely written in Dart
  • App code: 3210 LOC
  • UI library code: 13200 LOC
  • Animation yields 30 fps
  • Code is part of the open source project
Wednesday, November 23, 2011
slide-22
SLIDE 22

DART EDITOR

  • Editor for constructing and browsing Dart applications
  • Lightweight editor based on Eclipse components
  • Code is part of the open source project
Wednesday, November 23, 2011
slide-23
SLIDE 23

DART OPEN SOURCE PROJECT

  • The Dart web site: http://dartlang.org
  • Dart language specification
  • Dart language tutorial
  • The Dart project: http://dart.googlecode.com
  • Libraries and code samples
  • Dart virtual machine
  • Dart to JavaScript compiler
Wednesday, November 23, 2011
slide-24
SLIDE 24

CREDIT

  • Object model inspired by Smalltalk
  • Compilation strategy inspired by Self
  • Optional types inspired by Strongtalk
  • Isolates design inspired by Erlang
  • Syntax inspired by JavaScript & C
Wednesday, November 23, 2011
slide-25
SLIDE 25

DART SUMMARY

  • Technology preview
  • A programming language for the web
  • Simple and clean execution model
  • Designed with compatibility in mind
  • Open source project
Wednesday, November 23, 2011
slide-26
SLIDE 26

Q & A

Wednesday, November 23, 2011