sdk icon indicating copy to clipboard operation
sdk copied to clipboard

I wish for `dart run --aot`

Open matanlurey opened this issue 4 months ago • 2 comments

For small Dart binaries with few dependencies, dart run binary.dart is sufficient.

For larger binaries, where you can afford to run a resident compiler as you make changes:

dart run --resident binary.dart

There are a lot of shell scripts, python scripts, and Dart code that essentially does something like:

// Pseudo code
final snapshot = await compileScriptIfChangesMade(pathToDartFile);
await runSnapshot(snapshot);

... because the binary is not expected to change often (--resident is less helpful), or even we'd want to take advantage of AOT compilation. I'd love for this to be as easy as dart run binary.dart --snapshot-kind=aot-snapshot, or similar.

matanlurey avatar Jun 12 '25 00:06 matanlurey