tree: 94d74375ebfc150601d5f02f349cc4b9f81766a2 [path history] [tgz]
  1. builder/
  2. dill/
  3. kernel/
  4. parser/
  5. scanner/
  6. source/
  7. testing/
  8. type_inference/
  9. util/
  10. builder_graph.dart
  11. colors.dart
  12. combinator.dart
  13. command_line_reporting.dart
  14. compiler_context.dart
  15. configuration.dart
  16. constant_context.dart
  17. crash.dart
  18. diagnostics.md
  19. export.dart
  20. fasta_codes.dart
  21. fasta_codes_generated.dart
  22. get_dependencies.dart
  23. hybrid_file_system.dart
  24. identifiers.dart
  25. ignored_parser_errors.dart
  26. import.dart
  27. incremental_compiler.dart
  28. library_graph.dart
  29. loader.dart
  30. messages.dart
  31. modifier.dart
  32. names.dart
  33. operator.dart
  34. parser.dart
  35. problems.dart
  36. quote.dart
  37. README.md
  38. rewrite_severity.dart
  39. scanner.dart
  40. scope.dart
  41. severity.dart
  42. target.dart
  43. target_implementation.dart
  44. TESTING.md
  45. ticker.dart
  46. uri_translator.dart
pkg/front_end/lib/src/fasta/README.md

Fasta -- Fully-resolved AST, Accelerated.

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 transparently integrated in tools like dart, dartanalyzer, dart2js, etc.

Hopefully, you'll notice that Fasta-based tools are fast, with good error messages. If not, please let us know.

Fasta sounds like faster, and that's a promise we intend to keep.

Getting Started

  1. Build the VM and patched SDK. Note: you only need to build the targets runtime_kernel, and dart_precompiled_runtime, so you only need to run this command:
./tools/build.py --mode release --arch x64 runtime_kernel dart_precompiled_runtime

Create an Outline File

  1. Run ./pkg/front_end/tool/fasta outline pkg/compiler/lib/src/dart2js.dart

  2. Optionally, run ./pkg/front_end/tool/fasta dump-ir pkg/kernel/bin/dump.dart pkg/compiler/lib/src/dart2js.dart.dill to view the generated outline.

This will generate a file named pkg/compiler/lib/src/dart2js.dart.dill which contains a serialized representation of the input program excluding method bodies. This is similar to an analyzer summary.

Compiling a Program

./pkg/front_end/tool/fasta compile pkg/front_end/test/fasta/hello.dart

This will generate pkg/front_end/test/fasta/hello.dart.dill which can be run this way:

./sdk/bin/dart pkg/front_end/test/fasta/hello.dart.dill

Using dartk and the Analyzer AST

./pkg/front_end/tool/fasta analyzer-compile pkg/front_end/test/fasta/hello.dart

This will generate pkg/front_end/test/fasta/hello.dart.dill which can be run this way:

./sdk/bin/dart pkg/front_end/test/fasta/hello.dart.dill

Running Tests

See How to test Fasta

Running dart2js

./pkg/front_end/tool/fasta compile pkg/compiler/lib/src/dart2js.dart
./sdk/bin/dart pkg/compiler/lib/src/dart2js.dart.dill pkg/front_end/test/fasta/hello.dart

The output of dart2js will be out.js, and it can be run on any Javascript engine, for example, d8 which is included with the Dart SDK sources:

./third_party/d8/<OS>/d8 out.js

Where <OS> is one of linux, macos, or windows.