<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Shingo Kawamura</title>
    <description>The latest articles on DEV Community by Shingo Kawamura (@pannakoota).</description>
    <link>https://dev.to/pannakoota</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F132222%2Fd309af95-2ce1-4acb-8a99-922fb3c3f78a.png</url>
      <title>DEV Community: Shingo Kawamura</title>
      <link>https://dev.to/pannakoota</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pannakoota"/>
    <language>en</language>
    <item>
      <title>Why I Built a jq-Compatible Tool in Pure Perl (and Why It Still Matters)</title>
      <dc:creator>Shingo Kawamura</dc:creator>
      <pubDate>Fri, 02 Jan 2026 13:06:54 +0000</pubDate>
      <link>https://dev.to/pannakoota/why-i-built-a-jq-compatible-tool-in-pure-perl-and-why-it-still-matters-45a6</link>
      <guid>https://dev.to/pannakoota/why-i-built-a-jq-compatible-tool-in-pure-perl-and-why-it-still-matters-45a6</guid>
      <description>&lt;p&gt;Modern tooling often assumes a perfect world:&lt;br&gt;
latest Linux, internet access, package managers, and rebuildable binaries.&lt;/p&gt;

&lt;p&gt;Reality is different.&lt;/p&gt;

&lt;p&gt;In many production environments — especially enterprise, legacy, or air-gapped systems —&lt;br&gt;
those assumptions break down.&lt;/p&gt;

&lt;p&gt;That gap is why I built jq-lite.&lt;/p&gt;




&lt;p&gt;The Problem: jq Is Great — Until You Can’t Use It&lt;/p&gt;

&lt;p&gt;jq is an excellent JSON processor.&lt;br&gt;
But in real operations, I kept hitting walls:&lt;/p&gt;

&lt;p&gt;Legacy UNIX systems with outdated glibc&lt;/p&gt;

&lt;p&gt;Air-gapped environments with no package repositories&lt;/p&gt;

&lt;p&gt;Minimal containers without build tools&lt;/p&gt;

&lt;p&gt;Environments where “just install jq” was not an option&lt;/p&gt;

&lt;p&gt;In those cases, JSON processing didn’t disappear —&lt;br&gt;
the need became more critical.&lt;/p&gt;

&lt;p&gt;Shell scripts still had to be reliable.&lt;br&gt;
Automation still had to work.&lt;/p&gt;




&lt;p&gt;The Idea: A jq-Compatible Tool That Never Breaks Scripts&lt;/p&gt;

&lt;p&gt;I didn’t want another JSON tool.&lt;/p&gt;

&lt;p&gt;I wanted a tool that could be:&lt;/p&gt;

&lt;p&gt;Dropped into restricted systems&lt;/p&gt;

&lt;p&gt;Trusted in shell scripts&lt;/p&gt;

&lt;p&gt;Stable across years, not releases&lt;/p&gt;

&lt;p&gt;So I built jq-lite with three strict rules:&lt;/p&gt;




&lt;p&gt;Design Rule #1: Pure Perl, No Dependencies&lt;/p&gt;

&lt;p&gt;jq-lite is written in pure Perl.&lt;/p&gt;

&lt;p&gt;No native extensions&lt;/p&gt;

&lt;p&gt;No external libraries&lt;/p&gt;

&lt;p&gt;No compilation step&lt;/p&gt;

&lt;p&gt;If Perl exists, jq-lite runs.&lt;/p&gt;

&lt;p&gt;That means it works on:&lt;/p&gt;

&lt;p&gt;legacy Linux / UNIX&lt;/p&gt;

&lt;p&gt;minimal containers&lt;/p&gt;

&lt;p&gt;offline environments&lt;/p&gt;

&lt;p&gt;systems where only base OS tools are allowed&lt;/p&gt;

&lt;p&gt;Perl is still one of the most widely deployed runtimes in the world —&lt;br&gt;
especially in places modern tooling forgot.&lt;/p&gt;




&lt;p&gt;Design Rule #2: jq Compatibility Where It Matters&lt;/p&gt;

&lt;p&gt;jq-lite aims to be jq-compatible in daily CLI usage:&lt;/p&gt;

&lt;p&gt;echo '{}' | jq-lite --arg greeting hello '.hello = $greeting'&lt;/p&gt;

&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "hello": "hello"&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;The goal isn’t to clone every feature,&lt;br&gt;
but to support the jq patterns people actually use in automation.&lt;/p&gt;




&lt;p&gt;Design Rule #3: A Stable CLI Contract (This Is the Important Part)&lt;/p&gt;

&lt;p&gt;Here’s the part that made jq-lite different.&lt;/p&gt;

&lt;p&gt;jq-lite defines a documented CLI contract:&lt;/p&gt;

&lt;p&gt;exit codes&lt;/p&gt;

&lt;p&gt;error categories&lt;/p&gt;

&lt;p&gt;stderr prefixes&lt;/p&gt;

&lt;p&gt;stdout behavior on failure&lt;/p&gt;

&lt;p&gt;And that contract is tested.&lt;/p&gt;

&lt;p&gt;Exit Code   Meaning&lt;/p&gt;

&lt;p&gt;0   Success&lt;br&gt;
1   -e used and result was false / null / empty&lt;br&gt;
2   Compile error&lt;br&gt;
3   Runtime error&lt;br&gt;
4   Input error&lt;br&gt;
5   Usage error&lt;/p&gt;

&lt;p&gt;This means shell scripts can safely rely on jq-lite:&lt;/p&gt;

&lt;p&gt;if jq-lite -e '.enabled' config.json; then&lt;br&gt;
  deploy&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;No surprises.&lt;br&gt;
No silent behavior changes.&lt;/p&gt;

&lt;p&gt;In operations, this matters more than features.&lt;/p&gt;




&lt;p&gt;Why Not Rewrite It in Rust or Go?&lt;/p&gt;

&lt;p&gt;I get this question a lot.&lt;/p&gt;

&lt;p&gt;Because the problem wasn’t performance or language fashion.&lt;/p&gt;

&lt;p&gt;The problem was deployability and longevity.&lt;/p&gt;

&lt;p&gt;Perl already exists on:&lt;/p&gt;

&lt;p&gt;old servers&lt;/p&gt;

&lt;p&gt;enterprise systems&lt;/p&gt;

&lt;p&gt;restricted environments&lt;/p&gt;

&lt;p&gt;Adding jq-lite doesn’t require changing the environment —&lt;br&gt;
just using what’s already there.&lt;/p&gt;




&lt;p&gt;Who Is jq-lite For?&lt;/p&gt;

&lt;p&gt;jq-lite is not for everyone.&lt;/p&gt;

&lt;p&gt;It is for people who:&lt;/p&gt;

&lt;p&gt;maintain legacy systems&lt;/p&gt;

&lt;p&gt;write shell scripts that must survive years&lt;/p&gt;

&lt;p&gt;operate in restricted or offline environments&lt;/p&gt;

&lt;p&gt;care about CLI behavior as a contract, not a suggestion&lt;/p&gt;

&lt;p&gt;If you’ve ever thought&lt;br&gt;
“this script must not break in five years”&lt;br&gt;
— jq-lite is for you.&lt;/p&gt;




&lt;p&gt;Where to Find It&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/kawamurashingo/JQ-Lite" rel="noopener noreferrer"&gt;https://github.com/kawamurashingo/JQ-Lite&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CLI Contract: &lt;a href="https://github.com/kawamurashingo/JQ-Lite/blob/main/docs/cli-contract.md" rel="noopener noreferrer"&gt;https://github.com/kawamurashingo/JQ-Lite/blob/main/docs/cli-contract.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;CPAN: &lt;a href="https://metacpan.org/release/JQ-Lite" rel="noopener noreferrer"&gt;https://metacpan.org/release/JQ-Lite&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Alpine Linux package available&lt;/p&gt;




&lt;p&gt;Final Thought&lt;/p&gt;

&lt;p&gt;Modern tools optimize for speed of change.&lt;/p&gt;

&lt;p&gt;jq-lite optimizes for stability over time.&lt;/p&gt;

&lt;p&gt;Sometimes, that’s the more important optimization.&lt;/p&gt;




&lt;p&gt;Author&lt;br&gt;
川村慎吾（Shingo Kawamura）&lt;br&gt;
SRE / Infrastructure Engineer&lt;br&gt;
CPAN author of jq-lite&lt;/p&gt;

</description>
      <category>perl</category>
      <category>devops</category>
      <category>cli</category>
      <category>legacy</category>
    </item>
  </channel>
</rss>
