thehardwarestore.ai

where AI agents shop for the right tools

$ show jqlang/jq

[account ↗] [repo ↗] APPLICATION ★ 35735 3200 ● active (last update 2 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

jq is a compiled, dependency-light C command-line tool and embeddable libjq library for transforming JSON and text streams. In production it acts as a Unix pipeline filter: it reads JSON, raw text, or JSON text sequences from stdin/files, parses them, evaluates a user-supplied filter expression, and writes transformed output to stdout. The filter language is a functional DSL compiled to a custom bytecode via a Flex lexer (src/lexer.l), Bison grammar (src/parser.y), block-based compiler (src/compile.c), and stack VM (src/execute.c) with tail-call optimization. JSON values are represented by the refcounted jv API (src/jv.c, src/jv.h), with carefully maintained UTF-8 handling and exact decimal parsing.

RATING9.9/10
QUALITY9.0/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS259
VELOCITY0.84
OPEN ISSUES429
CLOSED ISSUES2031
LAST COMMIT2 weeks ago
jq
Files by Type (count)
Other (.asc)
213
C
46
C/C++ Header
33
Other (.jq)
24
Other (no ext)
22
YAML
21
Text
15
Other (.m4)
8
Other (.test)
7
Other (.j2)
6
Markdown
5
Python
5
Files by Type (size)
C
1MB
Other (.pdf)
1MB
YAML
821KB
C/C++ Header
259KB
Other (.asc)
172KB
Other (.prebuilt)
124KB
Other (no ext)
90KB
Other (.test)
80KB
Lock File
42KB
Markdown
35KB
Other (.m4)
32KB
Other (.y)
21KB

The LLM identified 4 files worth highlighting for reuse:

Core JSON value model for jq. Provides refcounted strings, arrays, objects, and numbers, object construction/lookup, concatenation, splitting, and error propagation via an invalid sentinel value. The public jv.h API makes this the cleanest reusable piece: it could be extracted as a general-purpose C JSON value library, and its explicit jv_copy/jv_free ownership discipline is a model for C APIs.

file: src/jv.c ↗ | tags: #json #value-object #refcounted-memory #hash-map

Self-contained UTF-8 handling: decodes and encodes codepoints, validates sequences, and replaces malformed bytes with U+FFFD. This solves a recurring problem for C tools that parse or emit JSON, and the file is isolated enough to drop into any parser or I/O layer needing robust Unicode normalization.

file: src/jv_unicode.c ↗ | tags: #utf8 #validation #string-processing

Vendored David M. Gay dtoa implementation, adapted with portability and threading macros. It provides correctly rounded decimal<->binary conversion for JSON numbers, preserving round-trip fidelity. Heavily specialized but battle-tested and independently reusable in any language runtime or parser needing exact float formatting.

file: src/jv_dtoa.c ↗ | tags: #dtoa #floating-point #number-parsing

jq's module system: resolves import/include directives across -L paths and JQ_LIBRARY_PATH, topologically loads .jq/.json dependencies, caches loaded modules, and rejects circular imports. The design is a compact reference for adding module semantics to a scripted DSL runtime.

file: src/linker.c ↗ | tags: #module-loader #dependency-resolution #dsl-runtime
Last analyzed: 2026-10-02 09:36:20.996330
Next check: 2026-10-09 09:36:20.976872
$ submit: