4 ms·
I would love to see a Python (or Haskell) implementation of gzip (and others) that is optimized for: * readability and * introspection rather than speed and
by vog 13y ago
I would love to see a Python (or Haskell) implementation of gzip (and others) that is optimized for:
* readability and
* introspection
rather than speed and memory usage. That way, you could step into every primitive, and see intermediate results in a human-readable representation (as provided by the programming language). Encoding that stuff to binary would always happen in a separate step.
That way, those compression algorithms, with all details, would be easier to learn and to understand. Also, development of new, customized compression schemes would be a lot easier than it is today, where you either have to take existing ones, or have to start from scratch.
A custom implementation might be as simple as a rearrangement and recombination of existing building blocks, or may introduce completely new (possibly domain specific) building blocks.
- joosters 13y agoGNU gzip is surprisingly well commented (as in, I was surprised to find some multi paragraphed comments at all!) For understanding the algorithm, surely it's better to look at sources like this document rather than a code interpretation of it?
- EdwardCoffin 13y agoI'd say that being able to interact with a readable implementation designed for pedagogy, while it works on data chosen by me, would be an excellent supplement to reading this document.
- markrages 13y agoThe RFCs mentioned by the article (RFC1950 / RFC1951 / RFC1952) are already quite readable.