In Zig, basic operations on vectors with standard operators work fine. "+", for example.
const meta = @import("std").meta;
test "vector add" {
const x: @Vector(4, f32) = .{ 1, -10, 20, -1 };
const y: @Vector(4, f32) = .{ 2, 10, 0, 1 };
const z = x + y;
try expect(meta.eql(z, @Vector(4, f32){ 3, 0, 20, 0 }));
}
Everything is element-wise, which matches what the shading languages do (mostly).But, yes, you won't get overloading allowing things like dot, cross, or scalar products. And I do miss the swizzle notation, but I don't think the language actually prevents that so it might appear at some point.
C3 allows arbitrary extensions of any types, so things like `vec1.dot(vec2)` is actually implemented as a generic method macro over all vector types added by the math module.
Given Zig's preference for closed modules, I don't expect this to be on the roadmap, but rather would need to be implemented as functions.