I've been experimenting with static compilation of a program.

First try: 33M
Stripped of symbols: 21M
Compile with "-split-sections": 8.5M
Stripped of symbols: 5M

That's a huge difference when using "-split-sections"! If you don't know what that does, I guess it splits each function into its own section so that the linker can strip out unused sections, which means only code that as actually used will be included in the output.

If you're asking why it isn't enable by default, you're apparently not alone. Looks like it is that way in GHC 8.8; I was compiling with 8.6.

Sign in to participate in the conversation
Functional Café

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!