site  contact  subhomenews

Oh dear, Rust again

August 04, 2020 — BarryK

Back in April 2020, I made a comment about Rust:

https://bkhome.org/news/201904/easyos-forum-closed.html

Which upset at least one person. Today I received an email suggesting that 'fd' is superior to the 'nnn' file manager. This is my reply:

Thanks for the suggestion.
Unfortunately, fd is written in Rust. It is very difficult to create a small binary when written in Rust -- at least, that is my understanding.
I did a quick search, it is possible to create a fully static rust executable, linking with musl:

https://doc.rust-lang.org/edition-guide/rust-2018/platform-and-target-support/musl-support-for-fully-static-binaries.html

There is another nice console file manager written in python. Same problem. too much overhead to run in the initrd.

I should be careful about making assumptions about Rust, so I found it compiled statically with musl, here:

https://github.com/sharkdp/fd/releases

...the binary is 2.3MB (static, stripped), which would double the size of the initrd!
I tried it, unfortunately it is not a text-mode GUI app like 'nnn', it is only a CLI replacement for 'find'.

Ha ha ha, replacing the tiny 'find' utility with some more features, and bumping the size to 2.3MB, please, no! And it doesn't even provide all of find's capability, quoting from the 'fd' project page:

While it does not seek to mirror all of find's powerful functionality, it provides sensible (opinionated) defaults for 80% of the use cases.

Unfortunately, there are so many people pushing Rust as a systems programming language. 

Tags: linux