Chromium Code Reviews| Index: pkg/fasta/README.md |
| diff --git a/pkg/fasta/README.md b/pkg/fasta/README.md |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8d124358d197d267cefec38e86b2667a545fa485 |
| --- /dev/null |
| +++ b/pkg/fasta/README.md |
| @@ -0,0 +1,86 @@ |
| +<!-- |
| +Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| +for details. All rights reserved. Use of this source code is governed by a |
| +BSD-style license that can be found in the LICENSE file. |
| +--> |
| +# Fasta -- Fully-resoved AST, Accelerated. |
|
Johnni Winther
2017/01/13 13:03:50
resoved -> resolved
ahe
2017/01/16 07:51:04
Done.
|
| + |
| +Fasta is a compiler framework for compiling Dart sources to Kernel IR. When Fasta works well, you won't even know you're using it, as it will be tranparently integrated 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
|
| + |
| +Hopefully, you'll notice that Fasta-based tools are fast, with good error messages. If not, please let us [know](https://github.com/dart-lang/sdk/issues/new). |
| + |
| +Fasta sounds like faster, and that's a promise we intend to keep. |
| + |
| +## Getting Started |
| + |
| +1. [Build](https://github.com/dart-lang/sdk/wiki/Building#building) the VM and patched SDK. Note: you only need to build the target `runtime`, so you only need to run this command: |
| + |
| +```bash |
| +./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.
|
| +``` |
| + |
| +Make sure to define these environment variables, for example, by adding them to `~/.bashrc`: |
| + |
| +```bash |
| +# Linux |
| +DART_SDK=<Location of Dart SDK source check out> |
| +export DART_AOT_VM=${DART_SDK}/out/ReleaseIA32/dart |
| +export DART_AOT_SDK=${DART_SDK}/out/ReleaseIA32/patched_sdk |
| +``` |
| + |
| +```bash |
| +# Mac OS X |
| +DART_SDK=<Location of Dart SDK source check out> |
| +export DART_AOT_VM=${DART_SDK}/xcodebuild/ReleaseIA32/dart |
| +export DART_AOT_SDK=${DART_SDK}/xcodebuild/ReleaseIA32/patched_sdk |
| +``` |
| + |
| +If you want to help us translate these instructions to another OS, please let us [know](https://github.com/dart-lang/sdk/issues/new). |
| + |
| +## Create an Outline File |
| + |
| +1. Run `dart pkg/fasta/bin/outline.dart pkg/compiler/lib/src/dart2js.dart` |
| + |
| +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
|
| + |
| +This will generate a file named `outline.dill` which contains a serialized reprsentation of the input program excluding method bodies. This is similar to an analyzer summary. |
| + |
| + |
| +## 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
|
| + |
| +```bash |
| +dart pkg/fasta/bin/compile_platform.dart platform.dill |
| +``` |
| + |
| +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
|
| + |
| +## Compiling a Program |
| + |
| +```bash |
| +dart pkg/fasta/bin/compile.dart test/hello.dart |
| +``` |
| + |
| +This will generate `program.dill` which can be run this way: |
| + |
| +```bash |
| +$DART_AOT_VM program.dill |
| +``` |
| + |
| +Where `$DART_AOT_VM` is defined as described [above](#Building-The-Dart-SDK). |
| + |
| +### Using dartk and the Analyzer AST |
| + |
| +In the above command, replace `pkg/fasta/bin/compile.dart` by `pkg/fasta/bin/kompile.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.
|
| + |
| +## Running Tests |
| + |
| +Run: |
| + |
| + dart -c pkg/testing/bin/testing.dart --config=pkg/fasta/testing.json |
| + |
| +## Running dart2js |
| + |
| +```bash |
| +dart -c pkg/fasta/bin/compile.dart pkg/compiler/lib/src/dart2js.dart |
| +$DART_AOT_VM pkg/compiler/lib/src/dart2js.dart.dill pkg/fasta/test/test/hello.dart |
| +``` |