One thing I miss in #Zig compared with shaders/clang ext_vector is postfix syntax for vector swizzles.

So, weekend experiment as a compiler noob: can I locally modify the compiler to allow postfix syntax via a kind of vector gather op? Answer: yes!

The #Zig folks understandably do not want language proposals from outside their core team, so this is just a local experiment.

I was surprised how easy it was to just start hacking on the compiler though! Code changes are here if anyone is interested: https://codeberg.org/sjb3d/zig/compare/bbc77df..vector-gather-shuffle

zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

Codeberg.org
@sjb3d I also wish I could use them without them being tied to vector cpu instructions. Sometimes I want the nice syntax when loading into vector registers may not make much sense.
I dont particularly want to store Vector(3, float) everywhere either as they actually take 4 floats of storage.
I ended up using them very little because of that.
@sjb3d I keep peeking over the zig fence and recently saw the zig claw ai agent thingy breaking all the perf records. How you finding it compared to c/++ of say golang?

@kimau I don't know about golang, but as a human with a happy place of mostly the C subset of C++, I find Zig to be great. Comptime does anything I would use macros/templates for, I like the stdlib choices, and you can directly call into C libs.

Just be aware that the language is unstable, in particular lots of breaking standard library changes coming in 0.16 for io.