[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Why is gnu coreutils so bloated? This program's only p
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 58
Thread images: 14
File: 1450129174081.jpg (80 KB, 576x972) Image search: [Google]
1450129174081.jpg
80 KB, 576x972
Why is gnu coreutils so bloated?

This program's only purpose is to
return EXIT_SUCCESS
to the shell, and yet it's over 80 lines of code.
http://git.savannah.gnu.org/cgit/coreutils.git/tree/src/true.c
>>
File: Harmful-software.png (2 MB, 1440x1681) Image search: [Google]
Harmful-software.png
2 MB, 1440x1681
>>52237013
OP, the GNU userland is literally a botnet. Uriel was right.
>>
File: 1450742689918.jpg (56 KB, 421x656) Image search: [Google]
1450742689918.jpg
56 KB, 421x656
Because it's garbage.

https://gist.github.com/pete/665971

>almost 800 lines to read the output of a file

I recommend that everybody switch to a busybox-based distro and purge the GNU from GNU/Linux. Bonus points if you use an alternative to libc like musl (Alpine does)
>>
  if (argc == 2)
{
>>
>>52237095

/* Differences from the Unix cat:
* Always unbuffered, -u is ignored.
* Usually much faster than other versions of cat, the difference
is especially apparent when using the -v option.
By [email protected], Torbjorn Granlund, advised by rms, Richard Stallman. */
>>
>>52237095
Gnu cat can also label lines with numbers.
>>
>>52237095
>>almost 800 lines to *correctly* read the output of a file
ftfy

show your implementation pleb
>>
File: 1450988894621.jpg (83 KB, 766x766) Image search: [Google]
1450988894621.jpg
83 KB, 766x766
>>52237302
In perl:

#!/usr/bin/perl
use strict;

while(<>){
print $_;
}
>>
>>52237329
now do that in C
>>
>>52237048
top fucking kek

how is IRC not bloated
>>
File: 2ec.png (208 KB, 327x316) Image search: [Google]
2ec.png
208 KB, 327x316
>>52237048
freetards BTFO
>>
From the Gnu cat sources:

>#define AUTHORS \
>proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund"), \
>proper_name ("Richard M. Stallman")
Lol
>/* Buffer for line numbers.
> An 11 digit counter may overflow within an hour on a P2/466,
> an 18 digit counter needs about 1000y */
Seriously?!
>>
>>52237048
>perl, ruby
>suggests rc, awk

>gtk, qt, wxwidgets
>suggests tk

Well, at least he suggests nginx.
>>
for (;;)

?
Does that run faster than while loops or something? Seems an odd choice.

Also, GNU implementation is heavily documented, unlike the others, which is good, though it's not necessarily the clearest commenting I've seen.

>>52237400
I don't get the PS rec's either, PS let's you basically put anything you want in it. Not exactly safe, but yet it's less harmful somehow.
>>
>>52237510
>Lol
>Seriously

explain what's wrong with that
>>
>80 lines of code.

No, it isn't. 1/4 of the code is comments.

The rest is locale configuration for portability, and the usage function and its invocation from main. The program is exactly what it should be, which isn't just "hurrdurr return 0".
>>
>question is reasonable
>thread full of maki piece of shit
puke.gif
>>
>>52237013
>>52237329
>>52237473
Dumb maki posters
>>52237095
Only guy in the thread with taste
>>
>>52237574
this is correct
>>
>>52237550
>on a P2/466,
>>
>>52237550
he doesnt know
>>
File: 1447199199719.png (16 KB, 303x880) Image search: [Google]
1447199199719.png
16 KB, 303x880
>GNU
>>
File: 53487977_p0.png (508 KB, 900x1050) Image search: [Google]
53487977_p0.png
508 KB, 900x1050
>>52237595
>shit taste maki
that's good
>nico
It's worse.
>>
File: riko.webm (198 KB, 1280x720) Image search: [Google]
riko.webm
198 KB, 1280x720
>GNU/Linux
>GNU/Hurd
>>
>>52237595
You're lucky I don't have any Hanayo pictures.
>>
File: 1451702035085.png (392 KB, 848x480) Image search: [Google]
1451702035085.png
392 KB, 848x480
>>52237266
Because that's just what cat needs right? Who doesn't look at software for reading the contents of a file and think, "I wonder if it has line numbering!" Please never write software that I'll have to use
>>
>>52237048
>head
is this a joke?
>>
>>52237266
GNU cat does no such thing
if you want line numbers, use
nl
>>
MAKIMKAIMKAI I LOVE MAKIIIIIIIIIIIIIIII PLEASE MARR_Y ME MAKI CHAAAAAAAAN
>>
File: 1421367361487.jpg (417 KB, 1000x1300) Image search: [Google]
1421367361487.jpg
417 KB, 1000x1300
>>52239753
Lets love maki
>>
>>52237013
Because nerds like to over complicate things just because they can.
>>
File: 5ad3d051b6.png (2 MB, 1920x1080) Image search: [Google]
5ad3d051b6.png
2 MB, 1920x1080
>>52237013
At least it works.
>>
>>52237048
I can't use OpenBSD because it was backdoored by the FBI, so uriel is wrong. again.
>>
>>52237013
Who is that?
>>
>>52237013
I love Maki.
>>
/g/ - Maki
>>
>>52239994
Isn't it great?
>>
>>52240085
Yes.
>>
>>52238319
of course, have you seen the sql section?
suggesting file systems instead of a database lmfao
>BigTable
>>
>>52237574
the only sane person in this thread who actually knows what he's talking about.
>>
File: Lain_Slowpoke_003.png (94 KB, 614x600) Image search: [Google]
Lain_Slowpoke_003.png
94 KB, 614x600
>>52239994
Didn't this board used to be about Lain? What happened while I was gone?
>>
>>52240369
Cancerous Love Live fags.
>>
>>52240369
Lain is a hobbit with smelly arm pits

Once you go idols you can never go back.
>>
>>52237549
No, while technically
while(1)

should check to make sure 1 != 0 each loop, most compilers will optimize this into an infinite loop just the same as that for loop
>>
>>52237048
>HE WARNED US
>>
>>52237013
# define EXIT_STATUS EXIT_SUCCESS


LOL.jpg
>>
File: 1346296886049.png (204 KB, 544x468) Image search: [Google]
1346296886049.png
204 KB, 544x468
>>52240590
But can your idols code in cLisp?
>>
>>52237048
>GTK Qt VxWindows
>instead use: Tk, textual interfaces

>suggesting textual interfaces as an alternative to GUI toolkits
kek
>>
Spend a month using "non harmful" BSD utils, or even better, the plan 9 userland, and realize how stupid you are.

The UNIX way is as follows

"I would rather have a small .c file than a useful program"

Recursive copy isn't built into the cp command in PlanNine. Imagine how many separate Unix commands have the TreeWalking built into them... instead, this shell script, dircp refactors that functionality for the cp command into two invocations of tar:
#!/bin/rc
switch ($#*) {
case 2 @{ cd $1 && tar c . } | @{ cd $2 && tar x }
case * echo usage: dircp from to >[1=2]
}


GNU: Correct, fast, featureful
UNIX: Small, shitty, runs on a PDP-10

>>52237671
A for loop with a counter is such bloat, wow

It must be full of fucking local root sploits because it does two things and does them well
>>
>>52240614
I wonder why while(1) seems to be a more common C idiom, then? The explanation makes sense, but why do people ever use it in comparison with for (;;)?
>>
>>52240810
>we should tack unrelated features onto a tool for concatenating things because it's an easy feature to get right
>>
>>52240873
Readability, maybe? People don't like to see two semicolons next to each other. It looks kind of wrong.
>>
>>52240935
Yes, because the alternative is having the user write a fucking awk script to add the numbers after the fact.
>>
>>52237013
> exit 0
http://nxr.netbsd.org/xref/src/usr.bin/true/true.sh
>>
>>52240646
Because false is the same code with it defined as failure.
>>
>>52240590
You mean, once you go slut. Maki a cute slut.
>>
File: 1451165437816.jpg (76 KB, 759x847) Image search: [Google]
1451165437816.jpg
76 KB, 759x847
>>52241613
Ahh netBSD. Such an amazing BSD and one of the only BSDs that's not a result of someone throwing a fit against the FreeBSD devs and passive aggressively forking it.

I hope HAMMER gets ported quickly so the failed abortion that is Dragonfly can die
>>
>>52241613
>true
>shell script
That's fucking retarded.

The UNIX "philosophy" is that you have full access to the source code so everyone hacks in whatever features they need, with zero regard for standardization, documentation, or orthogonality. It's a great way to get a working, functional OS. It's also a great way to get a shittily designed OS, because there was no design.

GNU standardizes a lot of things. Everything has a `--help` in GNU. Even true. Everything is localized. Even true.

Is it bloat? Maybe. But GNU/Linux is better than UNIX because I don't have to worry about the wrong version of tar being installed on a machine fucking the backups.
Thread replies: 58
Thread images: 14

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.