Live data from Hacker News

Cross-platform Rust rewrite of the GNU coreutils

github.com

71–80 of 498 posts

Re: Cross-platform Rust rewrite of the GNU coreutils

#71
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".

Rust is a general programming language, no need to constraint oneself to a single domain.

Re: Cross-platform Rust rewrite of the GNU coreutils

#72

Earlier quoted context omitted.

Windows supports forward-slash fine. Has for at least 25 years. No need to change / to \ or visa versa. Now obviously any Windows port would have to call Win32 APIs instead of POSIX APIs (unless you're writing for a Cygwin-like layer).

Supported, just but it's a second class citizen, for example, no tab completion of directories on the cmd prompt when using forward slash. Some commands will not except it; e.g. type c:\home\foo.txt -> cats it out type c:/home/foo.txt -> 'The syntax of this command is incorrect.' whereas cd will except either forward or backslash cd c:\home/foo cd c:/home/foo work as expected.

Firstly I was talking about API support. Since that is the topic at hand.

Secondly, Cmd is deprecated. Powershell supports both slashes and "type c:/home/foo.txt" works perfectly.

Re: Cross-platform Rust rewrite of the GNU coreutils

#73
post #57

Earlier quoted context omitted.

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!

Ah, understood.

I think neither of these beats actual coreutils and their support base (still under impression of Termux capabilities...), at least not yet.

Re: Cross-platform Rust rewrite of the GNU coreutils

#74
post #41

Earlier quoted context omitted.

It looks like there are 134 instances of 'unsafe', in 23,000 lines of Rust. And it looks like a lot of that unsafe is to FFI into libc. Rust works with GDB, so you end up debugging like anything else. IDE integration is being actively worked on, and sorta-kinda works in my understanding.

What is the roadmap on getting rid of the need for libc? Given how terrible libc is, I personally would make that a high priority, though I guess in Linux you can't even start up a process without libc (maybe that is a misunderstanding?), which makes the situation less clean, but at least you could get to a point where you never call back into it after entry into main.

You don't need a C standard library to run programs on Linux (nor any other system).

My guess is that the Rust team consider that relying on a well tested C codebase is safer than writing tons of unsafe platform-specific code, to replace the functionality offered by libc.

Anyway, I think the Redo project do have a Rust standard library that calls directly the OS and doesn’t need a C library, since they are writing a 100% Rust based stack.

Re: Cross-platform Rust rewrite of the GNU coreutils

#75

I'd really love to use rust, given the large growth of projects like this. I only need an IDE to get started, but it seems like there isn't one yet. Anyone have any pointers on where I can find a good IDE for Rust? Should I just start praying to lord-JetBrains for something that works?

SolidOak is a thing.

Re: Cross-platform Rust rewrite of the GNU coreutils

#76

Earlier quoted context omitted.

Not sure why you're being downvoted. I don't see why we shouldn't be moving to languages like Rust given the chance, as C makes it far more difficult to write safe and correct code.

I expect it's because because the first part is essentially preaching to the choir, and because Richard Hipp very much disagrees with the second part[0] > Rewriting SQLite in Rust, or some other trendy “safe” language, would not help. In fact it might hurt. (see link for expansion on that matter, which is a question of tooling and testing) [0] http://blog.regehr.org/archives/1292#comment-18452

Prof. Regehr did not find problems with SQLite. He found constructs in the SQLite source code which under a strict reading of the C standards have “undefined behaviour”, which means that the compiler can generate whatever machine code it wants without it being called a compiler bug. That’s an important finding. But as it happens, no modern compilers that we know of actually interpret any of the SQLite source code in an unexpected or harmful way.

At some point some popular compiler is going to make a subtle but important change to some undefined behavior that's not going to be immediately obvious as to it's repercussions, and the fallout will be massive. It boggles my mind the mental contortions people will go though to justify what is essentially an argument of "it hasn't caused a problem yet" while ignoring that it's caused many problems already, just not that they've noticed or that have affected them.

Re: Cross-platform Rust rewrite of the GNU coreutils

#77
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.

This is very very weak grounds for any sort of lawsuit.

But if having glanced at GPL source code prevents implementing similar functionalities in an entirely different language, that's a pretty darn strong argument for me to never look at GPL code again.

Re: Cross-platform Rust rewrite of the GNU coreutils

#78
post #41

Earlier quoted context omitted.

What is the roadmap on getting rid of the need for libc? Given how terrible libc is, I personally would make that a high priority, though I guess in Linux you can't even start up a process without libc (maybe that is a misunderstanding?), which makes the situation less clean, but at least you could get to a point where you never call back into it after entry into main.

I don't know what this project's stance is towards libc.

Oh, but I mean in Rust generally. Ideally any language that is not C would not depend on libc.

Re: Cross-platform Rust rewrite of the GNU coreutils

#79

I'd really love to use rust, given the large growth of projects like this. I only need an IDE to get started, but it seems like there isn't one yet. Anyone have any pointers on where I can find a good IDE for Rust? Should I just start praying to lord-JetBrains for something that works?

I don't understand why you need an IDE, I believe Rust is simple enough that you can work on things in Notepad++ or Vim or Emacs.

This is pretty common, and the advantages of Rust won't overcome people being inherently lazy (not in a bad way... lazy in this sense is really more efficient).

People love C# for that very reason, once they get used to Visual Studio, convincing them to switch to something with very limited IDE support is a tough argument. Most people have better things to do with their life. Rust will get there though, just give them time.

Re: Cross-platform Rust rewrite of the GNU coreutils

#80
post #71

Earlier quoted context omitted.

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".

Rust is a general programming language, no need to constraint oneself to a single domain.

So is JS.

But like I said, both implementations suck compared to actual coreutils.

Post reply on HN