3 ms·
Is it unreasonable of me to lose all interest in linux development upon seeing a command line exe to add two numbers is 3.1MB, and not just that but have it's b
by carrolldunham 6y ago
Is it unreasonable of me to lose all interest in linux development upon seeing a command line exe to add two numbers is 3.1MB, and not just that but have it's being 3.1MB treated casually as just interesting/cute by a linux dev?
- eatingCake 6y agoIt may be worthwhile to point out that the example is built in debug mode, and also Rust is including the whole standard library in the output. Re-configuring some low hanging fruit [1] reduces the binary size on my test machine to 27K. This is still not small, granted. [1] https://github.com/johnthagen/min-sized-rust https://github.com/johnthagen/min-sized-rust
- executesorder66 6y agoWhat does this have to do with Linux? If he compiled it on windows it would have been a similar size. As eatingCake already mentioned this is not optimized for release, but for debugging.
- Joker_vD 6y agoAlmost empty .NET executables are 8 KB. Almost empty MSVC executables are less than 64 KB.
- executesorder66 6y agoI'm asking what this has to do with Linux. This is not a discussion of rust vs .NET. this is a discussion of Linux vs windows. So I don't see how your comment is at all relevant. If you compile the exact same rust code in the post on a windows machine, using cargo like in the post, then is the resulting windows executable file size really any different compared to the linux one?
- userbinator 6y agoMSVC somehow wants to link statically by default, but if you use dynamic linking an empty executable shrinks to around 4k.
- mhh__ 6y agoSurely just strip the executable/LTO? Where else is there to go anyway, Forth running on a microcontroller?
- bregma 6y agoIt's possible to write bloated software for any operating system or execution environment. It's not considered particularly interesting for very many Linux devs. If you don't understand how debug information works, or where the bits that provide your language, library, and OS runtime live, then you might well be surprised that they exist at all. It is, after all, sufficiently advanced technology.
- a1369209993 6y agoA little, because your observation evidences bad default configuration of one particular compiler targeting linux rather than a inherent property of linux develoment in general. To be fair, this is a recurring problem with modern mainstream compilers (linux and otherwise), though. See http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm... for a example of going very far (maybe even too far, once they start overlapping things, but YMMV) in the opposite direction.