Zq: An easier and faster alternative to jq
I&#x27;m working on a JSONiq based implementation to jointly process JSON data and XML. The compiler uses set-oriented processing (and thus uses hash joins for instance wherever applicable) and is meant to provide a base for JSON based database systems with shared common optimizations (but can also be used as a standalone in-memory query processor):<p><a href="http:&#x2F;&#x2F;brackit.io" rel="nofollow">http:&#x2F;&#x2F;brackit.io</a><p>The language itself borrows a lot of concepts from functional languages as higher order functions, closures... you can also develop modules with functions for easy reuse...<p>A simple join for instance looks like this:<p><pre><code>        let $stores :=
        [
          { &quot;store number&quot; : 1, &quot;state&quot; : &quot;MA&quot; },
          { &quot;store number&quot; : 2, &quot;state&quot; : &quot;MA&quot; },
          { &quot;store number&quot; : 3, &quot;state&quot; : &quot;CA&quot; },
          { &quot;store number&quot; : 4, &quot;state&quot; : &quot;CA&quot; }
        ]
        let $sales := [
           { &quot;product&quot; : &quot;broiler&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 20  },
           { &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 100 },
           { &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 50 },
           { &quot;product&quot; : &quot;toaster&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 50 },
           { &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 100 },
           { &quot;product&quot; : &quot;blender&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 150 },
           { &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 1, &quot;quantity&quot; : 500 },
           { &quot;product&quot; : &quot;socks&quot;, &quot;store number&quot; : 2, &quot;quantity&quot; : 10 },
           { &quot;product&quot; : &quot;shirt&quot;, &quot;store number&quot; : 3, &quot;quantity&quot; : 10 }
        ]
        let $join :=
          for $store in $stores, $sale in $sales
          where $store=&gt;&quot;store number&quot; = $sale=&gt;&quot;store number&quot;
          return {
            &quot;nb&quot; : $store=&gt;&quot;store number&quot;,
            &quot;state&quot; : $store=&gt;state,
            &quot;sold&quot; : $sale=&gt;product
          }
        return [$join]
</code></pre>
Of course you can also group by, count, order by, nest FLWOR clauses...