Live data from Hacker News

Show HN: RustyBox – a Busybox fork written in Rust

github.com

51–56 of 56 posts

Re: Show HN: RustyBox – a Busybox fork written in Rust

#52

Earlier quoted context omitted.

busybox provides coreutils, with a focus on being as stripped-down as possible. in other words, busybox provides binaries like cat, ls, nano, sudo, etc. (basically enough to be able to do shell scripting) for use in memory-constrained embedded linux systems like internet routers or in-vehicle infotainment systems.

Gotcha. Might be out of my league

don't discount it!

can you write a program that opens a text file and dumps its contents on STDOUT? then you can write `cat`! and there are oodles of tools that are as simple as that.

the nice thing about contributing to a busybox-like distribution of coreutils is that they intentionally leave out the bells and whistles, since the target systems are memory-constrained. and you can do the development and testing right on your workstation. busybox is designed to be suitable for embedded devices, but the tools will run on any device with a linux kernel, as long as you can compile for the target CPU.

Re: Show HN: RustyBox – a Busybox fork written in Rust

#53
post #2

Seems to consist mostly of a copy of Busybox’s C code auto-translated to Rust using c2rust – resulting in ubiquitous use of raw pointers and `unsafe` for mundane operations. That’s technically “written entirely in Rust”, but not in the way you’d expect… On the other hand, it could serve as a good starting point for a gradual rewrite into idiomatic Rust.

To be fair, it calls itself a fork of Busybox, which implies that most of its source originated in Busybox.

Re: Show HN: RustyBox – a Busybox fork written in Rust

#54
post #13

Earlier quoted context omitted.

Rust is going to take credibility hits if more people do this. Once it becomes socially acceptable to use unsafe all over the place in the community, it might be hard to win the user trust back.

I don't think 1) unsafe will ever become prevalent in the ecosystem nor 2) that unsafe should be seen as anything other than an escape hatch that is sometimes necessary. Autotranslations from C will be seen as what they are, a transliteration from a less safe language with exactly the same bugs as the preexisting codebase. You could think of the case of calling a COM library that has a leak or a OOB error, I wouldn't…

> Autotranslations from C will be seen as what they are, a transliteration from a less safe language with exactly the same bugs as the preexisting codebase.

Yes. But I agree with the parent that there is a credibility problem here. The featured repository calls itself a fork "written entirely in Rust" (emphasis mine). It doesn't call itself "autotranslated to Rust". There would be enough room for that in the title, but the author decided to spend that room on calling it "free-range, non-GMO" instead. It doesn't acknowledge the point you raise, that this is apparently much closer to a starting point than to the destination.

The README is somewhat circumspect about the fact that this is autotranslated. It does mention c2rust, but doesn't actually say anything about the status of a conversion to safe, idiomatic Rust. There is a long list of commits which suggest that the author did a lot of manual fixes, so something was done beyond just autotranslation, but it's hard to judge.

So I think the credibility danger is that if HN were to get more frequent "X written in Rust" that would turn out to just be "X autotranslated to Rust", at some point the community might tire of upvoting these, and other "X actually written in Rust" submissions might get buried. Or similarly, instead of a general "it's feasible and useful to rewrite X in Rust" impression, the wider community (somewhat open to Rust but not diehard fans) might get an impression of "even Rust fans are too lazy to actually rewrite stuff in safe Rust".

Re: Show HN: RustyBox – a Busybox fork written in Rust

#55

What is this used for? I am interested in contributing

Out of curiosity, how does one become interested in contributing to a thing when one doesn't even know what the thing is?

He asked what it was used for, not what it does.

Re: Show HN: RustyBox – a Busybox fork written in Rust

#56

Earlier quoted context omitted.

I don't think 1) unsafe will ever become prevalent in the ecosystem nor 2) that unsafe should be seen as anything other than an escape hatch that is sometimes necessary. Autotranslations from C will be seen as what they are, a transliteration from a less safe language with exactly the same bugs as the preexisting codebase. You could think of the case of calling a COM library that has a leak or a OOB error, I wouldn't…

> Autotranslations from C will be seen as what they are, a transliteration from a less safe language with exactly the same bugs as the preexisting codebase. Yes. But I agree with the parent that there is a credibility problem here. The featured repository calls itself a fork " written entirely in Rust" (emphasis mine). It doesn't call itself "autotranslated to Rust". There would be enough room for that in the title,…

But doesn't "fork" imply that it's not actually a re-write or a clone?
Post reply on HN