Fasta

Fasta is an integral part of Dart's front-end compiler framework. It's designed to parse Dart source code and generate an intermediate representation known as Kernel. This Kernel is a binary format representing Dart programs that is used by the Dart VM and other Dart tools.

The name 'fasta' sounds like "faster".

Fasta is responsible for several stages of the Dart compilation process, including parsing, type inference, and generating Kernel binary files. It is a crucial component in Dart's toolchain, allowing for efficient compilation of Dart code into a format that can be executed by the Dart runtime.

The usage of Fasta inside Dart SDK includes:

Key Features

  1. Parsing: Fasta parses Dart source code into an abstract syntax tree (AST), which is a tree representation of the source code's structure.
  2. Type Inference: Fasta performs type inference on the Dart code. It tries to deduce types where they aren't explicitly mentioned, helping the Dart language support both dynamic and strong typing.
  3. Error Checking: During the parsing and compiling stages, Fasta also checks for errors in the code, both syntactic and semantic.
  4. Kernel Generation: Fasta generates Kernel files, which are a lower-level, platform-independent representation of the Dart code. These files are used by the Dart VM and Dart AOT (Ahead-Of-Time) compiler.

Fasta command line

Fasta is also a command line bash script located at pkg\front_end\tool\fasta

It has serveral subcommands:

Source code

pkg\front_end\lib\src\fasta\

Web Resources


本文作者:Maeiee

本文链接:Fasta

版权声明:如无特别声明,本文即为原创文章,版权归 Maeiee 所有,未经允许不得转载!


喜欢我文章的朋友请随缘打赏,鼓励我创作更多更好的作品!