5 ms·
> exa is written in Rust, so it’s small I suspected this would be total bullshit, and it is. Its small binary is a mere 3.4 megabytes. I wonder if I misinterpr
by tadzik_ 9y ago
> exa is written in Rust, so it’s small
I suspected this would be total bullshit, and it is. Its small binary is a mere 3.4 megabytes. I wonder if I misinterpreted the "small" part.
- nonsince 9y agoCompared to JavaScript, one would guess. Rust is capable of generating extremely small binaries but none of the compiler's defaults are amenable to it
- steveklabnik 9y agoAs usual, you have to consider static vs dynamic linking, all sorts of other stuff. Good overview and HN discussion of this: https://news.ycombinator.com/item?id=11823949 https://news.ycombinator.com/item?id=11823949
- wongarsu 9y agoIt's a lot bigger than conventional ls, but compared to a node.js implementation or Java program the description "small, fast" seems justified.
- hak8or 9y agoWell, I have to admit, it is smaller than a docker container of alpine Linux containing the ls binary! Still doesn't mean it's monstrously large for no good reason.
- Sharlin 9y agoWhy would I want to compare apples to oranges? Though admittedly in this crazy day and age someone has probably already reimplemented coreutils in node.js just because.
- wongarsu 9y agoI have seen my fair share of javascript-based console applications. My guess is that the author tries to assure us that exa is no such thing but behaves reasonably for a console application (not gigantic, not incredibly slow) and makes his statements in that light.
- hepek 9y agoAfter strip it is 1.1M.
- hk__2 9y agoFor comparison, ls is 38k on macOS (edit: and coreutils’ ls is 138k).
- michaelcampbell 9y agoInteresting; du reports on mine at 20k. % du -h /bin/ls 20K /bin/ls Although as you mention... % ls -laF /bin/ls -rwxr-xr-x 1 root wheel 38624 Jul 15 00:29 /bin/ls*
- simias 9y agoRust links all its runtime statically by default. Your /bin/ls is probably dynamically linked to libc and a few others. That being said that the argument of size is a bit silly to begin with, especially for a 3MB binary.
- flukus 9y ago> That being said that the argument of size is a bit silly to begin with, especially for a 3MB binary. For a single app, sure it's no problem, but what about when the thousands of other programs in bin introduce similar levels of bloat? Another one is ripgrep, weighing in at 5MB compared to greps 204kb. And this is just for fairly simple command line tools, Imagine what life will be like when we have UI toolkits like QT statically compiled into everything.
- burntsushi 9y ago> Another one is ripgrep, weighing in at 5MB compared to greps 204kb. Did you strip both binaries? If I strip rg after compiling it, it shrinks to 2.7MB on Linux. If I strip the distributed binary on Github (which is statically linked with musl), then it shrinks to 2.4MB. > Imagine what life will be like when we have UI toolkits like QT statically compiled into everything I imagine Qt will be dynamically linked, so I'm not sure why you'd say that. Of course, if you want to statically link something like Qt because it makes distribution easier for $reasons, then that's a different story. But that has nothing to do with Rust.
- deleted 9y ago[deleted]
- cytzol 9y agoI wouldn't say it's bullshit, just a difference of opinion. 38 kilobytes of executable isn't small, it's tiny; there's no way exa could get to that level without compromising its featureset or development, and even if you did, you'd just have another ls, and we already have ls. If it's not small, what would you call it? Medium-sized? Something of that size means "download tens of megabytes of runtime and scatter files all over your computer" to me, and exa's smaller than that.
- flukus 9y ago> 38 kilobytes of executable isn't small, it's tiny; there's no way exa could get to that level without compromising its featureset or development I'd be willing to bet dynamic linking would get it much closer to that ballpark and wouldn't compromise the feature set or development.
- saagarjha 9y agoDynamic linking to what, though? The features you're looking for have to available in a library for you to be able to link to it.
- steveklabnik 9y agoThe standard library for one; many C programs have libc dynamically linked. Rust's stdlib isn't.
- flukus 9y agoDynamic linking to the standard library + the projects dependencies, from the cargo file: ansi_term = "0.8.0" datetime = "0.4.3" getopts = "0.2.14" glob = "0.2" lazy_static = "0.2" libc = "0.2.9" locale = "0.2.1" natord = "1.0.7" num_cpus = "1.3.0" number_prefix = "0.2.3" scoped_threadpool = "0.1.*" term_grid = "0.1.2" unicode-width = "0.1.4" users = "0.5.2"
- userbinator 9y agoIf it's not small, what would you call it? Self-contained, portable, featureful, etc. There are plenty of other adjectives to say it's not huge or "download tens of megabytes of runtime and scatter files all over your computer". For me, <64KB is small and <4KB is tiny. But then again, being aware of the demoscene, I've seen what can be done in those size categories... ;-)