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
jxsl13
2023-05-28 12:04:08Z
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.
chillerdragon
BOT
2023-05-28 13:37:57Z
Are you building a client in go from scratch?
jxsl13
2023-05-28 13:38:35Z
somewhat yes
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
jxsl13
2023-05-28 13:40:22Z
I don't see any huffman library in the Go space that I'm capable of using D:
chillerdragon
BOT
2023-05-28 13:40:45Z
Just wrap the C++ code or tell Heinrich to publish his rust crate for go
jxsl13
2023-05-28 13:40:57Z
C bindings bad
13:41
really bad
chillerdragon
BOT
2023-05-28 13:41:03Z
Why
jxsl13
2023-05-28 13:42:39Z
in the Go space using C bindings comes most of the time with lots of problems so a pure Go implementation is preferred imo.
ChillerDragon
BOT
2023-05-28 13:42:48Z
i see
jxsl13
2023-05-28 13:42:58Z
and Go - C data transfer has an overhead
ChillerDragon
BOT
2023-05-28 13:43:04Z
sad
13:44
@jxsl13
then this might be a good read
https://github.com/heinrich5991/libtw2/blob/master/doc/huffman.md
libtw2/huffman.md at master · heinrich5991/libtw2
Some Teeworlds stuff in Rust. Contribute to heinrich5991/libtw2 development by creating an account on GitHub.
jxsl13
2023-05-28 13:44:49Z
maybe I should watch your linked video
about the algorithm
13:45
but porting the code seems pretty straight forward
ChillerDragon
BOT
2023-05-28 13:45:35Z
the video just helps with the bigger picture
jxsl13
2023-05-28 13:45:36Z
except for not having pointer arithmetic
ChillerDragon
BOT
2023-05-28 13:45:47Z
but i never did dive into the technical details because i was too lazy
jxsl13
2023-05-28 13:45:57Z
same
ChillerDragon
BOT
2023-05-28 13:46:14Z
python also has no pointers
jxsl13
2023-05-28 13:46:31Z
I do have pointers
ChillerDragon
BOT
2023-05-28 13:46:34Z
https://github.com/edg-l/TeeAI/blob/master/engine/huffman.py
TeeAI/huffman.py at master · edg-l/TeeAI
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 ._.
jxsl13
2023-05-28 13:47:20Z
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)