This is data-oriented programming. And the simplest forms of it looks just like the data. The brilliance of the language is on several planes:
- The syntax: Superficially it looks like JSON, but there is so much more going on, e.g. [1, 2, 3] is not a list ... it's three constant filters whose outputs are coalesced into a list ... but it looks just like a list in JSON!
- The library: The language has a few primitives, and most of the functions you see are or can be implemented in the langage itself, using those primitives, including the all-important select(). It gives me LISP goosebumps.
- The data model: How the idea of multiple values, immutability and pipes-and-filters seeps into everything and allows for some very simple yet powerful operations that would be awkward in almost any other language.
You come for something that can extract an attribute in a datastructure for you, and it excels at that, and then as you dig deeper, you discover that underneath, it's a fusion-powered nanorobot assembly factory.
It's wonderful to see Small Languages make a comeback.
#jq