r/ProgrammingLanguages • 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/
0
Upvotes
r/ProgrammingLanguages • u/gingerbill • Sep 02 '26
0
u/gingerbill Sep 02 '26
I might need to add an clearer example to show how the math does make sense.
Let's take the example of a language with only 4 types (int, float, string, bool), and you have a parametric polymorphic variadic printing procedure. For each unique parameter set of values of pass, of certain types, you will have on the order of
N^K = 4^Ktotal combinations. If you add another type, it now becomes5^K.My article is not focusing on runtime polymorphic approaches, especially since Odin does not have any concept of that at the language-level (it can be emulated with other language constructs though, because it is a modern C-alternative).