4 ms·
sum types can often eliminate the need for reflection, and can have lower runtime cost.
by ansgri 3y ago
sum types can often eliminate the need for reflection, and can have lower runtime cost.
- pjmlp 3y agoCompile time reflection doesn't have runtime cost.
- lostdog 3y agoCompile time reflection doesn't work for this case.
- pjmlp 3y agoTemplate metaprogramming techniques as poor man's reflection prove otherwise. Additionally that is one of the examples on the ongoing C++ reflection papers. Then there are a couple of examples in D, Common Lisp, Scheme, C# code generators.
- lostdog 3y agoNo? A JSON object could have any type at run time. You cannot do anything at compile time to figure out the right type. Please point to a specific library if you disagree.