We rewrote JSONata with AI in a day, saved $500k/year
71–80 of 278 posts
Re: We rewrote JSONata with AI in a day, saved $500k/year
#72My use case is a bit different. I wanted JSONata as the query language to query Flatbuffers data (via schema introspection) in Rust, due to its terseness and expressiveness, which is a great combination for AI generated queries.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#73The key point for me was not the rewrite in Go or even the use of AI, it was that they started with this architecture: > The reference implementation is JavaScript, whereas our pipeline is in Go. So for years we’ve been running a fleet of jsonata-js pods on Kubernetes - Node.js processes that our Go services call over RPC. That meant that for every event (and expression) we had to serialize, send over the network, ev…
Yeah, it's like those posts "we made it 5,000x faster by actually thinking about what the code is doing."
Re: We rewrote JSONata with AI in a day, saved $500k/year
#74So they used an ai trained on the original source code to "rewrite" the original source code.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#75The docs indicate there are already 2 other go implementations. Why not just use one of those? https://docs.jsonata.org/overview.html
Re: We rewrote JSONata with AI in a day, saved $500k/year
#76For context, JSONata's reference implementation is 5.5k lines of javascript.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#77Years ago I hired an Upwork contractor to port v1.5.3 to golang as best he could. He did a great job and it served us well, however it was far, far from perfect and it couldn't pass most of the JS test suite. The worst was that it had several recursion bugs that could segfault with bad expressions.
That was the now-deprecated implementation at
https://github.com/blues/jsonata-go
Early in 2025 I used Claude Code and Codex to do a proper, compliant port that passes the full set of tests and is safe. It was most certainly not a trivial task for AI, as many nuances of JSONata syntax derive from its JS roots.
Regardless, it was a great experience and here's the 2.0.6 AI port, along with a golang exerciser that lets you flip back and forth between the implementations. We did a seamless migration and it's been running beautifully in prod in Blues' Notehub for quite a while - as a core transformation capability used by customers in our JSON message pipeline.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#78The key point for me was not the rewrite in Go or even the use of AI, it was that they started with this architecture: > The reference implementation is JavaScript, whereas our pipeline is in Go. So for years we’ve been running a fleet of jsonata-js pods on Kubernetes - Node.js processes that our Go services call over RPC. That meant that for every event (and expression) we had to serialize, send over the network, ev…
You aren’t accounting for managerial politics. A product manager won’t gamble on a large project to lower operating cost, when their bonus is based on customer acquisition metrics.
The use of ai agents allowed them to shrink the problem down to the point where it was small enough to fit in their free time and not interrupt their assigned work.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#79As long as you are using JSON, you will be able to optimize. Did you know that you can pass numbers up to 2 billion in 4 constant bytes instead of as a string of 20 average dynamic bytes? Also, fun fact, you can cut your packets in half by not repeating the names of your variables in every packet, you can instead use a positional system where cardinality represents the type of the variable. And you can do all of this…
So I don't see there is any point in the article.
Re: We rewrote JSONata with AI in a day, saved $500k/year
#80The key point for me was not the rewrite in Go or even the use of AI, it was that they started with this architecture: > The reference implementation is JavaScript, whereas our pipeline is in Go. So for years we’ve been running a fleet of jsonata-js pods on Kubernetes - Node.js processes that our Go services call over RPC. That meant that for every event (and expression) we had to serialize, send over the network, ev…