rustybox, an experimental fork written entirely in Rust

Markus Gothe nietzsche at lysator.liu.se
Fri Nov 15 00:45:30 UTC 2019


You think of the utterly horrible golang aka "go" stuff being static, rust has a very correct approach and supports DSOs.

//M

Sent from my BlackBerry — the most secure mobile device


	  Original Message  



From: eschwartz at archlinux.org
Sent: 15 November 2019 01:35
To: busybox at busybox.net
Subject: Re: rustybox, an experimental fork written entirely in Rust


On 11/14/19 5:33 PM, Markus Gothe wrote:
> How do you think that fatso library aptly named librust would fit into any
> modest embedded system? Well it doesn't and you never thought of that in the
> first place which makes the rest of your assumptions more damaging than any good.

I was under the impression that rust programs don't depend on librust at
all, due to being statically compiled. My instinctive reaction to
porting anything to rust would instead first center around "is rust
itself portable?"

To which the answer is a resounding no. C compilers are everywhere, and
busybox should be able to compile and run on any unix-like platform, one
hopes, whereas rust is only available on platforms that the reference
implementation of rust (the only implementation of rust) is available.
Rust is also written in rust so you cannot bootstrap it to new
platforms. Rust only has first-class support for Windows, Linux, and macOS.

That being said, the size of a statically compiled rust program is also
of concern. A minimally viable hello_world.rs compiled with static musl
libc, and stripped, is 248K -- a minimally viable hello_world.c compiled
with musl-gcc -static is 16KB.

(At least it is not as bad as golang, where "hello world" is 1.4 MB,
larger than the entire busybox suite with all the fatty options enabled
for my desktop build.)

Also google-fu says you can "cheat" by embedding non-rust inside your
rust, to reduce some overhead of using rust:
https://lifthrasiir.github.io/rustlog/why-is-a-rust-executable-large.html

But on the whole it seems simpler to stick with what is known to work
and has no known downsides.

--
Eli Schwartz
Arch Linux Bug Wrangler and Trusted User


_______________________________________________
busybox mailing list
busybox at busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list