OLD | NEW |
---|---|
1 --- | 1 --- |
2 layout: default | 2 layout: default |
3 title: "Technical Overview" | 3 title: "Technical Overview" |
4 --- | 4 --- |
5 <h1>Technical Overview </h1> | 5 <h1>Technical Overview </h1> |
6 | 6 |
7 <section> | 7 <section> |
8 <p> | 8 <p> |
9 Dart is a new class-based programming language | 9 Dart is a class-based programming language |
sethladd
2012/11/01 05:23:52
How about:
"Dart helps developers scale from smal
Kathy Walrath
2012/12/12 22:49:04
Done. (But not exactly what you said. Please take
| |
10 for creating structured web applications. | 10 for creating structured web applications. |
11 Developed with the goals of simplicity, efficiency, and scalability, | 11 Developed with the goals of simplicity, efficiency, and scalability, |
12 the Dart language combines powerful new language features | 12 the Dart language combines powerful new language features |
13 with familiar language constructs into a clear, readable syntax. | 13 with familiar language constructs into a clear, readable syntax. |
14 </p> | 14 </p> |
15 | 15 |
16 <aside> | 16 <aside> |
17 <div class="alert alert-info"> | 17 <div class="alert alert-info"> |
18 <strong>Note:</strong> | 18 <strong>Note:</strong> |
19 This document is part of an early preview of | 19 The M1 release (October 2012) |
20 the Dart language and programming environment. | 20 established a stable basis for the Dart language. |
21 Some elements are missing from the current release, | 21 The language will continue to change, |
22 and the details are subject to change based on the feedback we receive. | 22 but we expect the changes to be backward compatible. |
23 The Dart libraries, on the other hand, | |
24 are not yet stable. | |
23 </div> | 25 </div> |
24 </aside> | 26 </aside> |
25 | 27 |
26 <h4> Contents </h4> | 28 <h4> Contents </h4> |
27 | 29 |
28 <ol class="toc"> | 30 <ol class="toc"> |
29 <li> <a href="#key">Key features</a> </li> | 31 <li> <a href="#key">Key features</a> </li> |
30 <li> <a href="#goals">Design goals</a> </li> | 32 <li> <a href="#goals">Design goals</a> </li> |
31 <li> <a href="#code">Show me the code </a> | 33 <li> <a href="#code">Show me the code</a> |
32 <ol> | 34 <ol> |
33 <li> <a href="#classes">Classes and interfaces </a> </li> | 35 <li> <a href="#classes">Classes </a></li> |
34 <li> <a href="#optional-types">Optional types </a> </li> | 36 <li> <a href="#optional-types">Optional types</a> </li> |
37 <li> <a href="#browser">Web apps</a> </li> | |
35 </ol> | 38 </ol> |
36 </li> | 39 </li> |
37 <li> <a href="#howtouse">How can I use Dart? </a> | 40 <li> <a href="#tools">Tools</a> |
38 <ol> | 41 <li> <a href="#libraries">Libraries</a> </li> |
39 <li> <a href="#editor">Dart Editor</a> </li> | 42 <li> <a href="#involved">Get involved</a> </li> |
40 <li> <a href="#mimetype">New MIME type </a> </li> | |
41 </ol> | |
42 </li> | |
43 <li> <a href="#tools">Tools </a> </li> | |
44 <li> <a href="#libraries">Libraries </a> </li> | |
45 <li> <a href="#involved">Get involved </a> </li> | |
46 </ol> | 43 </ol> |
47 </section> | 44 </section> |
48 | 45 |
49 | 46 |
50 <section id="key"> | 47 <section id="key"> |
51 <h2> Key features </h2> | 48 <h2> Key features </h2> |
sethladd
2012/11/01 05:23:52
Maybe "Key features of the language" which then le
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
52 | 49 |
53 <p> | 50 <p> |
54 Key features of the Dart language include: | 51 Key features of the Dart language include |
52 classes, optional types, libraries, and tooling. | |
sethladd
2012/11/01 05:23:52
I'd also include isolates as being key.
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
55 </p> | 53 </p> |
56 | 54 |
sethladd
2012/11/01 05:23:52
Maybe a note about "even though Dart is familiar,
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
57 | 55 |
58 <h3>Classes</h3> | 56 <h3>Classes</h3> |
59 <p> | 57 <p> |
60 Classes and interfaces provide a well understood mechanism | 58 Classes provide a well understood mechanism |
61 for efficiently defining APIs. | 59 for efficiently defining APIs. |
62 These constructs enable encapsulation and reuse of methods and data. | 60 Each class implicitly defines an interface. |
61 Together, classes and interfaces | |
62 enable encapsulation and reuse of methods and data. | |
63 </p> | 63 </p> |
64 | 64 |
65 <h3>Optional types</h3> | 65 <h3>Optional types</h3> |
66 <p> | 66 <p> |
67 Dart programmers can optionally add static types to their code. | 67 Code can have static types. |
sethladd
2012/11/01 05:23:52
Almost too "matter of fact". Can you talk about sc
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
68 Depending on programmer preference and stage of application development, | 68 Depending on programmer preference and stage of application development, |
69 the code can migrate from a simple, untyped experimental prototype | 69 the code can migrate from a simple, untyped experimental prototype |
70 to a complex, modular application with typing. | 70 to a complex, modular application with typing. |
71 Because types state programmer intent, | 71 Because types state programmer intent, |
72 less documentation is required to explain what is happening in the code, | 72 less documentation is required to explain what is happening in the code, |
73 and type-checking tools can be used for debugging. | 73 and tools can give more help for writing and debugging code. |
74 </p> | 74 </p> |
75 | 75 |
76 <h3>Libraries</h3> | 76 <h3>Libraries</h3> |
77 <p> | 77 <p> |
78 Developers can create and use libraries | 78 Developers can create and use libraries |
79 that are guaranteed not to change during runtime. | 79 that are guaranteed not to change during runtime. |
80 Independently developed pieces of code can therefore | 80 Independently developed pieces of code can therefore |
81 rely on shared libraries. | 81 rely on shared libraries. |
82 </p> | 82 </p> |
83 | 83 |
84 <h3>Tooling</h3> | 84 <h3>Tooling</h3> |
85 <p> | 85 <p> |
86 Dart will include a rich set of | 86 Dart includes a rich set of |
87 execution environments, libraries, and development tools | 87 execution environments, libraries, and development tools |
88 built to support the language. | 88 built to support the language. |
89 These tools will enable productive and dynamic development, | 89 These tools enable productive and dynamic development, |
90 including edit-and-continue debugging and beyond—up | 90 including edit-and-continue debugging and beyond—up |
91 to a style where you program an application outline, run it, | 91 to a style where you program an application outline, run it, |
92 and fill in the blanks as you run. | 92 and fill in the blanks as you run. |
93 </p> | 93 </p> |
94 </section> | 94 </section> |
95 | 95 |
96 | 96 |
97 <section id="goals"> | 97 <section id="goals"> |
98 <h2> Design goals </h2> | 98 <h2> Design goals </h2> |
99 | 99 |
100 <p> | 100 <p> |
101 The Dart programming language is presented here in its early stages. | 101 The following design goals guide |
102 The following design goals will guide | |
103 the continued evolution and refinement of this open source project: | 102 the continued evolution and refinement of this open source project: |
104 </p> | 103 </p> |
105 | 104 |
106 <ul> | 105 <ul> |
107 <li>Create a <b>structured yet flexible</b> | 106 <li>Create a <b>structured yet flexible</b> |
108 programming language for the web.</li> | 107 programming language for the web.</li> |
109 <li>Make Dart feel <b>familiar and natural</b> to programmers | 108 <li>Make Dart feel <b>familiar and natural</b> to programmers |
110 and thus easy to learn.</li> | 109 and thus easy to learn.</li> |
111 <li>Ensure that all Dart language constructs allow | 110 <li>Ensure that all Dart language constructs allow |
112 <b>high performance</b> and | 111 <b>high performance</b> and |
(...skipping 11 matching lines...) Expand all Loading... | |
124 </p> | 123 </p> |
125 | 124 |
126 <ul> | 125 <ul> |
127 <li>Small scripts often evolve into | 126 <li>Small scripts often evolve into |
128 large web applications with no apparent structure—they’re | 127 large web applications with no apparent structure—they’re |
129 hard to debug and difficult to maintain. | 128 hard to debug and difficult to maintain. |
130 In addition, these monolithic apps can’t be split up | 129 In addition, these monolithic apps can’t be split up |
131 so that different teams can work on them independently. | 130 so that different teams can work on them independently. |
132 It’s difficult to be productive | 131 It’s difficult to be productive |
133 when a web application gets large.</li> | 132 when a web application gets large.</li> |
134 <li>Scripting languages are popular | 133 <li> |
135 because their lightweight nature makes it easy to write code quickly. | 134 In scripting languages, the contracts with other parts of an application |
136 Generally, the contracts with other parts of an application | 135 are usually conveyed in comments rather than in the language structure its elf. |
137 are conveyed in comments rather than in the language structure itself. | 136 As a result, it can be difficult for someone other than the author |
138 As a result, it’s difficult for someone other than the author | |
139 to read and maintain a particular piece of code.</li> | 137 to read and maintain a particular piece of code.</li> |
140 <li>With existing languages, | 138 <li>Before Dart, |
141 the developer is forced to make a choice between | 139 the developer was forced to make a choice between |
142 static and dynamic languages. | 140 static and dynamic languages. |
143 Traditional static languages require heavyweight toolchains | 141 Traditional static languages require heavyweight toolchains |
144 and a coding style that can feel inflexible and overly constrained.</li> | 142 and a coding style that can feel inflexible and overly constrained.</li> |
145 <li>Developers have not been able to create homogeneous systems | 143 <li>Developers have not been able to create homogeneous systems |
146 that encompass both client and server, | 144 that encompass both client and server, |
147 except for a few cases such as Node.js and Google Web Toolkit (GWT). | 145 except for a few cases such as Node.js and Google Web Toolkit (GWT). |
148 </li> | 146 </li> |
149 <li>Different languages and formats entail context switches | 147 <li>Different languages and formats entail context switches |
150 that are cumbersome and add complexity to the coding process.</li> | 148 that are cumbersome and add complexity to the coding process.</li> |
151 </ul> | 149 </ul> |
152 </section> | 150 </section> |
153 | 151 |
154 | 152 |
155 <section id="code"> | 153 <section id="code"> |
156 <h2>Show me the code</h2> | 154 <h2>Show me the code</h2> |
157 | 155 |
158 <p> | 156 <p> |
159 Here are several code snippets | 157 Here are some code snippets |
160 to give you a feel for what Dart code looks like. | 158 to give you a feel for what Dart code looks like. |
161 </p> | 159 </p> |
162 | 160 |
163 <section id="classes"> | 161 <section id="classes"> |
164 <h3>Classes and interfaces</h3> | 162 <h3>Classes</h3> |
165 | 163 |
166 <p> | 164 <p> |
167 Dart’s interfaces and classes provide you with | 165 Dart’s classes provide |
168 a set of reusable and extensible building blocks. | 166 a set of reusable and extensible building blocks. |
169 An <em>interface</em> defines a basic set of methods and constants, | 167 A <em>class</em> defines methods and data |
170 sometimes by inheriting from other interfaces. | 168 and can provide method implementations. |
171 A <em>class</em> can implement multiple interfaces, | 169 Every <em>object</em> is an instance of a class. |
172 but it only inherits from a single superclass. | 170 An <em>abstract class</em> can't be instantiated, |
171 and it might not implement the methods it defines. | |
173 </p> | 172 </p> |
174 | 173 |
175 <p> | 174 <p> |
176 The following example defines an interface, | 175 Each class implicitly defines an interface. |
177 along with a class and subclass that implement it: | 176 A class can implement multiple interfaces, |
177 but it only <em>extends</em>—inherits implementation from—a | |
178 single superclass. | |
179 </p> | |
180 | |
181 <p> | |
182 The following example defines an abstract class, | |
183 along with a class and subclass that implement its interface: | |
178 </p> | 184 </p> |
179 | 185 |
180 {% highlight dart %} | 186 {% highlight dart %} |
181 interface Shape { | 187 abstract class Shape { |
182 num perimeter(); | 188 num perimeter(); |
183 } | 189 } |
184 | 190 |
185 class Rectangle implements Shape { | 191 class Rectangle implements Shape { |
186 final num height, width; | 192 final num height, width; |
187 Rectangle(num this.height, num this.width); // Compact constructor syntax. | 193 Rectangle(this.height, this.width); // Compact constructor syntax. |
188 num perimeter() => 2*height + 2*width; // Short function syntax. | 194 num perimeter() => 2*height + 2*width; // Short function syntax. |
189 } | 195 } |
190 | 196 |
191 class Square extends Rectangle { | 197 class Square extends Rectangle { |
192 Square(num size) : super(size, size); | 198 Square(num size) : super(size, size); |
193 } | 199 } |
194 {% endhighlight %} | 200 {% endhighlight %} |
195 | 201 |
196 </section> <!-- classes --> | 202 </section> <!-- classes --> |
197 | 203 |
198 | 204 |
199 <section id="optional-types"> | 205 <section id="optional-types"> |
200 <h3>Optional types</h3> | 206 <h3>Optional types</h3> |
201 | 207 |
202 <p> | 208 <p> |
203 Dart provides, at the programmer’s option, | 209 Dart provides, at the programmer’s option, |
204 a mixture of static and dynamic checking. | 210 a mixture of static and dynamic checking. |
205 When experimenting, | 211 When experimenting, |
206 the programmer can write untyped code for simple prototyping. | 212 the programmer can write untyped code for simple prototyping. |
207 As the application becomes larger and more stable, | 213 As the application becomes larger and more stable, |
208 types can be added to aid debugging and impose structure where desired. | 214 types can be added to aid debugging and impose structure. |
209 </p> | 215 </p> |
210 | 216 |
211 <p> | 217 <p> |
212 For example, here is a sample of untyped code in Dart | 218 For example, here is a sample of untyped code in Dart |
213 that creates a new Point class that has parameters | 219 that creates a new Point class that has two instance variables |
214 <code>x</code> and <code>y</code> | 220 (<code>x</code> and <code>y</code>) |
215 and two methods: | 221 and two methods |
216 <code>scale()</code> and <code>distance()</code>. | 222 (<code>scale()</code> and <code>distance()</code>). |
217 </p> | 223 </p> |
218 | 224 |
219 {% highlight dart %} | 225 {% highlight dart %} |
220 #import('dart:math'); | 226 import 'dart:math'; |
221 | 227 |
222 class Point { | 228 class Point { |
223 var x, y; | 229 var x, y; |
224 Point(this.x, this.y); | 230 Point(this.x, this.y); |
225 scale(factor) => new Point(x*factor, y*factor); | 231 scale(factor) => new Point(x*factor, y*factor); |
226 distance() => sqrt(x*x + y*y); | 232 distance() => sqrt(x*x + y*y); |
227 } | 233 } |
228 | 234 |
229 main() { | 235 main() { |
230 var a = new Point(2,3).scale(10); | 236 var a = new Point(2,3).scale(10); |
231 print(a.distance()); | 237 print(a.distance()); |
232 } | 238 } |
233 {% endhighlight %} | 239 {% endhighlight %} |
234 | 240 |
235 <p> | 241 <p> |
236 Here is what this code looks like with types added | 242 Here is what this code looks like with a few types added |
sethladd
2012/11/01 05:23:52
A more powerful example:
(before)
recalculate(or
Kathy Walrath
2012/12/12 22:49:04
Since we're showing complete code here... What wou
| |
237 that ensure that | 243 to make the API of Point clearer. |
238 <code>x</code>, <code>y</code>, and <code>factor</code> | 244 For example, this code specifies that |
239 are of type <code>num</code>, | 245 <code>x</code> and <code>y</code> |
240 and that a <code>Point</code> contains two values | 246 are of type <code>num</code>. |
241 of type <code>num</code>: | |
242 </p> | 247 </p> |
243 | 248 |
244 {% highlight dart %} | 249 {% highlight dart %} |
245 #import('dart:math'); | 250 import 'dart:math'; |
246 | 251 |
247 class Point { | 252 class Point { |
248 num x, y; | 253 num x, y; |
249 Point(num this.x, num this.y); | 254 Point(this.x, this.y); |
250 Point scale(num factor) => new Point(x*factor, y*factor); | 255 Point scale(num factor) => new Point(x*factor, y*factor); |
251 num distance() => sqrt(x*x + y*y); | 256 num distance() => sqrt(x*x + y*y); |
252 } | 257 } |
253 | 258 |
254 void main() { | 259 main() { |
255 Point a = new Point(2,3).scale(10); | 260 var a = new Point(2,3).scale(10); |
256 print(a.distance()); | 261 print(a.distance()); |
257 } | 262 } |
258 {% endhighlight %} | 263 {% endhighlight %} |
259 | 264 |
260 </section> <!-- optional types --> | 265 </section> <!-- optional types --> |
261 </section> <!-- code --> | |
262 | 266 |
263 <section id="howtouse"> | 267 <section id="browser"> |
264 <h2>How can I use Dart?</h2> | 268 <h3>Web apps</h3> |
265 | 269 |
266 <p> | 270 <p> |
267 You can run Dart code in several ways: | 271 With the new <code>application/dart</code> MIME type, |
268 </p> | 272 Dart code can run directly in browsers that have a Dart VM, |
269 | 273 including Dartium and eventually Chrome. |
270 <ul> | 274 For other modern browsers, |
sethladd
2012/11/01 05:23:52
Please lead with this point (JavaScript compilatio
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
271 <li> | 275 Dart can be compiled to JavaScript. |
272 <p> | 276 Here's an example of an HTML file that loads Dart code: |
273 Compile Dart code to JavaScript that can run in any modern browser:<br /> | |
274 Chrome, Safari 5+, and Firefox 4+ (more browser support coming shortly) | |
275 </p> | |
276 </li> | |
277 <li> | |
278 <p> | |
279 Execute Dart code directly in a VM on your computer | |
280 </p> | |
281 </li> | |
282 <li> | |
283 <p> | |
284 With a <a href="#mimetype">new MIME type</a>, | |
285 use Dart in a browser | |
286 without first compiling to JavaScript | |
287 </p> | |
288 </li> | |
289 </ul> | |
290 | |
291 <section id="editor"> | |
292 <h3>Dart Editor</h3> | |
293 | |
294 <p> | |
295 Dart Editor is a tool for | |
296 creating, modifying, and launching Dart web apps. | |
297 With one click, you can compile a Dart web app to JavaScript | |
298 and launch the app in a browser. | |
299 Taking advantage of Dart’s structured nature, | |
300 Dart Editor supports method name completion and refactoring. | |
301 </p> | |
302 | |
303 <p> | |
304 For information about downloading and using Dart Editor, see the | |
305 <a href="/docs/editor/getting-started/">Dart Editor tutorial</a>. | |
306 </p> | |
307 </section> | |
308 | |
309 <section id="mimetype"> | |
310 <h3>New MIME type</h3> | |
311 | |
312 <p> | |
313 You will be able to link to a Dart program directly from an HTML page. | |
314 Here is the proposed new MIME type, | |
315 “application/dart”: | |
316 </p> | 277 </p> |
317 | 278 |
318 {% highlight html %} | 279 {% highlight html %} |
319 <!DOCTYPE html> | 280 <!DOCTYPE html> |
320 | |
321 <html> | 281 <html> |
322 <head> | 282 <head> |
323 <title>Simple Dart Web App</title> | 283 <title>Simple Dart Web App</title> |
324 </head> | 284 </head> |
325 <body> | 285 <body> |
326 <h1>Simple Dart Web App</h1> | 286 <h1>Simple Dart Web App</h1> |
327 <h2 id="status">dart is starting up...</h2> | 287 <p id="changeme"></p> |
328 <script type="application/dart" src="SimpleDartWebApp.dart"></script> | 288 <script type="application/dart" src="app.dart"></script> |
329 <script src="http://dart.googlecode.com/svn/branches/bleeding_edge/dart/clie nt/dart.js"></script> | 289 <script src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/cli ent/dart.js"></script> |
330 </body> | 290 </body> |
331 </html> | 291 </html> |
332 {% endhighlight %} | 292 {% endhighlight %} |
333 | 293 |
334 <p> | 294 <p> |
335 The dart.js file above will swap out the <code>application/dart</code> | 295 The first <script> tag in this example |
336 tag with a <code>text/javascript</code> tag if the browser does not | 296 loads the code from app.dart. |
337 have an embedded Dart virtual machine. | 297 If the browser has an embedded Dart VM, |
298 then the browser loads Dart code. | |
299 Otherwise, the browser loads the code's JavaScript equivalent, | |
300 thanks to the dart.js script | |
301 in the second <script> tag. | |
338 </p> | 302 </p> |
339 | 303 |
340 <p> | 304 <p> |
341 The following is the Dart code for the page above: | 305 Here is the code in app.dart: |
342 </p> | 306 </p> |
343 | 307 |
344 {% highlight dart %} | 308 {% highlight dart %} |
345 #import('dart:html'); | 309 import 'dart:html'; |
346 | 310 |
347 class SimpleDartWebApp { | 311 main() { |
348 void run() { | 312 query('#changeme') |
349 write("Hello World!"); | 313 ..text = "Click me!" |
350 } | 314 ..on.click.add(respond); |
351 | |
352 void write(String message) { | |
353 // the HTML library defines a global "document" variable | |
354 document.query('#status').innerHTML = message; | |
355 } | |
356 } | 315 } |
357 | 316 |
358 void main() { | 317 respond(event) { |
359 new SimpleDartWebApp().run(); | 318 window.alert('Clicked!'); |
sethladd
2012/11/01 05:23:52
Instead of window.alert, let's use:
query("#msg")
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
360 } | 319 } |
361 {% endhighlight %} | 320 {% endhighlight %} |
362 </section> <!-- howtouse --> | 321 |
363 </section> <!-- mimetype --> | 322 <p> |
323 The main() function's call to query() | |
324 returns the HTML element that has the ID "changeme". | |
325 The code then uses the cascade operator (<code>..</code>) | |
326 to perform multiple operations on that element. | |
327 The first operation initializes | |
328 the element's <code>text</code> property, | |
329 and the second adds an event handler to the element. | |
330 </p> | |
331 | |
332 </section> <!-- browser --> | |
333 | |
334 </section> <!-- code --> | |
364 | 335 |
365 | 336 |
366 <section id="tools"> | 337 <section id="tools"> |
367 <h2>Tools</h2> | 338 <h2>Tools</h2> |
368 | 339 |
369 <p> | 340 <p> |
370 The Dart language is accompanied by a set of tools | 341 The Dart language is accompanied by a set of tools |
371 to aid rapid prototyping, coding, and debugging | 342 to aid rapid prototyping, coding, and debugging |
372 for the entire development cycle. | 343 for the entire development cycle. |
373 Offerings include: | 344 Offerings include: |
374 </p> | 345 </p> |
375 | 346 |
376 <ul> | 347 <ul> |
377 <li>The Dart Editor</li> | 348 <li><b>Dart Editor:</b> A Dart-savvy editor that supports creating, modifying, running, and debugging Dart apps</li> |
378 <li>The dart2js compiler</li> | 349 <li><b>pub:</b> A package manager that features libraries published on <a href ="http://pub.dartlang.org/">pub.dartlang.org</a></li> |
379 <li>The Dart VM</li> | 350 <li><b>dart2js:</b> The Dart-to-JavaScript compiler</li> |
380 <li>Dartium: Chromium with an embedded Dart VM</li> | 351 <li><b>dart:</b> The Dart VM</li> |
352 <li><b>Dartium:</b> Chromium with an embedded Dart VM</li> | |
381 </ul> | 353 </ul> |
382 | 354 |
383 <p> | 355 <p> |
384 On the client side, you can deploy Dart apps in two ways. | 356 On the client side, you can deploy Dart apps in two ways. |
385 For browsers without an embedded Dart VM, | 357 For browsers without an embedded Dart VM, |
386 you can compile the Dart code to JavaScript, | 358 you can compile the Dart code to JavaScript, |
387 using the dart2js compiler. This compiler generates ECMAScript5-compatible | 359 using the dart2js compiler. This compiler generates ECMAScript5-compatible |
388 JavaScript from the Dart code. Dart code can run | 360 JavaScript from the Dart code. |
389 directly in browsers that have a Dart VM, | 361 This JavaScript code works in Chrome, Safari 5+, and Firefox 4+ |
390 including Dartium (a special build of Chromium) | 362 (with more to come). |
391 and eventually Chrome. | 363 <b>{PENDING: is the browser list accurate? |
364 Do we want it here?}</b> | |
392 </p> | 365 </p> |
393 | 366 |
394 <p> | 367 <p> |
395 On the server side, the Dart code runs directly on the command line, | 368 On the server side, the Dart code runs directly on the command line, |
396 for fast iteration and for cloud-based tasks. | 369 for fast iteration and for cloud-based tasks. |
397 </p> | 370 </p> |
398 | 371 |
372 <p> | |
399 <img src="images/source-flow.png" | 373 <img src="images/source-flow.png" |
400 alt="Dart source -> Dart Editor; Dart Editor -> either [Dart VM] or [JavaSc ript source -> Browser (JavaScript Engine)]" | 374 alt="Dart source -> Dart Editor; Dart Editor -> either [Dart VM] or [JavaSc ript source -> Browser (JavaScript Engine)]" |
401 width="266" height="417" > | 375 width="266" height="417" > |
376 </p> | |
377 | |
378 | |
379 <section id="editor"> | |
380 | |
381 <p> | |
382 Running an app is easy—a single click—when you use Dart Editor. | |
383 For example, clicking the Run button while you're editing a web app | |
384 either runs it in Dartium | |
385 or compiles it to JavaScript | |
386 and launches it in the browser you've chosen. | |
387 </p> | |
388 | |
389 <p> | |
390 To get the tools and find more information, go to the | |
391 <a href="/downloads.html">downloads page</a>.</p> | |
392 </section> | |
393 | |
402 </section> | 394 </section> |
403 | 395 |
404 | 396 |
405 <section id="libraries"> | 397 <section id="libraries"> |
406 <h2>Libraries</h2> | 398 <h2>Libraries</h2> |
407 | 399 |
408 <p> | 400 <p> |
409 Dart provides the following libraries | 401 Dart provides several libraries |
sethladd
2012/11/01 05:23:52
we should also talk about unit tests, JSON, math,
Kathy Walrath
2012/12/12 22:49:04
Done.
| |
410 to support web and web server development: | 402 to support web and web server development, |
403 including: | |
411 </p> | 404 </p> |
412 | 405 |
413 <dl> | 406 <dl> |
414 <dt> <a href="http://api.dartlang.org/dart_core.html">Core Library</a> </dt> | 407 <dt> <a href="http://api.dartlang.org/dart_core.html">Core Library</a> </dt> |
415 <dd> Contains interfaces to support | 408 <dd> Common data structures and operations. |
416 common data structures and operations. | |
417 </dd> | 409 </dd> |
418 <dt> <a href="http://api.dartlang.org/html.html">HTML Library</a> </dt> | 410 <dt> <a href="http://api.dartlang.org/dart_html.html">HTML Library</a> </dt> |
419 <dd> Contains interfaces to the HTML5 DOM, | 411 <dd> The interface to the HTML5 DOM, |
420 loosely based on the proposed HTML5 standard | 412 loosely based on the proposed HTML5 standard |
421 as specified by the W3C/WHATWG. | 413 as specified by the W3C/WHATWG. |
422 These interfaces will evolve in parallel with | 414 This library is evolving in parallel with |
423 the HTML5 standards.</dd> | 415 the HTML5 standards.</dd> |
424 | 416 |
425 <dt> <a href="http://api.dartlang.org/io.html">I/O Library</a> </dt> | 417 <dt> <a href="http://api.dartlang.org/dart_io.html">I/O Library</a> </dt> |
426 <dd> Contains interfaces to read and write files, open directories, | 418 <dd> Server-side support for I/O: |
427 open network sockets, and run HTTP servers. This library is for | 419 read and write files, open directories, |
428 command-line Dart programs. | 420 open network sockets, and run HTTP servers. |
429 </dd> | 421 </dd> |
430 | 422 |
431 <dt> <a href="http://api.dartlang.org/dart_isolate.html">Isolate Library</a> < /dt> | 423 <dt> <a href="http://api.dartlang.org/dart_isolate.html">Isolate Library</a> < /dt> |
432 <dd> | 424 <dd> |
433 Contains interfaces for spawning and communicating with isolates, | 425 Support for spawning and communicating with isolates, |
434 the mechanism for concurrency and security in a Dart program. | 426 the mechanism for concurrency and security in a Dart program. |
435 </dd> | 427 </dd> |
436 | 428 |
437 <dt> <a href="http://api.dartlang.org/crypto.html">Crypto Library</a> </dt> | 429 <dt> <a href="http://api.dartlang.org/dart_json.html">JSON Library</a> </dt> |
438 <dd> | 430 <dd> |
439 Contains interfaces for creating one-way hashes (SHA1, MD5, SHA256) | 431 Support for parsing and producing JSON-encoded text. |
440 and HMAC support. | |
441 </dd> | 432 </dd> |
442 | 433 |
443 <dt> <a href="http://api.dartlang.org/json.html">JSON Library</a> </dt> | 434 <dt> <a href="http://api.dartlang.org/dart_math.html">Math Library</a> </dt> |
444 <dd> | 435 <dd> |
445 Contains the ability to parse and produce JSON-encoded text. | 436 Common functionality such as sine and cosine, |
446 </dd> | 437 maximum and minimum, |
447 | 438 and constants such as <em>pi</em> and <em>e</em>. |
448 <dt> <a href="http://api.dartlang.org/unittest.html">Unit Test Library</a> </d t> | |
449 <dd> | |
450 Contains functions and classes for writing unit tests in Dart. | |
451 </dd> | 439 </dd> |
452 </dl> | 440 </dl> |
453 | 441 |
454 <p> | 442 <p> |
455 See the | 443 See the |
456 <a href="/docs/library-tour/">library tour</a> | 444 <a href="/docs/dart-up-and-running/ch03.html">library tour</a> |
457 and the | 445 and the |
458 <a href="http://api.dartlang.org">API reference</a> docs for | 446 <a href="http://api.dartlang.org">API reference</a> for |
459 details on all the bundled | 447 details on all the bundled |
460 Dart libraries. | 448 Dart libraries. |
449 Also see <a href="http://pub.dartlang.org">pub.dartlang.org</a> | |
450 for additional libraries and tools such as | |
451 <a href="http://pub.dartlang.org/packages/js">JavaScript Interop</a> | |
452 and | |
453 <a href="http://pub.dartlang.org/packages/web_components">Dart Web Components< /a>. | |
461 </p> | 454 </p> |
462 | 455 |
463 </section> <!-- libraries --> | 456 </section> <!-- libraries --> |
464 | 457 |
465 | 458 |
466 <section id="involved"> | 459 <section id="involved"> |
467 <h2>Get involved</h2> | 460 <h2>Get involved</h2> |
468 | 461 |
469 <p> | 462 <p> |
470 This project is open source | 463 This project is open source |
471 and will evolve with feedback and participation from the community. | 464 and will evolve with feedback and participation from the community. |
472 We have released the draft language specification at an early stage | |
473 to gather responses from the developers | |
474 who will be using this new language and infrastructure for web programming. | |
475 Here are some additional links for learning more about Dart | 465 Here are some additional links for learning more about Dart |
476 and providing your feedback: | 466 and providing your feedback: |
477 </p> | 467 </p> |
478 | 468 |
479 <ul> | 469 <ul> |
480 <li> | 470 <li> |
481 Other pages in the Dart website, | 471 Other pages in the Dart website, |
482 such as the <a href="/docs/language-tour/">language tour</a>, | 472 such as the <a href="/docs/dart-up-and-running/ch02.html">language tour</a>, |
483 <a href="/docs/library-tour/">library tour</a>, | 473 <a href="/docs/dart-up-and-running/ch03.html">library tour</a>, |
484 tutorials, and <a href="/docs/spec/">language specification</a>. | 474 <a href="/docs/tutorials/">tutorials</a>, |
475 and <a href="/docs/dart-up-and-running/ch05.html">Dart Chat walkthrough</a> | |
485 </li> | 476 </li> |
486 <li> | 477 <li> |
487 <a href="https://code.google.com/p/dart/">Dart project</a> | 478 <a href="https://code.google.com/p/dart/">Dart project</a> |
488 with issue tracker and source code </li> | 479 with issue tracker and source code </li> |
489 <li> | 480 <li> |
490 <a href="https://groups.google.com/a/dartlang.org/group/misc/">Dart | 481 <a href="https://groups.google.com/a/dartlang.org/group/misc/">Dart |
491 discussion group</a> (misc at dartlang.org) </li> | 482 discussion group</a> (misc at dartlang.org) </li> |
492 <li> | 483 <li> |
493 <a href="https://plus.google.com/109866369054280216564/">+Dart</a> on Google + </li> | 484 <a href="https://plus.google.com/109866369054280216564/">+Dart</a> on Google + </li> |
494 </ul> | 485 </ul> |
495 | 486 |
496 </section> <!-- involved --> | 487 </section> <!-- involved --> |
497 | |
498 | |
OLD | NEW |