Feels like Rust culture inherited "throw and forget" as an error handling "strategy" from Java
Sigh.
You can leave the snide comments about “Rust culture” (whatever that is) out next time.
* https://www.nayuki.io/page/deflate-specification-v1-3-html
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...
MisterTea•1h ago
Keep in mind this is also 31 years of cruft and lord knows what.
Plan 9 gzip is 738 lines total:
Even the zipfs file server that mounts zip files as file systems is 391 lines.edit - post a link to said code: https://github.com/9front/9front/tree/front/sys/src/cmd/gzip
> ... (and whenever working with C always keep in mind that C stands for CVE).
Sigh.
tyingq•1h ago
kibwen•1h ago
tyingq•53m ago
More reasons it's an odd comparison.
nayuki•39m ago
xxs•31m ago
Java CRC32 nowadays uses intrinsics and avx128 for crc32.
ack_complete•34m ago
The Huffman decoding implementation is also bigger in production implementations for both speed and error checking. Two Huffman trees need to be exactly complete except in the special case of a single code, and in most cases they are flattened to two-level tables for speed (though the latest desktop CPUs have enough L1 cache to use single-level).
Finally, the LZ copy typically has special cases added for using wider than byte copies for non-overlapping, non-wrapping runs. This is a significant decoding speed optimization.
fullstop•1h ago
xxs•33m ago
bboozzoo•38m ago