Bit of a vague question i suppose because wouldn't that depend on the library?
i'm new to audio as a whole so i don't know much but i'm weighing whether i should develop my applications in zig or stick to C for now (i would still like to learn zig anyway and i'll hopefully give it a try at some point so i know what i'm up against but i was hoping someone with some better experience than me could wager in)
#Is zig good (and or any better than C/C++) for audio signal analysis?
1 messages · Page 1 of 1 (latest)
I would ask in #audio-dev, since most people chatting there probably arent checking out #1019652020308824145 regularly
as a language it is better (I am sure you can see the bias), and it can work with any c library you'd otherwise use.
I'd use zig if you are writing your own audio processing code, c++ if you want to use existing libraries
i didn't even see #audio-dev ! my bad thanks :)
that sounds promising!
The best I can give you otherwise is that Zig will be able to use C (not C++!) libraries fairly easily, so it's not like you'll be dependent on a Zig ecosystem
Zig comptime allows you to write code in a generic way, that compiles fast, it's nicer than c++ templates
But for existing libs, c++ interop is better.
Also, depending how much can you use it, zig has vectors and some rudimentary operations on them. Full SIMD involves inline asm, while in c++ you can use intrisics.
From my limited understanding and interaction with people who know simd, the primary benefit of simd in zig is the ability to construct masks and stuff at comptime. Otherwise the support is so-so
i prefer inline - is there an example i can see of inline in zig?
This is good topic on simd in zig https://ziggit.dev/t/shuffle-vector-with-variable-control/15846
Ziggit
There is an accepted proposal Indexing arrays with vectors (gather) #12815 which if i understand correctly would allow one to shuffle (or permute) an @Vector with a runtime control. However I cannot find any active development on that issue. Meantime the posted workaround on that page is no longer working with the latest zig version. I tried t...