Dart in Action
Dart in Action
Who am I
Technical Lead for Dart Editor at Google Former CTO at Instantiations Co-author of Eclipse Plug-ins and Eclipse GEF
Overview
Motivation Language Tools Performance Demo
Special thanks to Seth Ladd, Florian Loitsch, Gilad Bracha, Steve Messick, Brian Wilkerson, Alan Knight, and Eric Clayberg, for slides and ideas
Web Programming
Small apps are easy Platform independent No installation Platform improving fast Everywhere... and getting more modern
~50% of users on IE9/FF7/Chrome/Safari
Our goal... Help app developers write complex, high fidelity client apps for the modern web
Dart is ...
Structured Web Programming New language New tools New libraries Open source as of early October 2011 Available at http://dartlang.org
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); } class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Libraries
class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Functions
class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Classes
class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Methods
class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Optional Types
class Hello { void doStuff() { var message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Hello World
#import('dart:html'); void main() { new Hello().doStuff(); }
Optional Types
class Hello { void doStuff() { String message = "Hello World"; document.query('#status').innerHTML = message; } }
more at http://dartlang.org/language-tour/
Types At Runtime
Developers may check types at runtime... Tx=o assert(o === null || o is T)
Isolates
Inspired by Erlang Lightweight units of execution
Each isolate conceptually a process Nothing shared All communication via message passing
Isolate 1
send port
Isolate 1
Isolates
Can be ...
Lightweight on UI thread Heavyweight on their own thread
Uses ...
Isolate 3rd party code JavaScript interop Client / Server communication
Dart Board
http://www.dartlang.org/
Dart Board
Select template
Dart Board
Type stuff
Dart Board
Run program
Tools
Dart Source
Tools
JavaScript
Snapshot
VM
Tools
Dart Source
Dart Editor
Tools
JavaScript
Snapshot
VM
Minimalist UI
Make it easy to understand Reduce decision making
Start-up Performance
Remove unused plugins
Modify plugins to remove dependencies
Defer work until after UI appears Early startup extension point Display.asyncExec(...) Optimize load order Record class load order Reorder classes in plugin jar files
Application Performance
Profile and optimize the code
Identify hotspots with VM profiler Rewrite or eliminate slow code
Metrics
First RCP build 65 MB 170 plugins 20s startup Current build 37 MB 69 plugins 4s startup
Getting Involved
https://dartlang.org
Introduction, language spec, articles Download Dart Editor
https://code.google.com/p/dart/
Source code to editor, compiler, and virtual machine See the wiki for instructions