Search code examples
flutterdartflutter-desktop

Windows Desktop application wrote with Flutter, compiled to machine code or bytecode?


I want to build an application using flutter.

According to Flutter website:

Get native-compiled performance without large browser engine dependencies.

Are flutter app's compiled to machine code or byte code?


Solution

  • There are multiple ways to run Dart programs. Please refer to the dart compile documentation.

    Quoting from referenced page, a few of the compilation options include:

    • exe: A standalone, architecture-specific executable file containing the source code compiled to machine code and a small Dart runtime.
    • aot-snapshot: An architecture-specific file containing the source code compiled to machine code, but no Dart runtime.
    • jit-snapshot: An architecture-specific file with an intermediate representation of all source code, plus an optimized representation of the source code that executed during a training run of the program. JIT-compiled code can have faster peak performance than AOT code if the training data is good.

    Note: You don’t need to compile Dart programs before running them. Instead, you can use the dart run command, which uses the Dart VM’s JIT (just-in-time) compiler--a feature that’s especially useful during development.