|
| 1 | +## jq vs celq |
| 2 | + |
| 3 | +* [jq](https://github.com/jqlang/jq) uses jqlang. It is a very powerful language, but it requires learning a new syntax. [Meanwhile, celq uses the Common Expression Language (CEL)](https://cel.dev/) which is a very constrained language that tries to have a similar syntax to C and JavaScript. |
| 4 | +* jq did not support JSON5, YAML, and TOML when celq was originally written. |
| 5 | +* jq uses pretty-print by default. Meanwhile, celq uses compact output by default. |
| 6 | +* jqlang programs can be reused in Python with a library of the same name ([jq](https://pypi.org/project/jq/)). CEL programs can be reused in Python with [cel-python](https://pypi.org/project/cel-python/). |
| 7 | +* jqlang programs can be reused in Go with [gojq](https://github.com/itchyny/gojq). CEL programs can be reused in Go with [cel-go](https://github.com/google/cel-go) |
| 8 | +* Other languages generally can embed jqlang with `libjq`. For CEL, that can be done with [cel-cpp](https://github.com/google/cel-cpp) or CEL ports in their respective languages. |
| 9 | +* Until benchmarks come out, assume that jq is faster than celq. |
| 10 | +* celq can process JSON Lines in parallel, while jq cannot. |
| 11 | +* gojq and celq are memory-safe, while jq is not (unless compiled with [Fil-C](https://fil-c.org/)) |
| 12 | + |
| 13 | +## yq vs celq |
| 14 | + |
| 15 | +* [yq](https://github.com/mikefarah/yq/) supports formats like XML and HCL that celq does not. |
| 16 | +* yq's syntax is inspired by jqlang. |
| 17 | +* [yqlib](https://pkg.go.dev/github.com/mikefarah/yq/v4/pkg/yqlib) can be reused in Golang only. |
| 18 | +* yq is less hermetic than celq by default. That can be mitigated with the `--security-disable-env-ops ` and `--security-disable-file-ops` flags |
| 19 | + |
| 20 | +## jaq vs celq |
| 21 | + |
| 22 | +* [jaq](https://github.com/01mf02/jaq) uses jqlang, as it is a Rust clone of `jq` |
| 23 | +* jqlang can be reused in Rust with [jaq-std](https://crates.io/crates/jaq-std). CEL can be reused in Rust with [cel-rust](https://crates.io/crates/cel/0.12.0). |
| 24 | +* jaq supports formats like XML and CBOR that celq does not support. |
| 25 | +* jaq did not support JSON5 when `celq` was originally written (but this could trivially be added to jaq) |
| 26 | +* Until benchmarks come out, assume that jaq is faster than celq |
| 27 | +* celq can process JSON Lines in parallel, while jaq cannot (but this could trivially be added to jaq) |
| 28 | +* jaq and celq are both memory-safe |
| 29 | + |
| 30 | + |
| 31 | +## jo vs celq |
| 32 | + |
| 33 | +* [jo](https://github.com/jpmens/jo) is less verbose than celq for creating JSON output from the CLI |
| 34 | +* jo doesn't read from the input by default. celq needs the `-n` flag to ignore the input. |
| 35 | +* jo can created nested objects by composing calls e.g. `jo github=$(jo user=get-celq repo=homebrew-tap)`. At the moment, celq's arguments don't support maps yet |
| 36 | + |
| 37 | +## gron vs celq |
| 38 | + |
| 39 | +* gron can make HTTP calls by default. celq does not and needs `curl example.com | celq`. |
| 40 | +* celq can use the `--greppable` flag to achieve the same behavior as gron |
| 41 | +* celq can use the `--from-gron` flag to achieve the same behavior as ungron |
| 42 | +* gron has been rewritten in C++, see [fastgron](https://github.com/adamritter/fastgron). |
| 43 | +* gron did not support JSON5 when celq was originally written. |
| 44 | + |
| 45 | +## jsonnet vs celq |
| 46 | + |
| 47 | +* jsonnet has its own syntax with functions, imports, inheritance. celq on the other hand is more constrained and uses CEL. |
| 48 | +* celq can template simple JSON outputs, especially with the `--from-file` flag. It can substitute jsonnet for simple use cases. |
| 49 | +* [jsonnet has a warning against server-side evaluation](https://jsonnet.org/ref/bindings.html#server_side). CEL was invented to prevent that kind of issue. |
| 50 | + |
| 51 | +## jql vs celq |
| 52 | + |
| 53 | +* [jql](https://github.com/yamafaktory/jql) uses its own syntax to query JSON with selectors. celq is closer to how imperative programming languges access JSON fields. |
| 54 | +* jql did not support JSON5, YAML, and TOML when celq was originally written. |
| 55 | + |
| 56 | +## DuckDB JSON vs celq |
| 57 | + |
| 58 | +* [DuckDB](https://duckdb.org/docs/stable/data/json/overview) excels at querying JSON with schemas using SQL |
| 59 | +* celq and jq excel at querying unstructed JSON |
| 60 | +* DuckDB did not support JSON5, YAML, and TOML when celq was originally written (and that is probably a good thing) |
0 commit comments