I've been dabbling with a desktop toy application. I have it finally "done" and am in the process of working out packaging it so folks can use it.

It's written in Java with JavaFX. Short term I'm reasonably comfortable with folks downloading a "fat jar" and then grabbing the JDK on their own, and, perhaps, firing off a .sh or .bat file to run it. Mostly because I don't have a Windows box to try the whole jlink or jpackage process.

But then I started packaging it up for delivery.

JavaFX has platform dependent shared libraries, all of which would need to be bundled in the fat jar.

After building it, the result came out to 48MB... .. .

This "app" is a pane with about 20 controls on it and a GO button. It's less then 2000 lines of code. And the deliverable is 48MB.

I know, I know, that fancy animated GIF icon on that forum for someone's Avatar is probably 48MB.

But that doesn't mean it doesn't chafe me to do so. That's not even including the JDK.

I shouldn't care, but it was soul crushing.

On total whimsy, I tried Flutter. I downloaded it, and built "Hello World" for macOS. Not only did it take an eternity to compile (on my modern, SSD enabled, eleventy gigablip iMac), the result was 108MB. And that was just for the Mac version, I'd need 2 others for Linux and Windows. The compile time was glacial (I know, its got hot reloading to speed things up).

I'm sure the Electron vesion artifact is similar.

I should just shut up and take it, but it rubs me the wrong way. I'm currently exploring the possibility of doing it as a PWA targeting Chrome, dunno how well that will work, but apparently with Chrome you can save and load local files (which is something I want to do). But I can't see my large vision being done as a PWA.

I should put my head down, blinders on, and push on through.

But for the moment, I'm irked.

> On total whimsy, I tried Flutter. I downloaded it, and built "Hello World" for macOS. Not only did it take an eternity to compile (on my modern, SSD enabled, eleventy gigablip iMac), the result was 108MB. And that was just for the Mac version, I'd need 2 others for Linux and Windows. The compile time was glacial (I know, its got hot reloading to speed things up).

I'm curious how you got 108mb. Here's what I'm seeing:

  $ flutter --version
  Flutter 3.0.4 • channel stable • 
  https://github.com/flutter/flutter
  Framework • revision 85684f9300 (7 days ago) • 2022-06-30 13:22:47 -0700
  Engine • revision 6ba2af10bb
  Tools • Dart 2.17.5 • DevTools 2.12.2
  $ flutter create hello_world && cd hello_world
  Creating project hello_world...
  Running "flutter pub get" in hello_world...                      1,764ms
  Wrote 127 files.

  All done!
  In order to run your application, type:

    $ cd hello_world
    $ flutter run

  Your application code is in hello_world/lib/main.dart.

  $ flutter build macos

  Building with sound null safety

  Building macOS application...

  $ du -ah build/macos/Build/Products/Release/hello_world.app | tail -1
   44M build/macos/Build/Products/Release/hello_world.app
Note, the release build is significantly smaller than the debug build, which includes a full Dart VM for hot swapping application code:

  $ flutter build macos --debug

  Building with sound null safety

  Building macOS application...

  $ du -ah build/macos/Build/Products/Debug/hello_world.app | tail -1
   98M build/macos/Build/Products/Debug/hello_world.app
Note, on the glacial compiles, here is what I'm seeing on my M1 mac laptop:

  $ time flutter build macos

  Building with sound null safety

  Building macOS application...
  flutter build macos  1.20s user 0.59s system 47% cpu 3.801 total
It's slower than building web pages in vim, but this is comparable with compiling desktop applications in Xcode.

Disclosure: I'm a Developer Relations Engineer for Flutter