Switch branches/tags
analyzer-0.32.4 analyzer-0.32.1 analyzer-0.32.0 analyzer-0.31.2-alpha.2 analyzer-0.31.2-alpha.1 analyzer-0.31.2-alpha.0 analyzer-0.31.1 analyzer-0.31.0+1 analyzer-0.31.0 2.1.0-dev.1.0 2.1.0-dev.0.0 2.0.0 2.0.0-dev.69.5 2.0.0-dev.69.4 2.0.0-dev.69.3 2.0.0-dev.69.2 2.0.0-dev.69.1 2.0.0-dev.69.0 2.0.0-dev.68.0 2.0.0-dev.67.0 2.0.0-dev.66.0 2.0.0-dev.65.0 2.0.0-dev.64.2 2.0.0-dev.64.1 2.0.0-dev.64.0 2.0.0-dev.63.0 2.0.0-dev.62.0 2.0.0-dev.61.0 2.0.0-dev.60.0 2.0.0-dev.59.0 2.0.0-dev.58.0 2.0.0-dev.57.0 2.0.0-dev.56.0 2.0.0-dev.55.0 2.0.0-dev.54.0 2.0.0-dev.53.0 2.0.0-dev.52.0 2.0.0-dev.51.0 2.0.0-dev.50.0 2.0.0-dev.49.0 2.0.0-dev.48.0 2.0.0-dev.47.0 2.0.0-dev.46.0 2.0.0-dev.45.0 2.0.0-dev.44.0 2.0.0-dev.43.0 2.0.0-dev.42.0 2.0.0-dev.41.0 2.0.0-dev.40.0 2.0.0-dev.39.0 2.0.0-dev.38.0 2.0.0-dev.37.0 2.0.0-dev.36.0 2.0.0-dev.35 2.0.0-dev.34.0 2.0.0-dev.33.0 2.0.0-dev.32.0 2.0.0-dev.31.0 2.0.0-dev.30.0 2.0.0-dev.29.0 2.0.0-dev.28.0 2.0.0-dev.27.0 2.0.0-dev.26.0 2.0.0-dev.25.0 2.0.0-dev.24.0 2.0.0-dev.23.0 2.0.0-dev.22.0 2.0.0-dev.21.0 2.0.0-dev.20.0 2.0.0-dev.19.0 2.0.0-dev.18.0 2.0.0-dev.17.0 2.0.0-dev.16.0 2.0.0-dev.15.0 2.0.0-dev.14.0 2.0.0-dev.13.0 2.0.0-dev.12.0 2.0.0-dev.11.0 2.0.0-dev.10.0 2.0.0-dev.9.0 2.0.0-dev.8.0 2.0.0-dev.7.0 2.0.0-dev.6.0 2.0.0-dev.5.0 2.0.0-dev.4.0 2.0.0-dev.3.0 2.0.0-dev.2.0 2.0.0-dev.1.0 2.0.0-dev.0.1 2.0.0-dev.0.0 1.25.0-dev.16.4 1.25.0-dev.16.3 1.25.0-dev.16.2 1.25.0-dev.16.1 1.25.0-dev.16.0 1.25.0-dev.15.0 1.25.0-dev.14.0 1.25.0-dev.13.0 1.25.0-dev.12.0 1.25.0-dev.11.0
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
bin
coq
doc/semantics
lib
runtime/reify
test
testcases
.gitignore
AUTHORS
LICENSE
README.md
analysis_options.yaml
binary.md
codereview.settings
pubspec.yaml

README.md

Dart Kernel

Dart Kernel is a small high-level language derived from Dart. It is designed for use as an intermediate format for whole-program analysis and transformations, and as a frontend for codegen and execution backends.

The kernel language has in-memory representations in Dart and C++, and can be serialized as binary or text.

Both the kernel language and its implementations are unstable and are under development.

This package contains the Dart part of the implementation and contains:

  • A transformable IR for the kernel language
  • A frontend based on the analyzer
  • Serialization of kernel code

Note: The APIs in this package are in an early state; developers should be careful about depending on this package. In particular, there is no semver contract for release versions of this package. Please depend directly on individual versions.

Getting Kernel

Checkout the repository and run pub get:

git clone https://github.com/dart-lang/kernel
cd kernel
pub get

Command-Line Tool

Run tool/dartk.dart from the command-line to convert between .dart files and the serialized binary and textual formats.

dartk expects the .dill extension for files in the binary format. The textual format has no preferred extension right now.

Example commands:

dartk foo.dart            # print text IR for foo.dart
dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill
dartk foo.dill            # print text IR for binary file foo.dill

Pass the --link or -l flag to link all transitive dependencies into one file:

dartk myapp.dart -ppackages -l -omyapp.dill # Bundle everything.
dartk myapp.dill # Print it back out in a (very, very long) textual format.

See ast.dart for the in-memory IR, or binary.md for a description of the binary format. For now, the textual format is very ad-hoc and cannot be parsed back in.

Testing

If you plan to make changes to kernel, get a checkout of the Dartk SDK and run:

tool/regenerate_dill_files.dart --sdk <path to SDK checkout>
pub run test

Linking

Linking from binary files is not yet implemented. In order to compile a whole program, currently everything must be compiled from source at once.