Live data from Hacker News

Q: A faster re-implementaiton of jq written in Reason Native/OCaml

github.com

131–140 of 196 posts

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#131

If you're into Clojure, check out https://github.com/borkdude/jet

I use jet all the time when I need to quickly examine a json snippet in Emacs. I would use (shell-command-on-region with a prefix) and execute jet to convert selected json part to EDN. That cuts out all the visual noise. EDN is much more concise, cleaner and easier to read. I'd use it even if I don't write Clojure.

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#132
post #129

Earlier quoted context omitted.

Redirection is not a parameter, meaning that would still not work with this Q tool.

This is not a simple redirection. cmd So, this should work :-)

Works in other shells, not just bash

  % cat /proc/self/cmdline 

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#133
post #129

Earlier quoted context omitted.

This is not a simple redirection. cmd So, this should work :-)

Works in other shells, not just bash % cat /proc/self/cmdline

Yep! Zsh supports a lot of bashisms :-)

It won't work in dash though, and you should not use this in a shell that targets POSIX.

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#134
post #101

Earlier quoted context omitted.

Much Unix software today is written by people who really don't appreciate or understand Unix. It leads to things like Homebrew (early on, at least) completely taking over and breaking /usr/local; to command-line utilities using a single dash (-) precending both short and long option names (granted, --long-opts is a GNUism, but it's a well-established standard); commands that output color by default even when the outp…

Tangent: Homebrew itself doesn’t really choose to take over /usr/local; rather, it just accepts that there exists POSIX software that is way too hard for most machines to compile, and so must be distributed precompiled; and yet where that precompilation implies a burning-in of an installation prefix at build time, which therefore cannot be customized at install time. And so that software must be compiled to assume so…

Or use `/opt` which is a POSIX-standard location. Every managed MacOSX laptop I've gotten from "Big Corp" has had `/usr/local` owned & managed by IT with permissions set to root meaning you're fighting Chef (or whatever your IT department prefers) if you use the default homebrew location.

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#136
post #101

Earlier quoted context omitted.

Much Unix software today is written by people who really don't appreciate or understand Unix. It leads to things like Homebrew (early on, at least) completely taking over and breaking /usr/local; to command-line utilities using a single dash (-) precending both short and long option names (granted, --long-opts is a GNUism, but it's a well-established standard); commands that output color by default even when the outp…

Tangent: Homebrew itself doesn’t really choose to take over /usr/local; rather, it just accepts that there exists POSIX software that is way too hard for most machines to compile, and so must be distributed precompiled; and yet where that precompilation implies a burning-in of an installation prefix at build time, which therefore cannot be customized at install time. And so that software must be compiled to assume so…

> I guess Homebrew could come up with its own cute little appellation — /usr/pkg or somesuch —

/opt/homebrew would be a somewhat traditional place to put it.

> but then you run into that other lovely little POSIXism where every application has its own way of calculating a PATH, such that you’d need to add that /usr/pkg directory to an unbounded number of little scripts here and there to make things truly work.

What? You should be able to add it to the system PATH that's set for sessions and call it a day on a POSIX system. PATH is an environment variable and inherited. If MacOS is in the habit of overriding PATH on system scripts I have to imagine that's because they completely screwed it up at some point in the past. Generally, you just add it to your use session variables in whatever way your system supports (.profile, etc) if you want it for your user, or at a system level if you want it system wide (I could see maybe Apple making this hard).

The only times in over 20 years I've ever had to deal with PATH problems are when I ran stuff through cron, because it specifically clears the PATH. More recent systems just specify a default PATH in /etc/crontab for the traditional / and /usr bin and sbin dirs.

Maybe you're thinking of the shared library path loading? That should also be easily fixed.

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#137
post #82

For everyone pining for a Jq with a different syntax: I have a bunch of links to alternatives collected, you might want to try some of them (some may be for different things than JSON): https://github.com/fiatjaf/awesome-jq https://github.com/TomConlin/json2xpath https://github.com/antonmedv/fx https://github.com/fiatjaf/jiq https://github.com/simeji/jid https://github.com/jmespath/jp https://github.com/cube2222/jql…

Sorry, what is "Hy"?

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#138
post #101

Earlier quoted context omitted.

Much Unix software today is written by people who really don't appreciate or understand Unix. It leads to things like Homebrew (early on, at least) completely taking over and breaking /usr/local; to command-line utilities using a single dash (-) precending both short and long option names (granted, --long-opts is a GNUism, but it's a well-established standard); commands that output color by default even when the outp…

Tangent: Homebrew itself doesn’t really choose to take over /usr/local; rather, it just accepts that there exists POSIX software that is way too hard for most machines to compile, and so must be distributed precompiled; and yet where that precompilation implies a burning-in of an installation prefix at build time, which therefore cannot be customized at install time. And so that software must be compiled to assume so…

The REAL ridiculous thing is that Homebrew was needed in the first place.

Mac OS X had some of the sexiest ways to install and uninstall application software that we'd ever seen in any other platform at that time.

But that Apple stubbornly refused to include a useful package management system, was one of the most horrible oversights in computing history.

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#139

Earlier quoted context omitted.

Much Unix software today is written by people who really don't appreciate or understand Unix. It leads to things like Homebrew (early on, at least) completely taking over and breaking /usr/local; to command-line utilities using a single dash (-) precending both short and long option names (granted, --long-opts is a GNUism, but it's a well-established standard); commands that output color by default even when the outp…

Anybody long enough to remember Unix from the beginning or even just the last 25 years... which is a tiny percentage of this site... should know that a unifying Unix or Unix "tradition" as noted in a follow-up comment is a pretty much a myth. The tradition is whatever system you grew up on and tribal biases you subscribe to and the only true Unix traditions are mostly trivialities like core shell syntax and a handful…

> more churn than Windows -- which never subscribed to a tradition.

My understanding is that Windows has always had a very strong tradition of backwards compatibility. Even to the point of making prior bugs that vendors rely on still function the same way for them (i.e. detect if it's e.g. Photoshop requesting buggy API, serve them the buggy code path and everyone else the fixed one).

That's just as much a tradition as "we should implement this with file semantics because that's traditionally how our OS has exposed functionality".

Re: Q: A faster re-implementaiton of jq written in Reason Native/OCaml

#140
post #82

For everyone pining for a Jq with a different syntax: I have a bunch of links to alternatives collected, you might want to try some of them (some may be for different things than JSON): https://github.com/fiatjaf/awesome-jq https://github.com/TomConlin/json2xpath https://github.com/antonmedv/fx https://github.com/fiatjaf/jiq https://github.com/simeji/jid https://github.com/jmespath/jp https://github.com/cube2222/jql…

Sorry, what is "Hy"?

https://github.com/hylang/hy
Post reply on HN