Skip to content

Commit 25f7538

Browse files
author
Tony Sansone
committed
Update FAQ
1 parent a6d9482 commit 25f7538

File tree

1 file changed

+106
-85
lines changed

1 file changed

+106
-85
lines changed

src/resources/faq.md

+106-85
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,43 @@ description: You have questions about Dart, we have answers.
77
This page collects some of the top questions we've heard from the community
88
since Dart was open sourced.
99

10-
1110
## General
1211

1312
### Q. Is there a specification for Dart?
1413

15-
Yes. Dart 1 has a formal specification owned by [Ecma TC52][tc52].
14+
Yes. EMCA-408 covers the Dart Programming Language Specification.
15+
16+
Five versions have been published.
17+
The latest in-progress version covers to Dart 2.13-dev.
18+
19+
| Edition | Published | Approved | Covers to version |
20+
|---------------|-------------------|---------------|-------------------|
21+
| [6th][6th-ed] | January 24, 2024 | | 2.13-dev |
22+
| [5th][5th-ed] | April 9, 2021 | | 2.10 |
23+
| [4th][4th-ed] | August 19, 2015 | December 2015 | 1.11 |
24+
| [3rd][3rd-ed] | April 15, 2015 | June 2015 | 1.9 |
25+
| [2nd][2nd-ed] | November 21, 2014 | December 2014 | 1.6 |
26+
| [1st][1st-ed] | March 27, 2014 | June 2014 | 1.3 |
27+
28+
To learn more about the specification,
29+
review the [Dart language specification](/guides/language/spec) page.
1630

17-
Dart 2.x is currently being specified; the specification is available from the
18-
[Dart language specification](/guides/language/spec) page.
31+
[1st-ed]: https://ecma-international.org/wp-content/uploads/ECMA-408_1st_edition_june_2014.pdf
32+
[2nd-ed]: https://ecma-international.org/wp-content/uploads/ECMA-408_2nd_edition_december_2014.pdf
33+
[3rd-ed]: https://ecma-international.org/wp-content/uploads/ECMA-408_3rd_edition_june_2015.pdf
34+
[4th-ed]: https://ecma-international.org/wp-content/uploads/ECMA-408_4th_edition_december_2015.pdf
35+
[5th-ed]: https://dart.dev/guides/language/specifications/DartLangSpec-v2.10.pdf
36+
[6th-ed]: https://spec.dart.dev/DartLangSpecDraft.pdf
1937

2038
### Q. How are you taking input on changes to Dart?
2139

22-
We listen to feedback and [issues,][SDK issues] and we review patches from contributors.
23-
A contributor with a good track record can become a committer to the repository.
24-
Google engineers will also be working in the public repository, making visible
25-
changes. The project is lucky to have received many external patches and has
26-
welcomed distributed committers.
40+
The team listens to feedback, reads [issues][SDK issues],
41+
and reviews patches from contributors.
42+
A contributor with a good track record can be granted
43+
write permission to the repository.
44+
Google engineers also work in the public repository, making visible changes.
45+
The project has received many external patches
46+
and welcomes distributed committers.
2747

2848
---
2949

@@ -32,70 +52,72 @@ welcomed distributed committers.
3252
### Q. Isn't Dart a lot like Java?
3353

3454
Dart has some similarities with Java.
35-
Check out the code samples in the [Introduction to Dart](/language)
36-
for brief examples with familiar syntax.
55+
To review brief examples with familiar syntax,
56+
reviewed the code samples in the [Introduction to Dart](/language).
3757

3858
### Q. How does Dart relate to Go?
3959

40-
Dart and Go are both language projects started at Google, but they
41-
are independent and have different goals. As a result,
42-
they make different choices, and the languages have very different
43-
natures, even while we all try to learn from each others' work.
60+
Google started the Dart and Go language projects.
61+
These independent projects have different goals.
62+
As a result, they make different choices.
63+
The languages have very different natures,
64+
but team members learn from each others' work.
4465

4566
### Q. Why isn't Dart more like Haskell / Smalltalk / Python / Scala / other language?
4667

47-
Various reasons, depending on the language being asked about.
68+
Various reasons that depend on the comparison language.
4869

49-
For languages that are quite different from JavaScript: it's important for Dart
50-
to compile to efficient JavaScript. Our experience in GWT is that if the source
51-
language is too different from JavaScript, it creates some cases where complex
52-
output code is needed to emulate the source language's behavior. This can cause
53-
performance to vary in ways that are not transparent to the programmer.
70+
Languages differ from JavaScript
71+
Dart must compile to efficient JavaScript.
72+
Source languages that differ too much from JavaScript can generate complex
73+
output code to emulate the source language's behavior.
74+
This can cause performance to vary in non-obvious ways to the programmer.
5475

55-
For languages that are compiled to native code: it's important that Dart
56-
compiles efficiently to machine code, and thus it shares a number of aspects
57-
with other compiled languages.
76+
Languages that compile to native code
77+
Dart prioritizes efficient compliation to machine code.
78+
Therefore, it shares some aspects with other compiled languages.
5879

59-
For languages that are "more dynamic" than Dart: Dart deliberately trades off
60-
some of this arbitrary runtime modification for the goal of better performance
61-
and more productive tools.
80+
Languages that are considered "more dynamic" than Dart
81+
Dart chooses to trade off some of this arbitrary runtime modification
82+
to achieve better performance and more productive tools.
6283

6384
### Q. Why isn't Dart syntax more exciting?
6485

65-
We did throw in some nice syntactic features such as `this.` constructor args
66-
and `=>` for one-line functions, but we'd agree that Dart chooses
67-
familiarity over excitement. One team member's personal testimonial:
68-
"I wish it had a little more razzle dazzle but I can't deny that
69-
literally on my first day of writing Dart code, I was productive in it."
86+
Some nice syntactic features exist, like the `this.` constructor args and `=>`
87+
for one-line functions.
88+
Dart chooses familiarity over excitement.
7089

7190
### Q. Does Dart have reflection capabilities?
7291

73-
For servers and command-line scripts, we have reflection support from the
74-
[mirrors API.]({{site.dart-api}}/{{site.data.pkg-vers.SDK.channel}}/dart-mirrors)
75-
There is no support for mirrors when using Dart to write web or
76-
Flutter apps ([more info][Flutter no mirrors]).
92+
Servers and command-line scripts
93+
Yes, Dart supports reflection from the [mirrors API][dart-mirror].
94+
Web or Flutter apps
95+
No, Dart doesn't support write ([web or Flutter apps][Flutter no mirrors]).
7796

78-
### Q. Can Dart add tuples, pattern matching, partial evaluation, optional semicolons, ...?
97+
### Q. Can Dart add tuples, pattern matching, ...?
7998

80-
Future releases might be able to include (some of) those features, although
81-
we can't include everything. Some features don't fit the basic nature of the
82-
language, and some don't play well with other features. Simplicity is the single
83-
most important gift we can give to future programmers.
99+
Future releases might include some of those features.
100+
Some features don't fit the nature of the language.
101+
Some don't play well with other features.
102+
Simplicity is the most important gift we can give to future programmers.
84103

85-
Please look at the [language funnel][language funnel] and
86-
[language issues list][language issues] to see if your request is already there.
87-
If it is, let us know that you care and give it a thumbs up. Otherwise, go ahead
104+
To check if your request has been filed,
105+
review at the [language funnel][language funnel] and
106+
[language issues list][language issues].
107+
If it is, give it a thumbs up.
108+
Otherwise, go ahead
88109
and add a new request issue (see the [language evolution process][language process]
89-
for details). Make a thoughtful argument for your feature. Sample code with and
110+
for details).
111+
Make a thoughtful argument for your feature. Sample code with and
90112
without your feature is good evidence; a sizeable codebase that shows the need
91113
is even better evidence.
92114

93115
Don't be surprised if the Dart language team says "no" by default.
94116
It's far more painful to remove a language feature than to add it, so
95117
Dart is likely to add the most obvious features first, and then revisit the next
96-
tier later. And there simply are more possible language features in the world
97-
that can fit into any single language without making a total hash of it. But
98-
we do very much appreciate suggestions and evidence. We hope you'll see our
118+
tier later. And there simply are more possible language features in the world
119+
that can fit into any single language without making a total hash of it. But
120+
we do very much appreciate suggestions and evidence. We hope you'll see our
99121
appreciation through careful design choices and fair communication about them.
100122

101123
---
@@ -104,12 +126,11 @@ appreciation through careful design choices and fair communication about them.
104126

105127
### Q. Is Dart a statically typed language?
106128

107-
Yes, Dart 2 is statically typed. For more information,
108-
read about [Dart's type system][].
129+
Yes, Dart uses static typing. To learn more, review [Dart's type system][].
109130

110-
With its combination of static and runtime checks, Dart has a sound type system,
111-
which guarantees that an expression of one type cannot produce a value of another type.
112-
No surprises!
131+
With its combination of static and runtime checks, Dart has a sound type system.
132+
This guarantees that an expression of one type cannot produce a value
133+
of another type.
113134

114135
Even with type-safe Dart, you can annotate any variable with `dynamic` if you need the flexibility of a dynamic language.
115136
The `dynamic` type itself is static, but can contain any type at runtime.
@@ -139,37 +160,37 @@ Again, we're trying to be pragmatic, and we think the outcome is reasonable.
139160

140161
### Q. Does Dart support JSON?
141162

142-
Yes. See the [JSON] converters in the dart:convert library.
163+
Yes. To learn more, review the [JSON] converters in the dart:convert library.
143164

144165
### Q. Can Dart run on the server?
145166

146-
Yes. See [Dart on the Server] for details.
167+
Yes. To learn more, review [Dart on the Server].
147168

148169
### Q. How do I use third party code, or share code?
149170

150-
You can find many packages on the [pub.dev site][pub] a service for hosting
151-
packages of Dart code. Use the `pub` command to package your code and upload
152-
to the site.
171+
Search for packages on the [pub.dev site][pub],
172+
the package-hosting service for Dart and Flutter.
173+
Use the [`pub` command][pub-cmd] to package your code and upload to the site.
153174

154175
### Q. Do I need to use a particular editor or IDE to write Dart code?
155176

156-
Nope. You can try out Dart code with [DartPad,][DartPad] and then use your favorite
177+
No. You can try out Dart code with [DartPad,][DartPad] and then use your favorite
157178
editor or IDE for development. Some full-featured IDEs such as IntelliJ IDEA,
158179
WebStorm, and Visual Studio Code have Dart plugins. Open source Dart plugins
159180
also exist for a number of editors. For more information, see the [Dart tools][].
160181

161182
### Q. Can I build an Android app with Dart?
162183

163-
Yes! You can build an Android app that also works on iOS from a single codebase
164-
using [Flutter][Flutter], which is powered by the Dart platform.
184+
Yes! You can build an Android app using the [Flutter][Flutter] framework
185+
and the Dart language.
186+
Any Flutter app you write will also work on iOS, the web, and desktop platforms.
165187

166188
### Q. What are some real-world production deployments of Dart?
167189

168-
Google Ads, AdSense, AdMob, and the Google Assistant all use Dart.
190+
Google Ads, AdSense, AdMob, and the Google Assistant use Dart.
169191
A significant portion of Google's revenue flows through these apps.
170192
Inside or outside of Google, [every Flutter app][FlutterShowcase] uses Dart.
171193

172-
173194
[dartisnotjava]: http://programming.oreilly.com/2013/05/dart-is-not-the-language-you-think-it-is.html
174195
[pnacl]: https://developer.chrome.com/native-client/overview
175196
[SDK issues]: https://github.com/dart-lang/sdk/issues
@@ -243,7 +264,6 @@ long enough for runtime optimizations to be applied.
243264

244265
---
245266

246-
247267
## Web: general
248268

249269
### Q. What browsers do you support as JavaScript compilation targets?
@@ -273,14 +293,14 @@ For setup details and a walkthrough, see [Debugging Dart Web Apps](/web/debuggin
273293
You can use the low-level HTML API that core libraries define like `dart:html`, or you can choose from many [web packages](/web/libraries#web-packages).
274294
You can also use the [Flutter framework]({{site.flutter}}), which has [web support]({{site.flutter}}/web)
275295

276-
### Q. Will the Dart VM get into Chrome?
296+
### Q. Will Chrome add the Dart VM?
277297

278298
[No.]({{site.news}}/2015/03/dart-for-entire-web.html)
279-
Dart is designed to compile to JavaScript to run across the modern web.
299+
Dart compiles to JavaScript to run across the modern web.
280300

281301
### Q. Is Dart single-threaded on the web?
282302

283-
Dart is *mostly* single-threaded on the web,
303+
Dart is _mostly_ single-threaded on the web,
284304
since web apps cannot use isolates.
285305
To run code concurrently, web apps use [web workers][] instead.
286306
Web workers lack the ease and efficiency of isolates,
@@ -296,20 +316,19 @@ To learn more, see
296316

297317
### Q. How does Dart code interoperate with JavaScript libraries?
298318

299-
Although Dart and JavaScript are completely separate languages with
300-
separate VMs, they can interoperate. For more information, see
319+
Dart and JavaScript exist as separate languages with separate VMs,
320+
though they can interoperate. To learn more, review
301321
[JavaScript and TypeScript interop](/interop/js-interop).
302322

303-
### Q. I have a large JavaScript codebase. How can I migrate it to Dart?
323+
### Q. How can I migrate my JavaScript codebase to Dart?
304324

305-
Try migrating one major feature at a time, and use the
306-
[JavaScript interoperability library][package:js]
307-
only when necessary.
325+
Migrate one major feature at a time.
326+
Use the [JavaScript interoperability library][package:js] when necessary.
308327

309328
### Q. How does Dart compare with using the Closure compiler on JavaScript?
310329

311-
The idea of optional type annotations is similar.
312-
Dart's are nicer syntactically.
330+
Optional type annotations work in a similar way.
331+
Dart's syntax reads better.
313332

314333
Compare the following Closure compiler code:
315334

@@ -341,18 +360,18 @@ String makeGreeting(String name) {
341360

342361
### Q. How does Dart compare with CoffeeScript?
343362

344-
Both Dart and CoffeeScript are inspired by JavaScript, and both can be
345-
translated back to it. They make different choices, particularly in the flavor
346-
of their syntax. As a language we think it's fair to say that Dart differs
347-
semantically from JavaScript more than CoffeeScript does; that may result in a
348-
less line-for-line translation, but we believe Dart-generated JavaScript can
349-
have excellent size and speed.
363+
JavaScript inspired both Dart and CoffeeScript and both translate to JavaScript.
364+
They make different choices in the flavor of their syntax.
365+
As a language,
366+
Dart's semantics differ from JavaScript more than CoffeeScript's do.
367+
This might result in a less line-for-line translation.
368+
Dart-generated JavaScript can have excellent size and speed.
350369

351370
Dart introduces new semantics, while CoffeeScript retains the semantics
352371
of JavaScript.
353372

354-
If you like CoffeeScript for its more structured feel than raw JavaScript, you
355-
may like Dart's static type annotations.
373+
If you like CoffeeScript for its more structured feel than raw JavaScript,
374+
you may like Dart's static type annotations.
356375

357376
### Q. What does Google think of TypeScript?
358377

@@ -383,7 +402,7 @@ a talk from Dart Developer Summit 2016.
383402

384403
### Q. Will any valid Dart code compile to JavaScript, or are there limitations?
385404

386-
We intend for any valid Dart code to compile to JavaScript. Of course,
405+
We intend for any valid Dart code to compile to JavaScript. Of course,
387406
some libraries only run on the server or in Flutter.
388407
For example, the `dart:io` library
389408
provides access to operating system files and directories with APIs not
@@ -461,10 +480,12 @@ One exception exists: the production JavaScript compiler does not support
461480
64-bit integers: `Int64List` or `Uint64List`. Compiling Dart code with
462481
either of those lists results in a runtime exception.
463482

464-
465483
[ppwsize]: https://work.j832.com/2012/11/excited-to-see-dart2js-minified-output.html
466484
[package:js]: {{site.pub-pkg}}/js
467485
[dart compile]: /tools/dart-compile
468486
[dart analyze]: /tools/dart-analyze
469487
[typescript]: {{site.news}}/2012/10/the-dart-team-welcomes-typescript.html
470488
[webdev]: /tools/webdev
489+
490+
[dart-mirror]: {{site.dart-api}}/{{site.data.pkg-vers.SDK.channel}}/dart-mirrors
491+
[pub-cmd]: https://dart.dev/tools/pub/cmd

0 commit comments

Comments
 (0)