This is just a proof of concept. The algorithm is taken from Raftery, et al., "The vote Package: Single Transferable Vote and Other Electoral Systems in R", The R Journal, 2021, p. 681.
To build the zig implementation, call:
zig build-lib -dynamic -target wasm32-freestanding main.zig -femit-bin=main.wasm -rdynamic -O ReleaseSmall