From creating my 3D pixel game engine.
Pain Points:
- Lack of easy polymorphism: I currently used tagged unions and it's fine-ish, but having interfaces or traits in the language would make it infinitely more ergonomic to use.
- Casting is a nightmare: There really needs to be a shorter way to cast from int -> float and vice-versa. Compare C's
(float)
with Zig's@as(f32, @floatFromInt(...))
. If I could write@floatFromInt(f32, ...)
it would already be much better.
Nice to have:
- Comptime methods: I wanted to add swizzling methods for my custom vector struct, however you cannot generate methods at compile time (?). It would be nice to have a function e.g.
Vector(dimension, components)
which can then generate swizzle methods for each combination of components. I imagine callingvec.xyzz()
and having that method be generated and even inlined at compile time. - Easier way to do vector maths: I currently call
vec.mul(other)
but it would be nice to writevec * other
. This requires operator overloading however, which isn't great. Maybe some kind of comptime based DSL?