Like anyone who publishes on the Web these days, I use a static site generator. My site doesn’t have a lot of content - currently (before writing this post) weighs about 100K total, most of which is probably due to Haskell syntax highlighting. So how much does the executable generating it weigh?
99 megabytes. This much code1 is used to generate so little content.
After updating to a new Stackage release, it took 13 minutes to compile all on a 4-core machine.
Why is it that big? First, the generator is written in Haskell, and its glorious compiler is known for being generous with generated code size.
But the bloat doesn’t come from nowhere - there are no less than 167 packages in the dependencies of this static site generator. Here are some of the more interesting ones:
hslua - A Lua language interpreter embedding in Haskell. This package contains a full Lua interpreter version 5.3.4.
Interesting. Note that I barely know Lua, and I’m certainly not using it here. So why it’s present?
http-client - another dependency of Pandoc, used for directly converting documents from a
warp - A fast, light-weight web server for WAI applications.
Hakyll includes a HTTP server for previewing the site.
JuicyPixels - Picture loading/serialization (in png, jpeg, bitmap, gif, tga, tiff and radiance).
Another dependency of Pandoc. Used for converting images in the PDF export module.
The idea of downloading and compiling so much stuff just to generate a bit of HTML seems wrong in some way. But that’s the price of the flexibility of these tools.
Actually it’s a little over 100MB if you count the dynamic libraries.↩