Proposal: procedural comptime type manipulation #2890
Labels
proposal
This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
I'm rather new to Zig, so apologies if this is something that's already in the works or has already been discussed before.
I was surprised and happy to see the
@field()
builtin function, but it seems like only the start of what could be a much larger set of features. In particular:type
, not just fields.type
s are immutable, this would probably take the form of builtins that produce new anonymous types from existing ones.There are a number of use cases I can think of:
comptime
.struct
from an@cImport
and generating a new "glue" interface. For instance, acomptime
OpenGL extension loader generator that learns about available procedures by browsing the Zig definitions generated from the headers.The text was updated successfully, but these errors were encountered: