2 ms·
Another dev who doesn’t show respect to what has been done and expect a particular language will do wonders for him. Also I don’t see this is much better in ter
by up2isomorphism 7mo ago
Another dev who doesn’t show respect to what has been done and expect a particular language will do wonders for him. Also I don’t see this is much better in term of readability.
- hybrid_study 7mo agohe does mention https://github.com/trifectatechfoundation/zlib-rs https://github.com/trifectatechfoundation/zlib-rs not just https://github.com/madler/zlib https://github.com/madler/zlib, but it would be interesting to hear from those developers also
- maverwa 7mo agoWhere do you see the lack of respect? The author wanted to learn how gzip works and chose to implement it in a language they like to do so. As a learning tool, not because the world needs another gzip decompressor.
- mianos 7mo agoChose to paste the C into an LLM and said 'make it rust'?
- flykespice 7mo agoWhat is your source for that accusation?
- Rexxar 7mo agoOriginal zlib code: https://github.com/madler/zlib/blob/develop/contrib/puff/puff.c https://github.com/madler/zlib/blob/develop/contrib/puff/puf... The code of the article: https://github.com/ieviev/mini-gzip/blob/main/src/main.rs https://github.com/ieviev/mini-gzip/blob/main/src/main.rs Top level declarations of the C code: #define MAXBITS 15 #define MAXLCODES 286 #define MAXDCODES 30 #define MAXCODES #define FIXLCODES 288 struct state local int bits(struct state *s, int need) local int stored(struct state *s) struct huffman local int decode(...) local int construct(...) local int codes(...) local int fixed(...) local int dynamic(...) int puff(...) Top level declarations of the Rust code: const MAXBITS: usize = 15; const MAXLCODES: usize = 286; const MAXDCODES: usize = 30; const FIXLCODES: usize = 288; const MAXDIST: usize = 32768; struct State<'a> struct Huffman<'a> fn decode fn construct fn codes fn fixed fn dynamic fn stored pub fn inflate
- flykespice 7mo ago..that doesn't proves anything. it's just convenient configuration macros and generic procedures names being reused to implement the steps for the DEFLATE algorithm. There are only finites ways for you to express a piece of code in a language.