Chromium Code Reviews| 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-resoved AST, Accelerated. | |
|
Johnni Winther
2017/01/13 13:03:50
resoved -> resolved
ahe
2017/01/16 07:51:04
Done.
| |
| 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 tranparently in tegrated in tools like *dart*, *dartanalyzer*, *dart2js*, etc. | |
|
Johnni Winther
2017/01/13 13:03:50
Long line and below.
Johnni Winther
2017/01/13 13:03:50
tranparently -> transparently
ahe
2017/01/16 07:51:04
Done.
ahe
2017/01/16 07:51:04
Wrapping interferes with Markdown rendering, I thi
| |
| 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 | |
|
Johnni Winther
2017/01/13 13:03:50
Isn't x64 the default now?
ahe
2017/01/16 07:51:04
I don't know. IA32 is faster.
| |
| 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. Run `dart pkg/kernel/bin/dartk.dart outline.dill` | |
|
Johnni Winther
2017/01/13 13:03:51
How are these steps connected?
ahe
2017/01/16 07:51:04
I've changed this to:
Optionally, run `dart pkg/k
| |
| 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 | |
|
Johnni Winther
2017/01/13 13:03:50
What is a 'platform dill file'?
ahe
2017/01/16 07:51:04
I've added:
A `platform.dill` is a dill file that
| |
| 50 | |
| 51 ```bash | |
| 52 dart pkg/fasta/bin/compile_platform.dart platform.dill | |
| 53 ``` | |
| 54 | |
| 55 Where `$DART_AOT_SDK` is defined as described [above](#Building-The-Dart-SDK). | |
|
Johnni Winther
2017/01/13 13:03:50
Not use in this section.
ahe
2017/01/16 07:51:04
Changed to:
Make sure to define `$DART_AOT_SDK` a
| |
| 56 | |
| 57 ## Compiling a Program | |
| 58 | |
| 59 ```bash | |
| 60 dart pkg/fasta/bin/compile.dart test/hello.dart | |
| 61 ``` | |
| 62 | |
| 63 This will generate `program.dill` which can be run this way: | |
| 64 | |
| 65 ```bash | |
| 66 $DART_AOT_VM program.dill | |
| 67 ``` | |
| 68 | |
| 69 Where `$DART_AOT_VM` is defined as described [above](#Building-The-Dart-SDK). | |
| 70 | |
| 71 ### Using dartk and the Analyzer AST | |
| 72 | |
| 73 In the above command, replace `pkg/fasta/bin/compile.dart` by `pkg/fasta/bin/kom pile.dart` to use `dartk`. | |
|
Johnni Winther
2017/01/13 13:03:50
Just write it out directly instead of the indirect
ahe
2017/01/16 07:51:04
Done.
| |
| 74 | |
| 75 ## Running Tests | |
| 76 | |
| 77 Run: | |
| 78 | |
| 79 dart -c pkg/testing/bin/testing.dart --config=pkg/fasta/testing.json | |
| 80 | |
| 81 ## Running dart2js | |
| 82 | |
| 83 ```bash | |
| 84 dart -c pkg/fasta/bin/compile.dart pkg/compiler/lib/src/dart2js.dart | |
| 85 $DART_AOT_VM pkg/compiler/lib/src/dart2js.dart.dill pkg/fasta/test/test/hello.da rt | |
| 86 ``` | |
| OLD | NEW |