Sze
June 20, 2026, 1:18pm
22
It was an attempt to reduce the number of fresh Brainstorming topics created by very new users, which often haven’t read any existing topics, suggesting things that have been discussed a lot already.
This topic especially seems like another iteration of parts of these topics (ordered in reverse chronological order):
And here some quotes I agree with:
I personally think that it is also a strength that anytype doesn’t require type constraints.
For example in your case you are over-constraining the add function.
You want a type that has the + operator, but you constraining it to runtime integers and runtime floats. But @Vector types as well as comptime_int and comptime_float also support +.
I think in this case it actually hurts readability to have this complex validation function.
Furthermore I think the error message provided by the compi…
I think anytype is fine as it is, and cannot be improved without changing other parts of the language and making it more complicated.
Maybe the introduction of some kind of compile time interfacese/traits would help, but this would fundamentally change the language and it will produce other problems elsewhere (e.g. consider 2 different libraries which both have a different declaration of the same interface).