@kungtotte @annika You can still reduce the size of the binary using gcc's magic (I never remember how to do it), but it's always quite big comparing with the binaries C generates.
Conversation
Notices
-
Ekaitz Zárraga 👹 (ekaitz_zarraga@mastodon.social)'s status on Wednesday, 14-Nov-2018 09:45:49 CET Ekaitz Zárraga 👹 -
kungtotte (kungtotte@fosstodon.org)'s status on Wednesday, 14-Nov-2018 09:54:42 CET kungtotte @ekaitz_zarraga @annika yeah you can jump through hoops to get there (you can with Nim too), but Nim is already good enough out of the box for 90% of cases that you don't have to do that. It also makes source distribution easier as people can compile using default-ish settings on their system and not get massively bloated binaries.
nim c -d:release --opt:size --passL:static makes for a size optimized statically linked release build. Not hard to remember.
Ekaitz Zárraga 👹 repeated this. -
bugaevc@mastodon.technology's status on Wednesday, 14-Nov-2018 13:25:26 CET bugaevc @kungtotte @ekaitz_zarraga @annika I think you forgot to `strip` it, of course it weighs way less without debuginfo for the whole stdlib:
$ cat fib.rs
fn main() {
let mut a = 0;
let mut b = 1;for _ in 0..10 {
println!("{}", b);
let c = b;
b += a;
a = c;
}
}
$ rustup run nightly rustc fib.rs
$ du -sh fib
2.4M fib
$ strip fib
$ du -sh fib
196K fibEkaitz Zárraga 👹 repeated this.
-