14:04 < bridge> I got a question in regard to the huffman implementation in the Teeworlds code: 14:04 < bridge> https://github.com/teeworlds/teeworlds/blob/26d24ec061d44e6084b2d77a9b8a0a48e354eba6/src/engine/shared/huffman.cpp#LL75C1-L76C1 14:04 < bridge> HUFFMAN_MAX_SYMBOLS being 257 14:04 < bridge> and m_Symbol being of type unsigned char 14:04 < bridge> The loop reaches the value 256 which is out of bounds of what an unsigned char can represent. Is that behavior correct and intended? 14:07 < bridge> it basically overflows. 15:37 < bridge> Are you building a client in go from scratch? 15:38 < bridge> somewhat yes 15:39 < bridge> Cool 15:39 < bridge> Never roll your own Huffman itโ€™s such a time killer 15:40 < bridge> For my ruby client I just took the C++ code from teeworlds and added some ruby bindings 15:40 < bridge> I don't see any huffman library in the Go space that I'm capable of using D: 15:40 < bridge> Just wrap the C++ code or tell Heinrich to publish his rust crate for go 15:40 < bridge> C bindings bad 15:41 < bridge> really bad 15:41 < bridge> Why 15:42 < bridge> in the Go space using C bindings comes most of the time with lots of problems so a pure Go implementation is preferred imo. 15:42 < ChillerDragon> i see 15:42 < bridge> and Go - C data transfer has an overhead 15:43 < ChillerDragon> sad 15:44 < ChillerDragon> @jxsl13 then this might be a good read https://github.com/heinrich5991/libtw2/blob/master/doc/huffman.md 15:44 < bridge> maybe I should watch your linked video ๐Ÿ˜„ about the algorithm 15:45 < bridge> but porting the code seems pretty straight forward 15:45 < ChillerDragon> the video just helps with the bigger picture 15:45 < bridge> except for not having pointer arithmetic 15:45 < ChillerDragon> but i never did dive into the technical details because i was too lazy 15:45 < bridge> same 15:46 < ChillerDragon> python also has no pointers 15:46 < bridge> I do have pointers 15:46 < ChillerDragon> https://github.com/edg-l/TeeAI/blob/master/engine/huffman.py 15:46 < ChillerDragon> this has known bugs tho ._. 15:47 < bridge> and if I used the unsafe standard library, I'd also have a way to convert pointers to integers but meh. 15:51 < bridge> I can only imagine the pain of implementing that in a dynamically typed language D: