Live data from Hacker News

Cross-platform Rust rewrite of the GNU coreutils

github.com

51–60 of 498 posts

Re: Cross-platform Rust rewrite of the GNU coreutils

#51
post #14

Earlier quoted context omitted.

Ok, I'll bite. What's wrong with "echo -n"?

http://www.in-ulm.de/~mascheck/various/echo+printf/ is the raw data version. POSIX defines echo as only taking string parameters and no options, but notes that behaviour facing `-n` is implementation-defined. BSD and GNU echo implement `echo -n` as not printing a trailing newline, but `echo` commonly calls to a shell builtin which may or may not follow that behaviour (and may switch behaviour depending on whether the…

Whoever wrote the POSIX spec was too conservative. -n should mean no newline(s). Anything else is wrong.

Re: Cross-platform Rust rewrite of the GNU coreutils

#52

What are the licensing implications for this kind of work? I assume the authors used GNU coreutils as more than just inspiration. They probably read all the original code and reused some of the solutions (obviously ported to Rust). Shouldn't the derivative work still be covered by the GPL?

This is a terrific project idea, but I agree that it should likely be under the GPL. Even if it is not legally derivative, it would be nice to preserve the GPL.

Re: Cross-platform Rust rewrite of the GNU coreutils

#53
post #11

Is there a real need for this project ? I mean, this project has been used for a long time, could it really be better ? Do you intend to replace GNU coreutils ? Not to be mean, just a genuine question (and yes I read the Why section of the readme).

How great would it be if coreutils could get replaced with this implementation? We've seen vulnerabilities come from here before.

What is the primary danger of bugs in coreutils? Are there any setuid programs in there that could be used to elevate? Or is it the ability to exploit shell scripts using them? Or files that when you manually process them with coreutils install a trojan?

Re: Cross-platform Rust rewrite of the GNU coreutils

#54
post #40
post #4

Rewriting coreutils is neat, but a project I'd really look forward would be a strict POSIX base expanded with warnings or errors on valid but risky constructs e.g. echo -n. Even more so if it included a shell (with static analysis of useless uses and dangerous patterns). That would make writing cross-shell scripts much easier.

What exactly is this thing with 3 people commenting "I'll bite"? How is that the most obvious response to parent's observation about echo?

The OP is "luring" people with a small amount of information i.e. "bait," and other people will "bite," as a fish would, to learn the rest of the info.

Re: Cross-platform Rust rewrite of the GNU coreutils

#55

What are the licensing implications for this kind of work? I assume the authors used GNU coreutils as more than just inspiration. They probably read all the original code and reused some of the solutions (obviously ported to Rust). Shouldn't the derivative work still be covered by the GPL?

Well, that's a very large assumption, and it is a big part of that answer. I have sent in a few PRs to this project, and I have never done more than maybe glance at the source of coreutils, and it was for unrelated reasons. can't speak to the regular contributors, though.

"Maybe glance" might well make it derivative.

Re: Cross-platform Rust rewrite of the GNU coreutils

#56
post #46

How big are the executables when compiled, especially compared to the C versions? I hope it's not Rust version 2 MB, C version 6 KB.

Well, that would be a statically linked Rust version vs a dynamically linked C version. Either of those languages can produce binaries of either size. Statically link a MUSL libc and it'll be bigger than 6kb, dynamically link the rust code and use the system allocator instead of jemalloc and it'll be smaller than 2MB. (Or rather, it should be, I haven't literally tried it. The smallest known Rust executable is 151 bytes.)

Re: Cross-platform Rust rewrite of the GNU coreutils

#57
post #2

It certainly beats using NodeJS. EDIT: Yea, this was meant as a reference to the coreutils-in-nodejs post on the frontpage.

NodeJS is for applications, Rust is for system programming. How does one beat another? It's akin to saying "ARMv7 assembly beats using Java for Android programming".

He is probably referring to this: https://news.ycombinator.com/item?id=11334597 -- discussion on CoreUtils in Javascript!

Re: Cross-platform Rust rewrite of the GNU coreutils

#58
post #55

Earlier quoted context omitted.

Well, that's a very large assumption, and it is a big part of that answer. I have sent in a few PRs to this project, and I have never done more than maybe glance at the source of coreutils, and it was for unrelated reasons. can't speak to the regular contributors, though.

"Maybe glance" might well make it derivative.

It might. I'm hedging because I can't even asset that I've _never_ looked at it, I've been doing C off and on for a very long time. But regardless, my two or three patches aren't the worry here. Or rather, every patch is, but if it came into question, they'd be easily removed.

Re: Cross-platform Rust rewrite of the GNU coreutils

#59
post #2

It certainly beats using NodeJS. EDIT: Yea, this was meant as a reference to the coreutils-in-nodejs post on the frontpage.

NodeJS is for applications, Rust is for system programming. How does one beat another? It's akin to saying "ARMv7 assembly beats using Java for Android programming".

Parent comment probably refers to [1] submitted earlier today.

[1] https://news.ycombinator.com/item?id=11334597

Re: Cross-platform Rust rewrite of the GNU coreutils

#60

Earlier quoted context omitted.

If you've never programmed without an IDE I strongly encourage you to give it a go. You'll learn a lot! [Good lord, a downvote on this? I'm being completely sincere.]

I learned how to program without an IDE, and I'm a pretty big fan of it. And strongly typed functional languages with type inference tend to be really easy to write and refactor without needing specialized IDE tasks for the job. That being said, nowadays I use an IDE because it is extremely helpful to have autocomplete (which is okay with Racer+Vim, but kinda hacky) as well as the hover for type information (name of…

[this post was wrong]
Post reply on HN