Ask HN: What are some non-standard ways to reduce the size of executable files?

1 FerkiHN 4 7/12/2025, 7:53:29 AM
Please tell me new or interesting ways to optimize executable files or link libraries so/dll do you know?

Comments (4)

jeffreygoesto · 10h ago
Avoid 3rd party dependencies and C++ templates.
sargstuff · 8h ago
Working with / compiling from source code (portable/non-portable): cosmopolitan libc[0]

Each language kinda has own tricks,java[3], rust[4]

From [1] : " A comparison of dietlibc, uclibc, musl, and glibc, by the author of musl: http://www.etalabs.net/compare_libcs.html "

How to make smaller C and C++ binaries[7]

Removing unused code[5] / Exploiting function similarity for code size reduction[6]

-------

[0] : a) https://justine.lol/cosmopolitan/

      b) size tricks : https://justine.lol/sizetricks/
[1] : Dietlibc - a libc optimized for small size : https://news.ycombinator.com/item?id=21291893

[2] : https://interrupt.memfault.com/blog/dealing-with-large-symbo...

[3] : java : https://www.graalvm.org/latest/reference-manual/native-image...

[4] minimizing rust : https://github.com/johnthagen/min-sized-rust

[5] : https://tetzank.github.io/posts/removing-unused-code/

[6] : https://dl.acm.org/doi/10.1145/2666357.2597811

[7] : how to make smaller c and c++ binaries : https://news.ycombinator.com/item?id=35853625

FerkiHN · 7h ago
Thanks for you!
sargstuff · 2h ago
Impliment program functionality in a GNU Jitter/JitterLisp VM[1]. Have program use VM references to do functional computations. aka move program features into a VM, such that program functions/features are now calls to VM. (vs. traditional OS / library calls).

[1] : https://www.gnu.org/software/jitter/