What is making a static library in Rust being much large than Go, Zig, and C#?

126 points metaltyphoon 65 comments

Hello! I've been trying to understand how I can trim a Rust staticlib to its bare minimum. For instance, I've create a repository to show what I mean. I have a much large static library which targets iOS and the sizes are in the ~30MB range when in release mode. This is not really ideal because in an xcframework I need to pack one for macOS and two for iOS (simulator and non simulator version) and the file is almost 100MB in debug mode.

Any way to help would be appreciated. Thanks