Thoughts on Rust bloat (2019)
This was written a year and a half ago, but I think holds up pretty well. Some thoughts.<p>First, one lesson is that the exact wording in headlines matters. Many people interpreted the essay to say &quot;Rust has a bloat problem,&quot; which is not what I was trying to say. Bloat is unfortunately a super common problem in the modern world, and Rust is not immune. But Rust also gives the end developer a lot of control, and is capable of producing wicked-lean programs (at some cost) if that&#x27;s the goal. The point of the essay was to give practical advice on how to reduce compile times and executable size. From that perspective, publishing the essay was a pretty big success, as it immediately provoked improvements in the gfx-hal project.<p>Serialization continues to be a problem. Now, something like half the compile time and executable size for Runebender is serialization for the XML-based UFO file format for representing fonts. I think a better solution to serialization might make a good project for a smart, motivated person, but it&#x27;s pretty far away from current academic fads, and there&#x27;s also this thing that a lot of people have tried and we&#x27;re still not in a great place. What about serialization makes it so intractable? Could some kind of language support make it better?<p>Also, from followups in UI threads, the expectation for what constitutes &quot;bloat&quot; is very different for different people. The calculator example in Druid is now about 1.5M (release build, Windows), which I think is acceptable for most people, but I&#x27;m also aware that a simple calculator like that could be built in a couple hundred k or so without too much problem, and I&#x27;m sure much less if you start using demoscene style techniques. But I also don&#x27;t want to focus on that too much - I don&#x27;t want tiny calculator demos, I want rich applications that work in all languages (including input methods) and also play nicely with accessibility tools such as screen readers. That can&#x27;t be, and shouldn&#x27;t be, a tiny little executable.