cjq: A Compiler for the jq Programming Language
jq is a functional programming langauge, known for its ability to filter, transform,and manipulate JSON data with concise syntax. The standard implementation of jq includes a source-to-bytecode compiler and a stack-based virtual machine (VM). This thesis introduces cjq v0.1, a compiler that translates jq bytecode into LLVM intermediate representation (IR). By leveraging LLVM’s compiler infrastructure, cjq reliably enhances runtime performance for small to medium-sized JSON inputs when compared to the standard jq implementation. However, the current tracing module in cjq becomes a bottleneck for certain types of large-scale JSON inputs. cjq combines the functional elegance of jq with the performance benefits of compiled languages, aiming to deliver a robust tool for modern data processing tasks. Future work involves optimizing the tracing module to improve scalability and exploring further enhancements to extend cjq’s capabilities.