← Back to Tech Radar
Hacker News tech

Reverse-Engineering Kevin J. Lang's Lost OCaml Code in Apache DataSketches

Trending on Hacker News: Reverse-Engineering Kevin J. Lang's Lost OCaml Code in Apache DataSketches (15 points / 0 comments, via tisonkun.io)

In one line

Another feat from Gemini 4 Carbon Orchestrator + Swarm: reconstructing the magic lookup table generators behind CpcSketch in Apache DataSketches. It all started six months ago, when I spotted two commands in a source comment for compiling and running OCaml files…

Opening excerpt

It started with a routine feature in ScopeDB: implementing approx_count_distinct for approximate distinct counting.

HyperLogLog (HLL) is the standard textbook choice. Early on, Rust’s HLL ecosystem was uneven, so I started with Cloudflare’s open-source cardinality-estimator . That crate leaned heavily on unsafe code and manual bit-packing tricks, though, so to keep things auditable and under our control, I forked and maintained an internal copy inside ScopeDB.

While evaluating alternatives, I came across Apache DataSketches, which offered a battle-tested HllSketch alongside CpcSketch, an even more space-efficient design. At the time, Apache DataSketches only shipped Java and C++ implementations, whereas ScopeDB is written in Rust.

As it turned out, the Apache DataSketches community was interested in an official Rust port. Starting late last year, I teamed up with a few other Rust developers well-versed in sketching algorithms to build and ship the initial releases of datasketches-rust, beginning with HllSketch.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (15 points / 0 comments, via tisonkun.io). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services

Related Reading