Live data from Hacker News

Show HN: RustyBox – a Busybox fork written in Rust

github.com

21–30 of 56 posts

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

#21

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?

They understand the tool but not the plan. If they don't like the plan, they may c2rust it themselves and try a different angle.

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

#22
post #13
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.

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 blame the language doing the calling for the bug.

Having said that, these translations are still useful as a starting point, not a destination. Think of a case where the external C API is retained, but all the innards are gradually converted to a more idiomatic codebase.

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

#23

What is this used for? I am interested in contributing

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.

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

#24
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…

`unsafe` is already very prevalent in the ecosystem and this is a big point of contention.

https://github.com/actix/actix-web/issues/289

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

#25

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…

`unsafe` is already very prevalent in the ecosystem and this is a big point of contention. https://github.com/actix/actix-web/issues/289

This would be anecdotal, and caused massive stir in the community when it was realized.

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

#26
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…

> these translations are still useful as a starting point, not a destination.

This was the case for the Go compiler (automatic translation from C to Go), and it has worked out well in practice. There are still some vestiges, but it's moving more and more toward idiomatic Go all the time.

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

#28
post #26

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…

> these translations are still useful as a starting point, not a destination. This was the case for the Go compiler (automatic translation from C to Go), and it has worked out well in practice. There are still some vestiges, but it's moving more and more toward idiomatic Go all the time.

Yeah, this is the broad goal of the project. As much as I love fresh rewrites, I don't think they have nearly the same hope of becoming successful as this sort of gradual approach. It's a big project, and there's lots of code that's still not idiomatic by any means, but the goal is to get 1% better every day.

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

#29

For coreutils actually written from scratch, see a more interesting project: https://github.com/uutils/coreutils

Yeah, I'm a fan of the uutils project but I haven't tested it out myself yet! It would be neat to start incorporating some of those commands into rustybox in place of the old implementations.

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

#30
Making this code more idiomatic seems like a really cool opportunity to get some Rust experience. I imagine there's a ton of low-hanging fruit in here, especially given how minimal and modular the different utilities tend to be. And at the same time, you're touring idioms and optimizations copied from some of the most refined C code out there.
Post reply on HN