OLD | NEW |
1 --- | 1 --- |
2 # WARNING: GENERATED FILE. DO NOT EDIT. | 2 # WARNING: GENERATED FILE. DO NOT EDIT. |
3 # WANT TO CONTRIBUTE? SEE https://github.com/dart-lang/dart-up-and-running-book | 3 # WANT TO CONTRIBUTE? SEE https://github.com/dart-lang/dart-up-and-running-book |
4 layout: book | 4 layout: book |
5 title: "dart: The Standalone VM from Dart: Up and Running" | 5 title: "dart: The Standalone VM from Dart: Up and Running" |
6 description: "Read dart: The Standalone VM of Dart: Up and Running, published by
O'Reilly." | 6 description: "Read dart: The Standalone VM of Dart: Up and Running, published by
O'Reilly." |
7 --- | 7 --- |
8 <div class="navheader"><table width="100%" summary="Navigation header"><tr><th c
olspan="3" align="center">dart: The Standalone VM</th></tr><tr><td width="20%" a
lign="left"><a accesskey="p" href="ch04-tools-dart2js.html">Prev</a> </td><th wi
dth="60%" align="center">Chapter 4. Tools</th><td width="20%" align="right"> <a
accesskey="n" href="ch04-tools-dart_analyzer.html">Next</a></td></tr></table><hr
></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" sty
le="clear: both"><a name="ch04-tools-dart-vm"></a>dart: The Standalone VM</h2></
div></div></div><p>You can use the <span class="emphasis"><em>dart</em></span> t
ool (<code class="literal">bin/dart</code>) to run Dart command-line apps such a
s | 8 <div class="navheader"><table width="100%" summary="Navigation header"><tr><th c
olspan="3" align="center">dart: The Standalone VM</th></tr><tr><td width="20%" a
lign="left"><a accesskey="p" href="ch04-tools-dart2js.html">Prev</a> </td><th wi
dth="60%" align="center">Chapter 4. Tools</th><td width="20%" align="right"> <a
accesskey="n" href="ch04-tools-dart_analyzer.html">Next</a></td></tr></table><hr
></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" sty
le="clear: both"><a name="ch04-tools-dart-vm"></a>dart: The Standalone VM</h2></
div></div></div><p>The documentation for dart has moved to <a class="ulink" href
="/tools/dart-vm/" target="_top">www.dartlang.org/tools/dart-vm/</a>.</p></div><
div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><t
d width="40%" align="left"><a accesskey="p" href="ch04-tools-dart2js.html">Prev<
/a> </td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a>
</td><td width="40%" align="right"> <a accesskey="n" href="ch04-tools-dart_analy
zer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">dart2j
s: The Dart-to-JavaScript Compiler </td><td width="20%" align="center"><a access
key="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top
"> dartanalyzer: The Static Analyzer</td></tr></table></div> |
9 server-side scripts, programs, and servers. During development, you also | |
10 have the option to run command-line apps using <a class="link" href="ch04-to
ols-editor.html#ch04-editor-run" title="Running Apps">Dart Editor</a>.</p><div c
lass="sect2"><div class="titlepage"><div><div><h3 class="title"><a name="ch04-to
ols-dart-vm-basic-usage"></a>Basic Usage</h3></div></div></div><p>Here’s an exam
ple of running a Dart file on the command | |
11 line:</p><pre class="screen"><em><span class="remark">lang-sh | |
12 </span></em>dart test.dart</pre></div><div class="sect2"><div class="titlepage">
<div><div><h3 class="title"><a name="ch04-tools-dart-vm-options"></a>Options</h3
></div></div></div><p>Common command-line options for dart include:</p><div clas
s="variablelist"><dl class="variablelist"><dt><span class="term"><code class="li
teral">-c</code><span class="emphasis"><em> | |
13 or </em></span><code class="literal">--checked</code></span></dt><dd><
p>Enable <span class="emphasis"><em>both</em></span> assertions and type checks | |
14 (checked mode).</p></dd><dt><span class="term"><code class="literal"
>-p<em class="replaceable"><code><path></code></em> or | |
15 -package-root=<em class="replaceable"><code><path></code></em></
code></span></dt><dd><p>Specify where to find imported libraries.</p></dd><dt><s
pan class="term"><code class="literal">--version</code></span></dt><dd><p>Displa
y VM version information.</p></dd><dt><span class="term"><code class="literal">-
h</code><span class="emphasis"><em> | |
16 or </em></span><code class="literal">--help</code></span></dt><dd><p>D
isplay help. (Add <code class="literal">-v</code> for | |
17 information about all options.)</p></dd></dl></div><p>You can also g
enerate snapshots: <em><span class="remark">{PENDING: Omitted --debug | |
18 because John says it's not generally useful. The verbose help also says | |
19 the following are supported, but I haven't documented them: break-at, | |
20 print-script, --enable-vm-service.}</span></em></p><div class="variablelis
t"><dl class="variablelist"><dt><span class="term"><code class="literal"> | |
21 --snapshot=<em class="replaceable"><code><filename></code></em><
/code></span></dt><dd><p>Generate a snapshot in the specified file. For informat
ion | |
22 on generating and running snapshots, see the article <a class="ulink
" href="https://www.dartlang.org/articles/snapshots/" target="_top">Snapshots in | |
23 Dart.</a></p></dd></dl></div></div><div class="sect2"><div class="ti
tlepage"><div><div><h3 class="title"><a name="ch04-tools-dart-vm-type-checks"></
a>Enabling Checked Mode</h3></div></div></div><p>Dart programs run in one of two
modes: checked or production. By | |
24 default, the Dart VM runs in production mode. We recommend that you | |
25 enable checked mode for development and testing.</p><p>In checked mode, as
signments are dynamically checked, and certain | |
26 violations of the type system raise exceptions at runtime. In production | |
27 mode, static type annotations have no effect.</p><p>Assert statements are
also enabled in checked mode. An <a class="link" href="ch02.html#assert" title="
Assert">assert statement</a> checks a boolean condition, | |
28 raising an exception if the condition is false. Assertions do not run in | |
29 production mode.</p><p>You can run the VM in checked mode with the | |
30 <code class="literal">--checked</code> command-line flag:</p><pre class="s
creen"><em><span class="remark">lang-sh | |
31 </span></em>dart --checked <em class="replaceable"><code>test.dart</code></em></
pre></div></div><div class="navfooter"><hr><table width="100%" summary="Navigati
on footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04-tools-da
rt2js.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="
ch04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch04
-tools-dart_analyzer.html">Next</a></td></tr><tr><td width="40%" align="left" va
lign="top">dart2js: The Dart-to-JavaScript Compiler </td><td width="20%" align="
center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="r
ight" valign="top"> dartanalyzer: The Static Analyzer</td></tr></table></div> | |
OLD | NEW |