Post AhoqBaztPCUlaY2kzo by ekuber@hachyderm.io
(DIR) More posts by ekuber@hachyderm.io
(DIR) Post #AhoqBaztPCUlaY2kzo by ekuber@hachyderm.io
2024-04-30T21:19:43Z
0 likes, 0 repeats
Out of curiosity, I did a quick check to see how many `impl Trait` return types are object safe in the rustc codebase, meaning they could always be turned into a type-erased `Box<dyn Trait>`, and the ratio of object-safe/not object-safe is ~10:1.I don't know what that tells us, but found it interesting.I wonder what the performance impact in compile times and the produced binaries of turning these into trait objects automatically and transparently.#RustLang #rust
(DIR) Post #AhoqBeKZ0noRvWjo8G by ekuber@hachyderm.io
2024-04-30T21:21:44Z
0 likes, 0 repeats
This seems to be in the same "neighborhood" as "polymorphization" (turning functions with type parameters into functions that take trait objects without developer action when it would not affect runtime performance, improving compile times by avoiding monomorphization and reducing generated code).