Insane bloat

Nathaniel Ward
Nathaniel Ward

stedolan.github.io/jq/
* 21k lines of C code, in 2018 (WHY?)
* literally pages of segfault bugs github.com/stedolan/jq/issues?utf8=✓&q=is:issue is:open segmentation
* implements an entire lex/yacc BISON parser, compiler and bytecode interpreter (in C)

github.com/dflemstr/rq
* implemented in rust, yet depends on V8 (node js)
* works by parsing the query in rust and then handing the result off to nodejs (WTF?)
* contains a 70k line javascript file <github.com/dflemstr/rq/blob/master/src/js/lodash.js>

github.com/FGRibreau/jq.node
* 60 lines of nodejs <github.com/FGRibreau/jq.node/blob/master/jq.js>

Other urls found in this thread:

github.com/nodejs/node/blob/master/BUILDING.md
github.com/dflemstr/rq/blob/master/src/js/lodash.js>
8ch.net/tech/res/876504.json
youtube.com/watch?v=oM6S7FEUfkU

Andrew Murphy
Andrew Murphy

Why even use C if you're using JSON? Why are people such niggers?

Austin Ross
Austin Ross

It's easier for humans and machines to parse than XML.

Ryder Bennett
Ryder Bennett

C is bad because CURRENT_YEAR!

Elijah Bennett
Elijah Bennett

I'm going to be sick...

Jack Torres
Jack Torres

No bloated C is bad because bloated code in any language is bad.
876534
People would be more likely to take you seriously if you actually posted your own opinion instead of copy pasting some retarded pajeets opinion in every thread.

Zachary Flores
Zachary Flores

876534
Short intro text
Puts quote in code tags so the coloring makes it look like a gay pride poster
Quote probably from UNIX hater's handbook
No source
It's (you) again.

Landon Mitchell
Landon Mitchell

LOC is an indicator of bloat
o I am laffin
C is more verbose than other languages, that doesn't mean the implementation is bloated or bad, it's just meticulous.
but the source is bloated
Define bloat, do you simply mean more lines or do you mean the typical meaning of the word, full of useless features?

Ryan Gonzalez
Ryan Gonzalez

Is JSON insane bloat? I never used it but I just thought it was just some kind of map?

William Nelson
William Nelson

Define bloat
I mean loads of useless(already implemented elsewhere on targeted systems) features. From OP:
* implements an entire lex/yacc BISON parser, compiler and bytecode interpreter (in C)
I can use the classic OpenSSL example of re-implementing malloc as another example of bloat. Of course there were(still are?) many other issues with this but thats besides the point.

Chase Myers
Chase Myers

C is more verbose than other languages, that doesn't mean the implementation is bloated or bad, it's just meticulous.
C is verbose, bloated, and bad.

Define bloat, do you simply mean more lines or do you mean the typical meaning of the word, full of useless features?
How about more lines and no useful features?

The solution, as any well-seasoned unix veteran will
tell you, is to use "tar" if you want to copy a
hierarchy. No kidding. Simple and elegant, right?

For me, using "tar" to copy directory hierarchies is the
archetype of what is fundamentally wrong with Unix, the
fundamental wrongness being that in Unix the user is forced
always to say *how it is* s/he wants something done, rather
than *what it is* s/he wants to do.

The notion of using the tape archiver to move a directory
hierarchy is not inconsistent with the notion of using C to
write robust, maintainable programs. Think about it.

Robert Garcia
Robert Garcia

* implements an entire lex/yacc BISON parser, compiler and bytecode interpreter (in C)
It's a language. Do you expect it to not implement a lexer and parser? If not, would it really be better to roll their own?

Camden Harris
Camden Harris

check your reading comprehension

Thomas Brooks
Thomas Brooks

Are you saying that it reimplements bison itself? Where?

Tyler Fisher
Tyler Fisher

Use C for the hard stuff, and a proper parser written in something else for everything else.

JSON is easy to parse.

Jason Bell
Jason Bell

Okay, given that there's a big FSF copyright header at the top of parser.c, I think it's safe to say that they used flex and bison in the standard way.
Which means that parser.c and lexer.c are generated from the .y and .l files.
So I'm asking you again: would it have been better for them to write their own parser and lexer, instead of handing the task over to an old respectable set of code generators? Did you count the generated code as part of the 21k lines?

Gavin Morales
Gavin Morales

C is bloated
Probably the smallest standard library of all the useable languages.
muh tar copying
MANPAGER="sed -n '4p'" man pax
pax — read and write file archives and copy directory hierarchies

Thomas Baker
Thomas Baker

Okay, I think I figured out where you went wrong. You're comparing jq to the 60 lines of node.js used by jq.node.
Let's say I've got a server running a pretty old system that doesn't package a useful JSON processor. I could use jq, or I could use jq.node.
If I use jq, I make sure I have some very basic dependencies installed, I put the code on my server, and I compile it. It's very easy. I know that because I've done it, on my server.
If I use jq.node, I have to install all of node.js and the node package manager before I can even get started. Now, I don't know exactly how complicated building node.js is, but I know it's a lot more complicated than building jq. Look at this shit:
github.com/nodejs/node/blob/master/BUILDING.md
Look at that. Building node.js actually requires Python. What the fuck?
jq.node isn't just sixty lines of javascript, it's an entire bloated javascript implementation. You're writing node.js and pretending you're using a language implemented in 60 lines. It's enormous, bloated, and a hundred times as slow as jq according to the benchmarks provided by jq.node itself.
jq.node has a parser, and it's much larger than jq's, it's just in a different repository.

Dominic Davis
Dominic Davis

isnt java like flash? im surprised people use this shit. hell, even hooktube makes me disable noscript because of json bullshit.
it gets tiring trying to defend yourself against botnet. And that's just from a browser perspective.

Elijah Scott
Elijah Scott

This might be bait but if it isn't bait then please stop talking about this subject until you know more about it

Nicholas Rivera
Nicholas Rivera

contains a 70k line javascript file <github.com/dflemstr/rq/blob/master/src/js/lodash.js>
jq.node uses that one too, it just doesn't put it directly in the repository because it expects you to pull it in with npm.

Kevin Walker
Kevin Walker

quads of truth tbh
if Holla Forums followed this advice, it would be a better board

Noah Ward
Noah Ward

why should anyone care about this project anyway? never heard of this shit before.
do a proper post with all the info, or fuck off this board.

Evan Hughes
Evan Hughes

Oh my god who gives a fucking shit about how many lines of code it has I just want the one that works the fastest and the most reliably.

Isaiah Rivera
Isaiah Rivera

fuck off this board
No you, /g/ owns this board now.

Easton Cruz
Easton Cruz

Just because an implementation of something already exists, doesn't mean it's the best implementation, especially in all contexts. I unironically trust anything made by the OpenSSL team more than I would the standard.

Ironically sometimes people reimpliment things without the extra features they need in order to be more performant or portable.

Evan Myers
Evan Myers

kill yourself

Landon Peterson
Landon Peterson

Use "tar" if you want to copy a hierarchy
$ ls a
directory-a directory-b
$ cp -r a b
$ ls b
directory-a directory-b

Nicholas Watson
Nicholas Watson

Well, maybe you were talking about backups.
Your argument is still retarded because tar was literally made for tarrin' shit up for tape backups.
It's literally the purpose behind the tool that you are griping about using it for.

Samuel Phillips
Samuel Phillips

tar was literally made for tarrin' shit up for tape backups
Exactly this. The OS was not meant for desktop use and it's really only like 1% who persist anyway. Unix was meant for servers or phones or any place where the permanence of data was not a thing.
This is one of the reasons Windows GNU thing is so fucking funny.

Hunter Allen
Hunter Allen

This will give different results depending on whether b exists or not.
Use `cp -r a/. b/` to copy reliably.

Christian Cruz
Christian Cruz

This will give different results depending on whether b exists or not.

how is this shit so pervasive? literally all of UNIX userspace is full of bizarre special cases and trapdoors. Fuck it. redesigning everything from scratch is the only solution.

Henry Roberts
Henry Roberts

It's a JSON processing tool.
Here's a dumb example:
curl 8ch.net/tech/res/876504.json | jq -r '.posts[] | .name + " " + (.time | todate) + " No." + (.no | tostring) + "\n" + .com + "\n"'

Juan Hughes
Juan Hughes

bizarre special cases and trapdoors
All the behaviour is consistent. Read the man pages, retard.
Fuck it. redesigning everything from scratch is the only solution.
Good luck with that, maybe you'll come up with OpenVMS and hate it as much as VMS users do

Austin Rogers
Austin Rogers

Why even use C if you're parsing a file?
Check what you said.

Owen King
Owen King

They tried with Plan9.

Benjamin Mitchell
Benjamin Mitchell

json has a better signal to noise ratio than xml...

Dylan Fisher
Dylan Fisher

And plain text has a signal to noise ratio of 1 while being garbage for structured data, and comparing things to XML is setting the bar unreasonably low. What's your point?

Aaron Thompson
Aaron Thompson

signal to noise ratio xml
what is this? did a quick web search and nothing relevant came up.

Ryan Nelson
Ryan Nelson

I always hear people shit on XML but I don't see why, and people praise JSON seemingly because it's easy to parse and "human readable". XML seems like it'd be much faster to parse for a machine, I don't see why human readability should even be a factor for structured data, the whole point is to compose human output from the input if you want human readability.

What's so bad about XML, what's so good about JSON, and what are some noteworthy (good and bad) alternatives?

Charles Bailey
Charles Bailey

JSON is great because it is based on javascript :-DDDDD

Adam Russell
Adam Russell

XML is bad because it's tedious to write and too complex for non-hardcore users to fully understand. There's some sort of attack that uses tricky standard-conforming tags to exponentially grow in memory, so even parsing it can be problematic. And after all that it's still annoying for humans to deal with.
JSON is just barely human readable enough to get used for human-authored configuration files, but it's finicky enough to make writing it annoying - no trailing commas, no comments. If it were a little less readable it would be abused a lot less. It's kind of bad.
XML is much more powerful than JSON. There are tasks for which XML is only kind of sucky but for which JSON would be a disaster.
YAML is good for a lot of the things people should stop using JSON for. It's actually useful for human beings. It's not worth using for anything that doesn't involve humans, though.

Evan Howard
Evan Howard

looks like a useless crap, these things are easier to do in a normal programming language like Python.

Colton Bell
Colton Bell

I use Python for complicated things, but jq is great for one-liners. If I want to explore a document's structure or do quick and dirty data extraction it's much more convenient.
I'd rather write jq .foo[].bar than python3 -c 'import json, sys; for x in json.load(sys.stdin)["foo"]: print(x["bar"])'.

Sebastian Baker
Sebastian Baker

No thanks! ADA and C are the best tyvm now kys.

Juan Gutierrez
Juan Gutierrez

Exactly this. The OS was not meant for desktop use and it's really only like 1% who persist anyway. Unix was meant for servers or phones or any place where the permanence of data was not a thing.
Permanence of data was definitely a thing, but the UNIX filesystem got corrupted all the time because it sucked. Backups on real OSes were made to protect against physical hardware damage. Backups on UNIX were made because the filesystem lacked robustness and because there was no way to undelete a file or restore a previous version.

how is this shit so pervasive? literally all of UNIX userspace is full of bizarre special cases and trapdoors.
It's pervasive because they don't care and because of their attitude of everything being the user's fault.

Stanford had a system called "labrea". It was (is?) a
vax 750 with 10 fuji eagles (4.5 Gbytes, which was a lot
when it was first around...)

Tape handling has always been a real weak point of unix.
Any real operating system has much better backup/restore
capabilities, and a lot of these are 10s of years old...

This poor user tried to use Unix's poor excuse for
DEFSYSTEM. He is immediately sucked into the Unix "group of
uncooperative tools" philosophy, with a dash of the usual
unix braindead mailer lossage for old times' sake.

Of course, used to the usual unix weenie response of
"no, the tool's not broken, it was user error" the poor user
sadly (and incorrectly) concluded that it was human error,
not unix braindamage, which led to his travails.

Let me supply you with an example. Just today I had the
following dialog with one well known computer manufacturer's
version of Unix:

> rm temp
rm: temp directory

> rmdir temp/
rmdir: temp/: Is a directory

(Of course if I type the name of the directory -without- the
trailing "/", rmdir works just fine.) Now just what the
heck braindamage do you suppose results in this idiotic
error message? "OF COURSE IT'S A DIRECTORY", I shout at my
terminal, "WHY THE HECK DO YOU THINK I'M USING RMDIR?"

Now that's the kind of teeth-grinding experience this
mailing list is all about.

If you want to remember the actual last time you edited
those files, then keep your own damn database of dates
and times, and stop bothering us Unix Wizards.

I thought this is what RCS is for.

I'm TA'ing an OS course this semester. The last lecture was
an intro to Unix since all other operating systems were only
imperfect and premature attempts to create Unix anyway.
Some lecture highlights...

An aside during a discussion of uid's and many a unix
weenie's obsession with them: "A lot of people in the Unix
world are weird."

When asked if Ritchie et al regretted some other
inconsistency in Unix metaphysics, "These guys probably
don't care."

Have another twinkie.

Carter Fisher
Carter Fisher

his rust remover has automatic straw management
Manual straw management with tape on the can master race.

Aaron Fisher
Aaron Fisher

"rmdir temp/ fails because of the trailing /"
$ mkdir a
$ rmdir a/
No problems
Works on my machine™

Dylan Richardson
Dylan Richardson

Watch this:
$ mkdir a
$ ln -s a b
$ rmdir b/
rmdir: failed to remove 'b/': Not a directory
$ rm b/
rm: cannot remove 'b/': Is a directory

Kayden Myers
Kayden Myers

Oh, and in case you wondered:
$ rm -r b/
rm: cannot remove 'b/': Not a directory

Ethan Hernandez
Ethan Hernandez

I have never in my entire life used rm -r without -f.

Kayden Wood
Kayden Wood

That's because b isn't a directory, it's a symlink.
Shiggy diggy.

Gabriel Cox
Gabriel Cox

I unironically trust anything made by the OpenSSL team more than I would the standard.
Have you ever actually read the openssl code? Its a clusterfuck of terrible programming. Bob Beck gave a talk[1] on all the cancer they removed in the first month after forking it. I suggest you give it a watch. Not that I think that libressl is the solution to the openssl problem but if you need openssl compatibility its much better then using the actual thing.
[1]youtube.com/watch?v=oM6S7FEUfkU

Aiden Adams
Aiden Adams

Because `b/` isn't a directory. It's a symlink.
`rm b` works absolutely fine.

Lucas Bell
Lucas Bell

literally this Also unlink.
inb4
hurr whats the difference between a link and file

Levi Phillips
Levi Phillips

makes retarded "human readable" data format
parses it in C to get "speed"

Chase Garcia
Chase Garcia

all files are "human readable"
implies parsing files doesn't include byte econdings
can you read?

Sebastian Smith
Sebastian Smith

I know why it happens, I set it up myself. But it's inexcusable for a single tool to both complain that "b/" is a directory and that it's not.

Cameron Howard
Cameron Howard

My solution to you is to stop using retarded GNU coreutils. Besides emacs pretty much all gnu software is shit. Following your example
sbase$ rm b/
rm: unlink b/: Not a directory
OpenBSD$ rm b/

Sbase tells you what you are supposed to do and OpenBSD just does it. Both are more acceptable then retarded gnuisms.

Nathaniel Morales
Nathaniel Morales

econdings