r/programming • u/gingerbill • Sep 02 '26
CTTI is Exponential, RTTI is Linear
https://www.gingerbill.org/article/2026/09/02/ctti-is-exponential-rtti-is-linear/
96
Upvotes
r/programming • u/gingerbill • Sep 02 '26
View all comments
Show parent comment
5
u/gingerbill Sep 03 '26
Zig is an example of the naïve printing I describe. It has to produce a new instantiation for each unique ordering of argument types that get passed to, since people typically produce an anonymous struct (i.e. tuple syntax):
.print("...", .{...})style call.So no, it does a really poor job because of its naïve use of CTTI here.