|
|
|
|
|
by nicoty
25 days ago
|
|
Out of curiosity, what do you think is wrong with monomorphization-based polymorphism? The other alternatives I'm aware of are 1. type-erasure via v-table based dynamic dispatch (which Rust also has in the form of the `dyn` keyword), which has performance and memory-allocation overhead and 2. macros, which Rust also has and, if used for polymorphism, would essentially be like compile-time monomorphization, but clunkier. Maybe I'm missing something though and there are other alternatives done differently in other languages? |
|
I also think that where you want monomophization, macro seem fine. I do not think this necessarily has to be clunky, but this is just a guess.