| OLD | NEW |
| (Empty) | |
| 1 <!-- |
| 2 Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 3 for details. All rights reserved. Use of this source code is governed by a |
| 4 BSD-style license that can be found in the LICENSE file. |
| 5 --> |
| 6 # Fasta -- Fully-resolved AST, Accelerated. |
| 7 |
| 8 Fasta is a compiler framework for compiling Dart sources to Kernel IR. When Fast
a works well, you won't even know you're using it, as it will be transparently i
ntegrated in tools like *dart*, *dartanalyzer*, *dart2js*, etc. |
| 9 |
| 10 Hopefully, you'll notice that Fasta-based tools are fast, with good error messag
es. If not, please let us [know](https://github.com/dart-lang/sdk/issues/new). |
| 11 |
| 12 Fasta sounds like faster, and that's a promise we intend to keep. |
| 13 |
| 14 ## Getting Started |
| 15 |
| 16 1. [Build](https://github.com/dart-lang/sdk/wiki/Building#building) the VM and p
atched SDK. Note: you only need to build the target `runtime`, so you only need
to run this command: |
| 17 |
| 18 ```bash |
| 19 ./tools/build.py --mode release --arch ia32 runtime |
| 20 ``` |
| 21 |
| 22 Make sure to define these environment variables, for example, by adding them to
`~/.bashrc`: |
| 23 |
| 24 ```bash |
| 25 # Linux |
| 26 DART_SDK=<Location of Dart SDK source check out> |
| 27 export DART_AOT_VM=${DART_SDK}/out/ReleaseIA32/dart |
| 28 export DART_AOT_SDK=${DART_SDK}/out/ReleaseIA32/patched_sdk |
| 29 ``` |
| 30 |
| 31 ```bash |
| 32 # Mac OS X |
| 33 DART_SDK=<Location of Dart SDK source check out> |
| 34 export DART_AOT_VM=${DART_SDK}/xcodebuild/ReleaseIA32/dart |
| 35 export DART_AOT_SDK=${DART_SDK}/xcodebuild/ReleaseIA32/patched_sdk |
| 36 ``` |
| 37 |
| 38 If you want to help us translate these instructions to another OS, please let us
[know](https://github.com/dart-lang/sdk/issues/new). |
| 39 |
| 40 ## Create an Outline File |
| 41 |
| 42 1. Run `dart pkg/fasta/bin/outline.dart pkg/compiler/lib/src/dart2js.dart` |
| 43 |
| 44 2. Optionally, run `dart pkg/kernel/bin/dartk.dart outline.dill` to view the gen
erated outline. |
| 45 |
| 46 This will generate a file named `outline.dill` which contains a serialized reprs
entation of the input program excluding method bodies. This is similar to an ana
lyzer summary. |
| 47 |
| 48 |
| 49 ## Create a Platform Dill File |
| 50 |
| 51 A `platform.dill` is a dill file that contains the Dart SDK platform libraries.
For now, this is generated with dartk until fasta reaches a higher rate of test
passes. |
| 52 |
| 53 ```bash |
| 54 dart pkg/fasta/bin/compile_platform.dart platform.dill |
| 55 ``` |
| 56 |
| 57 Make sure to define `$DART_AOT_SDK` as described [above](#Building-The-Dart-SDK)
. |
| 58 |
| 59 ## Compiling a Program |
| 60 |
| 61 ```bash |
| 62 dart pkg/fasta/bin/compile.dart test/hello.dart |
| 63 ``` |
| 64 |
| 65 This will generate `program.dill` which can be run this way: |
| 66 |
| 67 ```bash |
| 68 $DART_AOT_VM program.dill |
| 69 ``` |
| 70 |
| 71 Where `$DART_AOT_VM` is defined as described [above](#Building-The-Dart-SDK). |
| 72 |
| 73 ### Using dartk and the Analyzer AST |
| 74 |
| 75 ```bash |
| 76 dart pkg/fasta/bin/kompile.dart test/hello.dart |
| 77 ``` |
| 78 |
| 79 This will generate `program.dill` which can be run this way: |
| 80 |
| 81 ```bash |
| 82 $DART_AOT_VM program.dill |
| 83 ``` |
| 84 |
| 85 Where `$DART_AOT_VM` is defined as described [above](#Building-The-Dart-SDK). |
| 86 |
| 87 ## Running Tests |
| 88 |
| 89 Run: |
| 90 |
| 91 ```bash |
| 92 dart -c pkg/testing/bin/testing.dart --config=pkg/fasta/testing.json |
| 93 ``` |
| 94 |
| 95 ## Running dart2js |
| 96 |
| 97 ```bash |
| 98 dart pkg/fasta/bin/compile.dart pkg/compiler/lib/src/dart2js.dart |
| 99 $DART_AOT_VM pkg/compiler/lib/src/dart2js.dart.dill pkg/fasta/test/test/hello.da
rt |
| 100 ``` |
| OLD | NEW |