Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2023-05-28 00:00:00Z and 2023-05-29 00:00:00Z
Avatar
I got a question in regard to the huffman implementation in the Teeworlds code: https://github.com/teeworlds/teeworlds/blob/26d24ec061d44e6084b2d77a9b8a0a48e354eba6/src/engine/shared/huffman.cpp#LL75C1-L76C1 HUFFMAN_MAX_SYMBOLS being 257 and m_Symbol being of type unsigned char The loop reaches the value 256 which is out of bounds of what an unsigned char can represent. Is that behavior correct and intended?
12:07
it basically overflows.
Avatar
chillerdragon BOT 2023-05-28 13:37:57Z
Are you building a client in go from scratch?
Avatar
somewhat yes
Avatar
chillerdragon BOT 2023-05-28 13:39:00Z
Cool
13:39
Never roll your own Huffman itโ€™s such a time killer
13:40
For my ruby client I just took the C++ code from teeworlds and added some ruby bindings
Avatar
I don't see any huffman library in the Go space that I'm capable of using D:
Avatar
chillerdragon BOT 2023-05-28 13:40:45Z
Just wrap the C++ code or tell Heinrich to publish his rust crate for go
Avatar
C bindings bad
13:41
really bad
Avatar
chillerdragon BOT 2023-05-28 13:41:03Z
Why
Avatar
in the Go space using C bindings comes most of the time with lots of problems so a pure Go implementation is preferred imo.
Avatar
ChillerDragon BOT 2023-05-28 13:42:48Z
i see
Avatar
and Go - C data transfer has an overhead
Avatar
ChillerDragon BOT 2023-05-28 13:43:04Z
sad
13:44
Some Teeworlds stuff in Rust. Contribute to heinrich5991/libtw2 development by creating an account on GitHub.
Avatar
maybe I should watch your linked video ๐Ÿ˜„ about the algorithm
13:45
but porting the code seems pretty straight forward
Avatar
ChillerDragon BOT 2023-05-28 13:45:35Z
the video just helps with the bigger picture
Avatar
except for not having pointer arithmetic
Avatar
ChillerDragon BOT 2023-05-28 13:45:47Z
but i never did dive into the technical details because i was too lazy
Avatar
ChillerDragon BOT 2023-05-28 13:46:14Z
python also has no pointers
Avatar
I do have pointers
Avatar
ChillerDragon BOT 2023-05-28 13:46:34Z
A project that probably i'll never end... Contribute to edg-l/TeeAI development by creating an account on GitHub.
13:46
this has known bugs tho ._.
Avatar
and if I used the unsafe standard library, I'd also have a way to convert pointers to integers but meh.
13:51
I can only imagine the pain of implementing that in a dynamically typed language D:
Exported 29 message(s)