anders sandholm
play

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


  1. Anders Sandholm Wednesday, November 23, 2011

  2. DART: A STRUCTURED WEB PROGRAMMING LANGUAGE • Public preview Oct 10 • A programming language • Programming tools • Open source project Wednesday, November 23, 2011

  3. SPEAKER INTRODUCTION Anders Sandholm V8 Text Devtools Dart Wednesday, November 23, 2011

  4. AGENDA • Motivation • Language • Samples • Tools • Open source project Wednesday, November 23, 2011

  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

  6. CURRENT WEB: THE BAD PARTS • Developing large scale applications is hard • Hard to fi nd the program structure • Lack of static types • No support for libraries • Tools support is weak • Startup performance is bad Wednesday, November 23, 2011

  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

  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

  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

  10. A DIFFERENT TYPE-CHECKER • A conventional type-checker is a simpli fi ed 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

  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 e ff ect on the runtime semantics... Wednesday, November 23, 2011

  12. TYPES ON THE DARTBOARD • Let’s explore a few illustrative examples Wednesday, November 23, 2011

  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

  14. SENDING AND RECEIVING MESSAGES Wednesday, November 23, 2011

  15. PORTS • Receive ports accept and enqueue incoming messages • Live inside a speci fi c 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

  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

  17. DART EXECUTION Dart Source Tools DartC Text JavaScript Snapshot Dart VM Engine Wednesday, November 23, 2011

  18. BACKWARDS COMPATIBILITY IMPACT • No non-local-return • Threading not possible • Number hierarchy num integer double Wednesday, November 23, 2011

  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

  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

  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

  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

  23. DART OPEN SOURCE PROJECT • The Dart web site: http://dartlang.org • Dart language speci fi cation • 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

  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

  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

  26. Q & A Wednesday, November 23, 2011

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend