My Experience of building Bytebeat player in Zig

blog.karanjanthe.me

99 points by KMJ-007 7 days ago


ww520 - 3 days ago

Arena Allocator is great, especially for periodic frame based allocations, e.g. rendering loop, game loop, request handling, etc. You just reset the arena at the end of every frame. It has the feature to reset and retain the memory allocated underneath. It's just a reset of the arena pointer.

kragen - 3 days ago

I took a similar approach when I wrote a bytebeat player in CPython for a nightclub performance (https://github.com/kragen/pytebeat), but I used a shunting-yard parser rather than a Pratt parser.

diek - 3 days ago

From the description I thought the expression was a function of only 't', and there was no (for instance) accumulation of the previously computed byte. Then in the image I saw the same value of 't' evaluating to different values:

t=1000: 168 t=1000: 80

Reading the source: https://github.com/KMJ-007/zigbeat/blob/main/src/evaluator.z...

It does look like the expression is a pure function of 't', so I can only assume that's a typo.

- 3 days ago
[deleted]