Hacker News new | past | comments | ask | show | jobs | submit login

the syntax is similar to C/java/C++ so the out-of-box experience was great, please keep it. I do hope there is a `dart build`(similar to `dart run`) to run pub-get-then-compile-exe as that's what Go and rust have, it's nothing major, just handy.

I use dart for scripting as well, which works really well.

For deployment I wonder if Dart can be made a little like Go (or C/C++): to build into a single static executable instead of depending on system C shared libraries.

I gave up on Go and embraced Dart, so the `dart build` and `static binary` are kind of what I missed from Golang when started with Dart.




> I do hope there is a `dart build`(similar to `dart run`) to run pub-get-then-compile-exe as that's what Go and rust have, it's nothing major, just handy.

It's "dart compile":

    $ dart compile --help
    Compile Dart to various formats.

    Usage: dart compile <subcommand> [arguments]
    -h, --help    Print this usage information.

    Available subcommands:
      aot-snapshot   Compile Dart to an AOT snapshot.
      exe            Compile Dart to a self-contained executable.
      jit-snapshot   Compile Dart to a JIT snapshot.
      js             Compile Dart to JavaScript.
      kernel         Compile Dart to a kernel snapshot.


not really, dart-compile does not do pub-get automatically, while dart-run does. dart-build is basically a (pub-get + dart-compile) to be "consistent" with other modern languages such as 'cargo build' or 'go build'

    dart_build () 
    { 
        [[ -f pubspec.yaml ]] || return;
        DART=$(grep ^name pubspec.yaml | awk '{print $2}');
        dart pub get;
        dart compile exe bin/"$DART".dart
    }




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: