Live data from Hacker News

Cross-platform Rust rewrite of the GNU coreutils

github.com

451–460 of 498 posts

Re: Cross-platform Rust rewrite of the GNU coreutils

#451
post #247

Earlier quoted context omitted.

What on earth does the GPL have to do with owning _ideas_? Please explain. Also, do you think that Linux, for example, is draining the world's resources? If so, how?

If your code is GPLed you impose a cost on someone else to use it. Whether or not that cost is morally justified is not the point of the objection. I am making no judgment as to the righteousness of the goal of using a GPL or similar license. By using a GPL you strictly limit who can consume your code to those who are willing to be bound by your views on what is right. In this way (and limited explicitly to the scope…

Curious: I'm an admirer of Friedman and a developer of GPL code. (GPLv3 is my default for new code.)

Note that you can offer your code on different terms to customers who won't 'pay' the GPL. Is your position that software should be public domain?

Re: Cross-platform Rust rewrite of the GNU coreutils

#452

Earlier quoted context omitted.

Do you think C managed to get things exactly right? Or should we add more kinds of undefined behavior? What do we do about the fact that undefined behavior actually makes it harder or impossible to write efficient code in some cases, like checking for integer overflow? Even if your goal is performance over anything , there are a whole lot of undefined behaviors that have absolutely zero performance benefit.

> What do we do about the fact that undefined behavior actually makes it harder or impossible to write efficient code in some cases, like checking for integer overflow? This is a good example of why we should be moving away from C. :) Signed overflow being undefined is basically necessary due to a self-inflicted wound from 1978: the fact that "int" is the easiest thing to type for the loop index when iterating over a…

It just seems like such a waste to abandon C instead of smacking compiler/spec writers and getting them to specify behavior that was de-facto specified for decades.

C should be writable by humans.

Re: Cross-platform Rust rewrite of the GNU coreutils

#453
post #249

Earlier quoted context omitted.

> That said, array bounds checking is responsible for so many problems, it seems worth it to raise the minimum for a language. Amen to that! If I could just add one feature to C - at least as an option - it would be array bounds checks. I have no trouble with manual memory management - a garbage collector is nice to have, but I have not had many problems with memory leaks or dangling pointers. And the ones I had were…

> I have not had many problems with memory leaks or dangling pointers. And the ones I had were relatively easy to locate and fix. Note that every single browser vulnerability in this year's Pwn2Own was a use after free (dangling pointer).

Well. I'll gladly admit that the C code I have written was way less complex than a web browser. When I still wrote C code for a living, I worked on an application suite that was ~250k lines of code, maybe ~300k, in total, whereas e.g. Firefox is a couple of million lines. I assume other mainstream browsers are similarly big.

Plus, what a browser does is, by nature, a lot more complicated than what I worked on.

EDIT: What I am trying to say is: I do not mean to trivialize use-after-free bugs, but in my personal experience, I did not run into many, while I witnessed (and caused, I am afraid) a bunch of array bounds violations, and they sometimes made me want to cry.

Re: Cross-platform Rust rewrite of the GNU coreutils

#454
post #286

Though I like ideas behind Rust but the code is awful. If you look at the code you'll see a lot of misterious symbols (as in Perl) and strange constructs like wrap, unwrap, Arc etc. They make the code less readable. Also Rust doesn't have exceptions so you have to wrap almost any function call with let/match/Ok/Err. Ugly. I looked at one random file which turned out to be a `du' command implementation: https://github…

Just wrt the let/match/Ok/Err == ugly comment: I don't know Rust very well and I haven't looked very closely at the code in question, but why would Rust force you to wrap almost any function call with let/match/Ok/Err, though? I am assuming the issue at hand here is when you call function that returns a Result (if that's the name of the parent of Ok/Err)? Couldn't one let the return values 'flow up'? For example: if…

Yes Rust lets you flatten the results.

Re: Cross-platform Rust rewrite of the GNU coreutils

#455

Earlier quoted context omitted.

Comment OP's stance is valid. "Magic" in this context are keywords or symbols that are not immediately clear to programmers that don't work in rust. One of the reasons golang is so successful is that there is very little magic in the syntax, and even when there is it's fairly easy to grok (an example would be the `go` keyword). FWIW I also share their opinion that rust is unapproachable.

> One of the reasons golang is so successful is that there is very little magic in the syntax, and even when there is it's fairly easy to grok (an example would be the `go` keyword). Do you have a specific symbol you would like to change in Rust, and what would you like to change it to? The only example I've seen (in a child comment to yours) is effectively a complaint that Rust has lifetimes and Go doesn't, which is…

I'm definitely a Rust fanboy, but the single-quote syntax for lifetime annotations can be irritating. Several editors I've used automatically insert a second quote to match, and I am frequently unable to disable that behavior without losing all paired delimiter insertion (like for parentheses or braces).

It's a minor quibble to be sure, but it's the only language symbol that bothers me when writing Rust. Not sure what I'd suggest replacing it with...backtick, maybe? Pipe? @? ~?

There aren't many other special characters on a QWERTY board that aren't already used in Rust. Which I think gets at one of the stumbling blocks that I see in the various Rust syntax bikesheds among those who haven't worked in the language. It's just alien until you've used it a bit, especially if you're writing a lot in pseudocode-y dynamic languages.

Re: Cross-platform Rust rewrite of the GNU coreutils

#456
post #453

Earlier quoted context omitted.

> I have not had many problems with memory leaks or dangling pointers. And the ones I had were relatively easy to locate and fix. Note that every single browser vulnerability in this year's Pwn2Own was a use after free (dangling pointer).

Well. I'll gladly admit that the C code I have written was way less complex than a web browser. When I still wrote C code for a living, I worked on an application suite that was ~250k lines of code, maybe ~300k, in total, whereas e.g. Firefox is a couple of million lines. I assume other mainstream browsers are similarly big. Plus, what a browser does is, by nature, a lot more complicated than what I worked on. EDIT:…

Yeah, browsers are essentially interpreters (and nowadays compilers) for a variety of crazy languages (html, css, javascript; probably a few more?).

You don't want to be writing your interpreters in C.

Re: Cross-platform Rust rewrite of the GNU coreutils

#457
post #286

Though I like ideas behind Rust but the code is awful. If you look at the code you'll see a lot of misterious symbols (as in Perl) and strange constructs like wrap, unwrap, Arc etc. They make the code less readable. Also Rust doesn't have exceptions so you have to wrap almost any function call with let/match/Ok/Err. Ugly. I looked at one random file which turned out to be a `du' command implementation: https://github…

Just wrt the let/match/Ok/Err == ugly comment: I don't know Rust very well and I haven't looked very closely at the code in question, but why would Rust force you to wrap almost any function call with let/match/Ok/Err, though? I am assuming the issue at hand here is when you call function that returns a Result (if that's the name of the parent of Ok/Err)? Couldn't one let the return values 'flow up'? For example: if…

Yeah, codedokode is wrong. Rust lets you keep returning Results as you described. You don't even need to actually write a match statement yourself: there's a built in try! macro, which will do an early return from a function if a function call returns an Err value. And soon there will be a new ? operator which does this inline so you don't even need the macro.

What you end up with are much more flexible "exceptions" that don't need a lot of extra compiler support.

Re: Cross-platform Rust rewrite of the GNU coreutils

#458

Earlier quoted context omitted.

Yeah if you link libreadline you have to GPL your source, but why do you consider that bad? Isn't that in the interest of the general public?

It is in the interests of a minority of programmers, themselves a tiny minority of the general public. Let's not get completely overblown about the stakes here.

The only reason I use the GPL is to safeguard the general public's rights to modify and distribute my software. If anything, I'd argue that releasing GPL software works against the author as it makes making money off it substantially more difficult.

Re: Cross-platform Rust rewrite of the GNU coreutils

#459
post #390

MIT license? Is open-source dying?

I don't like this trend of new projects choosing weak free software licenses. It's as though they wish to ignore the history of the world they live in -- free software would not exist in the form it does today without copyleft. Copyleft is the one defense free software developers have against corporate monopolies and proprietary splitting. For some reason though, everyone who works in $NewLang seems to not care about…

"Those who cannot remember the past are condemned to repeat it"

I'd like to think that in the future when "the open-source bubble" bursts and companies fall back to 70s-era mentality, developers would rediscover why free software is important and a new movement would would be born.

Sadly, I think hardware be permanently locked down by then. Perhaps by FCC-style law.

Re: Cross-platform Rust rewrite of the GNU coreutils

#460
post #389
post #301

Earlier quoted context omitted.

if you prefer "is free software dying"?

The MIT license is free and open source. https://opensource.org/licenses/MIT https://www.gnu.org/licenses/license-list.html#X11License Maybe "copyleft" or "reciprocal" licensing?

Without copyleft, we wouldn't have free software in the form it is today.
Post reply on HN