Hacker News new | ask | show | jobs
by norbert515 135 days ago
Thanks!

Binaries in Dart are definitely larger than 200kb, I just AOT compiled one of the examples and it was ~7.4MB (arm64 MacOS). Dart has a few different targets it can compile to, but it generally requires a couple of MBs, as it packages the whole runtime.

Yeah, my goal definitely is to have to as close to Flutter where it makes sense. You should mostly be able to copy it over 1:1, with a couple of caveats (GUI and a TUI app have a few differences here and there).

1 comments

That's what it was! I really, really wanted to use Dart because I love Flutter (only ever used it through FlutterFlow and was duly impressed) but I couldn't get around the binary size, mainly because I'm supporting WASM as a backend so it needs tiny binaries.

How did you handle the WASM backend? That part was extremely impressive to me. But aren't the binaries practically too large for WASM?

In any case, really love what you're doing and will be following progress. Outstanding work!

I haven't actually tried WASM yet. The demo on the landing page is using Dart transpiled to JS (embedded in xterm.js). But Dart does also support compiling to WASM directly, I'll give it a try tomorrow and let you know about the stats!
Compiling to WASM is a huge reduction in size (as we don't need to ship a runtime etc. ourselfes anymore), but that requires some browser runtime. Dart specifically doesn't support standalone WASM (outside of the JS/browser context) yet.

I was able to get a WASM binary as small as ~234 KiB!