Open travisstaloch opened 4 years ago
Hey tw0st3p, thank you. I did some more work today, I got to a point where I really want to see the original code run so that I can double check my understanding because I suspect I might have found a case where the algorithm could be improved (unlikely, but who knows).
So next stream I'm going to try your code out for sure. I want to see the debug prints from the C code, so if you happen to be online, make sure to say hi :)
Thanks again!
Hey I guess I missed you today. Just sat down as your stream was ending I think. Hope to catch you next time. I'll check out the vod and see what you were up to.
I translated a few more tests. Each test is named exactly after the function from test-rax.c which it is translated from. I put this code into gist: https://gist.github.com/travisstaloch/d2dc26daa6f02ed6ed7093369c582f28
Last one was tricky and was segfaulting in raxRemove becasue I had mis-defined data: *c_void
rather than data: **c_void
. :fearful:
Looks like you made some good progress. Look forward to your next stream.
Hey Lloris, I'm tw0st3p on twitch. I know you're thinking of doing some kind of testing to make sure your code is producing the same results as the original. I thought this might help toward that goal. The code below uses raxInsert() and raxFind() functions from zig. The extern definitions make passing zig strings easier. I left commented out wrapper versions which work also and omit the len parameter.
Maybe this is useful to you. I don't know I was just just bored and found this interesting. :man_shrugging: