Re:Using Zig to Provide Stack Traces on Kernel Panic for a B...
by lifthrasiir on Wednesday December 05, 2018 @06:17AM
(#18607310)
> It's what one would do themselves without generics, if they wanted to be able to use them with full speed.
Right, but in many cases they can be combined without much speed penalty. For example you can combine monomorphized functions when you only rely on methods that are expected to be costly and inlining has a negligible effect. With actual, not ad hoc, generics you may (hopefully) have a control over monomorphization---I think Rust's trait object is a good design for this reason.
Regarding this bloat thing, are monomorphized functions ever generated for types/signatures that are not actually _used_ in the program?
If not, it's not really bloat, is it? It's what one would do themselves without generics, if they wanted to be able to use them with full speed.