News for hackers. Stuff that matters.
Re:Gzip decompression in 250 lines of Rust by stgn on Friday March 27, 2026 @11:39AM (#47544096)
> so i wrote a gzip decompressor from scratch

After skimming through the author's Rust code, it appears to be a fairly straightforward port of puff.c (included in the zlib source): https://github.com/madler/zlib/blob/develop/contrib/puff/puf...

Re:Gzip decompression in 250 lines of Rust by dymk on Friday March 27, 2026 @12:47PM (#47545111)
This feels like it should have been mentioned in the article.

It makes me wonder if there was some LLM help, based on how similar the fn structure and identifier names are.

Re:Gzip decompression in 250 lines of Rust by f1shy on Friday March 27, 2026 @01:06PM (#47545365)
> It makes me wonder if there was some LLM help

I would bet there was

Re:Gzip decompression in 250 lines of Rust by fuhsnn on Friday March 27, 2026 @01:48PM (#47545935)
> This feels like it should have been mentioned in the article.

With an entire section complaining how many lines of code existing implementations are, looks like they did found a good simple implementation to clone in Rust then deliberately not mention it.

Re:Gzip decompression in 250 lines of Rust by bitbasher on Friday March 27, 2026 @02:36PM (#47546548)
You could say it was a “puff” piece, eh, eh!?
Re:Gzip decompression in 250 lines of Rust by cmovq on Friday March 27, 2026 @04:40PM (#47547966)
Even the function names are identical :/
Re:Gzip decompression in 250 lines of Rust by Rexxar on Friday March 27, 2026 @08:53PM (#47550373)
The difference in size seems to be mainly due to the missing documentation before each function.
Re:Gzip decompression in 250 lines of Rust by ieviev on Friday March 27, 2026 @09:27PM (#47550577)
Oh i didnt even know of this. But i got a lot of help from this one

https://github.com/madler/infgen

EDIT: Didnt notice that it’s even by the same person of course it’s very similar

Re:Gzip decompression in 250 lines of Rust by pseudohadamard on Saturday March 28, 2026 @10:53AM (#47555133)
Meh, I've written a gzip decompressor in two lines of shell script:

  #!/bin/sh
  gzip -d $@