Hacker News new | ask | show | jobs
by phillipcarter 2844 days ago
I'm not sure what your environment looks like, but the .NET runtime is not even close to hundreds of MB in size. Unless you distributed a large amount of resources in your self-contained distribution (e.g., many massive images) would it come close to approaching that size.

A development environment includes the .NET SDK, shared framework, and NuGet packages. So that's going to be large in size. But you should never distribute the SDK with a published application. That's pushing a development environment onto a production machine.

1 comments

Yes, you're right, I shouldn't use the development tree for my comparison here. The runtime-only .NET Core 2.1.3 installer for my platform is only (cough) 26.3 MB.

If you then try to get that lower by using self-contained builds, you can only get "Hello, world!" down to about 20 MB:

    $ dotnet new console --language f# -n hello
    $ cd hello
    ...add <RuntimeIdentifier>osx.10.13-x64</RuntimeIdentifier> to fsproj
    $ dotnet publish --self-contained -c release
    $ cd bin/release/netcoreapp2.1/osx.10.13-x64/publish
    $ rm -r ?? ??-?? zh-*                 # nuke i18n
    $ tar -cvJf ~/Desktop/hello.tar.xz .
You'll notice that I'm giving you the benefit of high compression here. The unpacked tree is 70 MB!

The equivalent in C++ is 3.3 kB.

I'm not expecting miracles. As I said, I'd be happy with "only" a 3x ballooning here, roughly commensurate with the coding efficiency benefit. That's fair.