daniel rubel - writing dart applications
TRANSCRIPT
![Page 1: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/1.jpg)
Dan RubelEric Clayberg
![Page 2: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/2.jpg)
Overview
● Dart Project● Dart Language● Client-side Dart● Server-side Dart● Developing Dart Editor● Questions
http://www.dartlang.org
![Page 3: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/3.jpg)
Project
http://www.dartlang.org
![Page 4: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/4.jpg)
Web Apps
● The web is everywhere● Developing small apps is easy● No installation required● Supports incremental development● Open platform
... but we need to innovate● Productivity● Scalability● Speed
http://www.dartlang.org
![Page 5: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/5.jpg)
Why?
What is wrong with JavaScript?● Lack of structure● Very difficult to find dependencies● All numbers are floats● Monkey patching● Keep on truckin' mentality● Libraries are files you concatenate
... which makes it ...● Difficult to optimize performance● Difficult to maintain large code bases● Difficult to assert correctness
http://www.dartlang.org
![Page 6: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/6.jpg)
Goal
“Dart helps developers from all platforms build complex, high performance client apps for the modern web.”
VM Speed Scale
x2 x10
10-100 100k's
![Page 7: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/7.jpg)
Dart is open source
● BSD-style license● dart.googlecode.com● GitHub mirror● Contributing guide
What is Dart?
http://www.dartlang.org
![Page 8: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/8.jpg)
Dart modern web
What is Dart?
![Page 9: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/9.jpg)
● Rich client apps● Server apps● Offline-capable● 60fps● ES5+● HTML5
What is Dart?
http://www.dartlang.org
![Page 10: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/10.jpg)
LanguageLibraries ( )EditorVirtual machineCompiler to JavaScriptBrowser integrationPackage managerWeb Components integrationCommunity
What is Dart?"Batteries Included"
http://www.dartlang.org
core, math, html, isolate, io, json, uri, utf, crypto, ...
![Page 11: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/11.jpg)
Language
http://www.dartlang.org
![Page 12: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/12.jpg)
Language Goals
● Unsurprising simple and familiar● Class-based single inheritance● Proper lexical scoping● Single-threaded with isolates● Optional static types
Dart = Syntax
JavaScriptObjects
SmalltalkIsolatesErlang
TypesStrongtalk
ConceptsC#
http://www.dartlang.org
![Page 13: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/13.jpg)
Optional Static Types
Static types ...● Communicate developer intent● Used by tools to assert program correct ● Not used at runtime unless specified
You can mix typed and untyped code ...var p = new Point(2, 3);int x = 4;print (p + new Point(x, 5));
http://www.dartlang.org
![Page 14: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/14.jpg)
Implicit Interfaces
class Printer { void print(String message) { // print the message }}
class MockPrinter implements Printer { void print(String message) { // validate method was called }}
Mock for testing
http://www.dartlang.org
![Page 15: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/15.jpg)
Mixinsclass PrettyPrinter extends ASTTool with Counter{ ...}
class Counter {int count = 0;int get increment ==> ++count;int get decrement => --count;
}
... available early 2013
http://www.dartlang.org
![Page 16: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/16.jpg)
Isolates
● Inspired by Erlang
● Lightweight units of execution○ Each isolate conceptually a process
○ Nothing shared
○ All communication via message passing
● Support concurrent execution
Isolate 1spawn()
send port receive port
messages Isolate 2
![Page 17: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/17.jpg)
Client-side
http://www.dartlang.org
![Page 18: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/18.jpg)
Hello World
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
http://www.dartlang.org
![Page 19: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/19.jpg)
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Libraries
http://www.dartlang.org
![Page 20: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/20.jpg)
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Functions
http://www.dartlang.org
![Page 21: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/21.jpg)
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Classes
http://www.dartlang.org
![Page 22: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/22.jpg)
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Methods
http://www.dartlang.org
![Page 23: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/23.jpg)
class Hello { void welcome(String name) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Optional Parameters
http://www.dartlang.org
![Page 24: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/24.jpg)
class Hello { void welcome([String name = "Bob"]) { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Optional Parameters
http://www.dartlang.org
![Page 25: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/25.jpg)
class Hello { void welcome([String name = "Bob") { var message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
Hello Worldimport 'dart:html';
void main() { new Hello().welcome("World");}
Optional Types
http://www.dartlang.org
![Page 26: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/26.jpg)
class Hello { void welcome([String name = "Bob") { String message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
import 'dart:html';
void main() { new Hello().welcome("World");}
Hello World
Optional Types
http://www.dartlang.org
![Page 27: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/27.jpg)
class Hello { void welcome([String name = "Bob") { String message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
Hello Worldimport 'dart:html';
void main() { new Hello().welcome("World");}
String Interpolation
http://www.dartlang.org
![Page 28: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/28.jpg)
class Hello { void welcome([String name = "Bob") { String message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
Hello Worldimport 'dart:html';
void main() { new Hello().welcome("World");}
Cascades
http://www.dartlang.org
![Page 29: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/29.jpg)
class Hello { void welcome([String name = "Bob") { String message = "Hello $name"; document.query('#status') ..text = message ..on.click.add(handler); }}
Hello Worldimport 'dart:html';
void main() { new Hello().welcome("World");}
Simple DOM API
http://www.dartlang.org
![Page 30: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/30.jpg)
ToolsDart Source
Snapshot
Tools
JavaScript VMVM
client & serverclient
![Page 31: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/31.jpg)
Dart Editor
ToolsDart Source
Snapshot
Tools
VMJavaScript
client client & server
![Page 32: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/32.jpg)
Dart EditorWelcome Page
![Page 33: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/33.jpg)
Dart EditorWelcome Page
![Page 34: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/34.jpg)
Dart EditorCreate application
![Page 35: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/35.jpg)
Dart EditorLoad Sample Code
![Page 36: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/36.jpg)
Dart EditorMore Information
![Page 37: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/37.jpg)
Dart EditorDart SDK
![Page 38: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/38.jpg)
Dart EditorDart SDK Libraries
![Page 39: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/39.jpg)
Dart EditorLoad Solar 3D Sample
![Page 40: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/40.jpg)
Dart EditorSolar 3D Sample
![Page 41: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/41.jpg)
Solar 3D● Dartium● JavaScript● Debugging
Source dart2js
Demo
![Page 42: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/42.jpg)
HTML + Dart
<html> <body> <script type="application/dart" src="solar.dart"/> <script type=".../dart.js"/>
dart2js
dart.js
if Dart VMdo nothing
solar.dart
DartApplication
solar.dart.js
JavaScriptApplication
Dartium
![Page 43: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/43.jpg)
HTML + Dart
<html> <body> <script type="application/dart" src="solar.dart.js"/> <script type=".../dart.js"/>
dart2js
dart.js
if no Dart VMrewrite DOM
solar.dart
DartApplication
solar.dart.js
JavaScriptApplication
Others
![Page 44: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/44.jpg)
dart2js
Converts Dart source to JavaScript● Targets ES5+ (modern browsers)● Tree shaking and dead code elimination● Written in Dart
In progress:● Smaller JavaScript output● Performance improvements
http://www.dartlang.org
![Page 45: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/45.jpg)
Pub - package manager
Declaration● pubspec.yaml defines the package
Operations● pub install installs dependencies● pub update updates dependencies
See packages on http://pub.dartlang.org
http://www.dartlang.org
![Page 46: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/46.jpg)
Pub - pubspec.yaml
name: my_appdescription: some applicationversion: 1.2.7author: Bob <[email protected]>homepage: http://www.smith.org/...dependencies:
one_package: anyanother_package: "1.2.1"web_components: ">=0.2.8+4 <0.2.9"
http://www.dartlang.org
![Page 47: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/47.jpg)
Pub - layout my_app/package declaration pubspec.yaml README.md
bin/ start_my_app
lib/ public_stuff.dart
src/ internal_stuff.dart
test/ my_app_test.dart
web/ index.html main.dart style.css
http://www.dartlang.org
![Page 48: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/48.jpg)
Pub - layout my_app/
pubspec.yaml README.mdserver side code bin/ start_my_app
lib/ public_stuff.dart
src/ internal_stuff.dart
test/ my_app_test.dartclient side code and resources web/ index.html main.dart style.css
http://www.dartlang.org
![Page 49: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/49.jpg)
Pub - layout my_app/
pubspec.yaml README.md
bin/ start_my_apppublic code lib/ public_stuff.dartimplementation details src/ internal_stuff.dart
test/ my_app_test.dart
web/ index.html main.dart style.css
http://www.dartlang.org
![Page 50: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/50.jpg)
Pub - layout my_app/
pubspec.yaml README.md
bin/ start_my_app
lib/ public_stuff.dart
src/ internal_stuff.darttests test/ my_app_test.dart
web/ index.html main.dart style.css
http://www.dartlang.org
![Page 51: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/51.jpg)
Server-side
http://www.dartlang.org
![Page 52: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/52.jpg)
Dart on the server
● File system● Sockets● HTTP server and client● Web sockets server and client● Async or Future style● Share code on client and server
http://www.dartlang.org
![Page 53: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/53.jpg)
Dart on the serverTime Server Sample
![Page 54: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/54.jpg)
Dart on the serverTime Server Sample
![Page 55: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/55.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Create server
http://www.dartlang.org
![Page 56: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/56.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Add multiple handlers
http://www.dartlang.org
![Page 57: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/57.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Matcher
http://www.dartlang.org
![Page 58: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/58.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Handler
http://www.dartlang.org
![Page 59: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/59.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Start handling requests
http://www.dartlang.org
![Page 60: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/60.jpg)
Dart on the server
void main() { HttpServer server = new HttpServer(); server ..addRequestHandler((HttpRequest request) => true, handler) ..listen(HOST, PORT); print("Serving the current time on http://${HOST}:${PORT}.");}void handler(HttpRequest request, HttpResponse response) { // process request ... send response}
Process requests
http://www.dartlang.org
![Page 61: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/61.jpg)
Developing Dart Editor
http://www.dartlang.org
![Page 62: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/62.jpg)
Dart Editor - Users
● Web programmers of varying backgrounds○ Many languages - HTML, JS, Python, Java○ Wide range of programming experience
● Primarily not Eclipse users
http://www.dartlang.org
![Page 63: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/63.jpg)
Dart Editor - Goals
● Easy on-ramp to learn Dart● Simplified UI
but also...
● Power tools○ refactoring○ quick fixes/assists○ code completion○ semantic search○ ...and more
http://www.dartlang.org
![Page 64: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/64.jpg)
Dart Editor - Before
Where is Dart ???
![Page 65: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/65.jpg)
Dart Editor - Strategy
● Narrow the scope○ Focus on doing a few things well
● Minimalist UI○ Make it easy to understand○ Reduce decision making
http://www.dartlang.org
![Page 66: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/66.jpg)
Dart Editor - Now
Simple and Clean UI
![Page 67: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/67.jpg)
How?
● Single perspective
● Remove unnecessary plugins
● Redefine entire menu bar
● Use "activities" to suppress UI elements
● Key binding schema
http://www.dartlang.org
![Page 68: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/68.jpg)
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
http://www.dartlang.org
![Page 69: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/69.jpg)
Application Performance
● Profile and optimize the code○ Identify hotspots with VM profiler
○ Rewrite or eliminate slow code
● Defer work to background tasks
http://www.dartlang.org
![Page 70: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/70.jpg)
Performance-critical Areas
● Background indexing
● Code completion - how to make it fast
● Compilation time via incremental compilation
http://www.dartlang.org
![Page 71: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/71.jpg)
Metrics
First RCP build 65 MB170 plugins20s startup
Current build39 MB75 plugins5s startup
http://www.dartlang.org
![Page 72: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/72.jpg)
Books
http://www.dartlang.org
![Page 73: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/73.jpg)
Questions?
More information....
https://dartlang.orgIntroduction, language spec, articlesDownload Dart Editor
https://code.google.com/p/dart/Source code to editor, compiler, and virtual machineSee the wiki for instructions
![Page 74: Daniel Rubel - Writing Dart Applications](https://reader030.vdocument.in/reader030/viewer/2022020703/61fb3f572e268c58cd5be8f3/html5/thumbnails/74.jpg)
Community
● G+: google.com/+dartlang● Mailing list: [email protected]● Stack Overflow: Tag dart● Twitter: @dart_lang● Hashtag: #dartlang● Blogs: http://dartosphere.org● IRC: #dart
http://www.dartlang.org