blob: 77002bb8c7218dd43c5ddc43d67be67eb59a5c79 [file] [log] [blame] [view]
Asger Feldthaus4045d8c2016-11-25 10:22:081Moved
2=====
3
4This has moved into the [Dart SDK repository](github.com/dart-lang/sdk).
5
6This repository is not kept up-to-date.
7
Asger Feldthausdfb9c502016-04-26 08:29:558Dart Kernel
Asger Feldthaus02604e92016-04-26 08:39:159===========
10**Dart Kernel** is a small high-level language derived from Dart.
11It is designed for use as an intermediate format for whole-program analysis
12and transformations, and as a frontend for codegen and execution backends.
13
14The kernel language has in-memory representations in Dart and C++, and
15can be serialized as binary or text.
16
Asger Feldthaus7f8c0ea2016-08-26 08:16:5417Both the kernel language and its implementations are unstable and are under development.
Asger Feldthaus02604e92016-04-26 08:39:1518
19This package contains the Dart part of the implementation and contains:
20- A transformable IR for the kernel language
21- A frontend based on the analyzer
22- Serialization of kernel code
23
Asger Feldthaus7f8c0ea2016-08-26 08:16:5424Getting Kernel
25------------
Asger Feldthaus02604e92016-04-26 08:39:1526
Asger Feldthaus7f8c0ea2016-08-26 08:16:5427Checkout the repository and run pub get:
28```bash
29git clone https://github.com/dart-lang/kernel
30cd kernel
31pub get
32```
Asger Feldthaus02604e92016-04-26 08:39:1533
34Command-Line Tool
35-----------------
36
37Run `bin/dartk.dart` from the command-line to convert between .dart files
38and the serialized binary and textual formats.
39
Asger Feldthaus5ad5fa82016-07-19 15:52:3340`dartk` expects the `.dill` extension for files in the binary format.
Asger Feldthaus02604e92016-04-26 08:39:1541The textual format has no preferred extension right now.
42
43Example commands:
44```bash
45dartk foo.dart # print text IR for foo.dart
Asger Feldthaus5ad5fa82016-07-19 15:52:3346dartk foo.dart -ofoo.dill # write binary IR for foo.dart to foo.dill
47dartk foo.dill # print text IR for binary file foo.dill
Asger Feldthaus02604e92016-04-26 08:39:1548```
49
50Pass the `--link` or `-l` flag to link all transitive dependencies into one file:
51```bash
Asger Feldthaus5ad5fa82016-07-19 15:52:3352dartk myapp.dart -ppackages -l -omyapp.dill # Bundle everything.
53dartk myapp.dill # Print it back out in a (very, very long) textual format.
Asger Feldthaus02604e92016-04-26 08:39:1554```
55
56See [ast.dart](lib/ast.dart) for the in-memory IR, or [binary.md](binary.md) for
57a description of the binary format. For now, the textual format is very ad-hoc
58and cannot be parsed back in.
59
60
Asger Feldthaus7f8c0ea2016-08-26 08:16:5461Testing
62-------
63
64If you plan to make changes to kernel, get a checkout of the Dartk SDK and run:
65```bash
66tool/regenerate_dill_files.dart --sdk <path to SDK checkout>
67pub run test
68```
69
70
Asger Feldthause5262de2016-10-20 11:12:4171Linking
Asger Feldthaus02604e92016-04-26 08:39:1572-------------------------
Asger Feldthause5262de2016-10-20 11:12:4173Linking from binary files is not yet implemented. In order to compile a whole
74program, currently everything must be compiled from source at once.