Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not sure that properly written C version would have bigger size (assuming that unnecessary code is stripped, of course).


Curious: how does Rust cope in this regard?


They're on the bigger side, due to a combination of defaulting to static linking, some optimizations not having been possible (ThinLTO comes to mind), lots of debug strings and metadata, as well as the use of jemalloc[1][2].

[1]: https://jamesmunns.com/blog/tinyrocket/ [2]: https://users.rust-lang.org/t/rust-binary-sizes-once-again/1...


You're talking binary size, the zip file being referred to is the entire git repo in zip format. How large the Rust code would be is an interesting question.

Interestingly, the repo notes the binary is only 6kb. I doubt C or C++ will get anywhere close to that.


If they're downloading the zip file from GitHub, then no, the zip only contains a snapshot of the current master branch.


Well if you only use libc like the assembly server does, I imagine you can use `#![no_std]`. Your Rust will use `unsafe` a lot and be very unidiomatic, but small. Is using the system allocator for binaries on stable yet?


Next release.


There it is!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: