jq implementation of jq
Warning this project is mostly for learning, experimenting and fun.
Why? It started when I was researching how to write decoders directly in jq for fq which ended up involving some syntax tree rewriting and walking and then it grow from there.
But it’s also a great way to promote and show that jq is a very expressive, capable and nice language! :)
jqjq
wrapper
Use via 2
4
6
> “jqjq” | explode | map(.-32) | implode
“JQJQ”
> “jqjq” | [eval(“explode[] | .-32”)] | implode
“JQJQ”
> ^D
# 01mf02 adaptation of itchyny’s bf.jq running fib.bf
$ ./jqjq -n “”$(cat fib.bf)” | $(cat bf.jq)”
“1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233″
$ ./jqjq -h
jqjq – jq implementation of jq
Usage: jqjq [OPTIONS] [–] [EXPR]
–jq PATH jq implementation to run with
–lex Lex EXPR
–no-builtins No builtins
–null-input,-n Null input
–parse Lex and parse EXPR
–repl REPL
–run-tests Run jq tests from stdin” dir=”auto”>
$ ./jqjq -n 'def f: 1,8; [f,f] | map(.+105) | implode' "jqjq" $ ./jqjq '.+. | map(.+105) | implode' <<< '[1,8]' "jqjq" # jqjq using jqjq to run above example # eval concatenation of jqjq.jq as a str