5 ms·
One thing to keep in mind when looking at GNU programs is that they're often intentionally written in an odd style to remove all questions of Unix copyright inf
by avar 9y ago
One thing to keep in mind when looking at GNU programs is that they're often intentionally written in an odd style to remove all questions of Unix copyright infringement at the time that they were written.
The long-standing advice when writing GNU utilities used to be that if the program you were replacing was optimized for minimizing CPU use, write yours to minimize memory use, or vice-versa. Or in this case, if the program was optimized for simplicity, optimize for throughput.
It would have been very easy for the nascent GNU project to unintentionally produce a line-by-line equivalent of BSD yes.c, which would have potentially landed them in the 80/90s equivalent of the Google v.s. Oracle case.
- exxo_ 9y agoThis is the first revision: https://github.com/coreutils/coreutils/blob/ccbd1d7dc5189f4637468a8136f672e60ee0e531/src/yes.c https://github.com/coreutils/coreutils/blob/ccbd1d7dc5189f46...
- pulse7 9y ago(joke) They copied the API of the main() function... :-)
- h2hn 9y agoAnd here is the madness: :) https://github.com/coreutils/coreutils/commit/35217221c211f3116f374f305654462195aa634a https://github.com/coreutils/coreutils/commit/35217221c211f3...
- alkonaut 9y agoAnd the motivation: it's used as test inputs. Not sure I agree with completely destroying the readability of a perfectly readable file - but ok.
- acqq 9y agoThe motivation, as far as I see, was only that it "may be used." But see the post of belorn where he argues that the error handling seems to be good.
- Paul-ish 9y agoIs the date on that accurate, did that happen in 2016? Kinda hurts the theory that they were trying to avoid Unix similarity.
- jwilk 9y agoIt says: Mar 9, 2015
- simias 9y agoOne point in favor of this simple version is that it's immediately obvious that it doesn't do the same thing as the OpenBSD version. In OpenBSD `yes a b c` will only print "a" while in GNU it prints "a b c". I did not catch that when I was reading the more complicated modern version.
- endgame 9y agoCame here to post this, so instead I'll just back you up with a source: https://www.gnu.org/prep/standards/standards.html#Reading-Non_002dFree-Code https://www.gnu.org/prep/standards/standards.html#Reading-No...
- pge 9y ago"Add a programming language for extensibility and write part of the program in that language" wow, that's just asking for trouble...
- emodendroket 9y agoYeah, I mean, who even uses emacs?
- colund 9y agoYoungster!
- jerf 9y agoRemember that "yes" is the bottom end of complexity here, not the top. As the utility grows larger that stops looking like "asking for trouble" and starts looking like "often the only sensible solution". Expecting people to extend programs in C is often "asking for trouble", after all! (Lately I've been really tempted to pull a Cato and start terminating my every HN post with "C delenda est." https://en.wikipedia.org/wiki/Carthago_delenda_est https://en.wikipedia.org/wiki/Carthago_delenda_est)
- rjbwork 9y agoNever go full Cato.
- deleted 9y ago[deleted]
- gertef 9y agoThat's the LISP programming philosophy of the creator and host of this web forum
- jorvi 9y agoAt the risk of sounding like a copyright newbie, shouldn't that be covered by just doing a 'clean room' implementation? As long as you can verifiably prove that you didn't copy the source, it should fall under general use (as there's really only one way of doing such a thing), right? Much like Apple can't patent rectangles, although they tried.
- deleted 9y ago[deleted]
- nullc 9y agoEven if you eventually "win" you already lost when plausible litigation began.