4 ms·
Why are generics more usable than codegen in that use case?
by maccard 5y ago
Why are generics more usable than codegen in that use case?
- vlowther 5y ago... writing the code required to write the code needed to implement indexes is more fragile than letting the compiler do it for you, most likely. I maintain a reflect-based indexing implementation for in-memory data, and look forward to seeing what I can do with generics to get rid of reflect based overhead.
- janderland 5y ago:shrug: I’ve tried doing it both ways in other languages and found that code gen is less fragile than I expected, though I needed to carefully consider the interface between generated & manually written code.
- woah 5y agoSomeone is working on an "ORM" that uses codegen from proto files, which we are already using for serialization. Not sure when it will be done. Compiler level generics are just a lot quicker and easier for anyone to use without requiring a whole code generation framework