Monday, July 18

Does this look to anyone sort of like a coherent idea?

$ s j cat foo.json bar.json | s j sort -u | s x > bar.xml

...the notion being that s is a wrapper which parses various kinds of structured input (JSON/YAML/XML/s-expressions/etc.), passes this to utilities which conceptually parallel various unix commands, and spits it back out as structured output.

The longer I look at this, the fuzzier the idea seems.

For one thing, it's not even entirely clear what the structured equivalent of cat(1) is, let alone things like wc(1) or grep(1). Most unix-style utilities are built around pretty minimal and low-abstraction expectations of structure in their IO. You deal with files, lines, columns, characters, etc. The real equivalents in terms of very structured data might be constructs you find in modern programming languages. Perl's foreach, map, grep, join, split, etc., come to mind. (Of course, there's an obvious unix-like flavor to many of those, so maybe I'm not too far off base.)

tags: topics/cli, topics/technical

p1k3 / 2011 / 7 / 18