Quoting 'Kenton Varda' via Cap'n Proto (2020-04-30 18:51:40) > Yeah, I think if we really really wanted to do this, the approach I'd > take is to have the capnp code generator output full specializations > for each permutation of primitive type arguments. The really hard part > is deciding which permutations to generate. You don't really know which > specializations are needed until they are used, but if you generate > them at the usage site, then you potentially end up with duplicates -- > these are all the same problems that C++ templates have. I suppose we > could do what C++ compilers do and, like, output weak symbols, but even
> if that works in C++, I suspect it won't work in many other languages. Yeah, this sounds like it would be incredibly difficult to implement in almost anything else. Even in languages like Rust which use the same underlying execution model for generics, you can't do template specialization, and type parameters still have to be treated uniformly at the source level. And capnproto is complex enough for implementers to begin with. -Ian -- You received this message because you are subscribed to the Google Groups "Cap'n Proto" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/158828862392.32483.15066542259944583798%40localhost.localdomain.
