18 ms·
Basic generics in rust don’t have that much overhead; it sounds like your conflating generics with templating. Generics aren’t Turing complete, unlike C++’s tem
by ComputerGuru 9y ago
Basic generics in rust don’t have that much overhead; it sounds like your conflating generics with templating. Generics aren’t Turing complete, unlike C++’s templates.
Other languages with powerful generics and type inference like modern C# clearly manage just fine, too.
- eptcyka 9y agoYes, but things like `fn do_something<T>(t: T) -> impl Future Where t: Serializable` definitely take a while. And C# has the added benefit of being JIT'ed, it doesn't have to flatten all the generic code during compilation, it can optimise later.
- pjmlp 9y agoC# could always be AOT compiled to dynamically linked native code via NGEN. It is also the only deployment option on iDevices and Windows Store since Windows 8. Also if you prefer other native examples, Ada, Eiffel, Sather, D come to mind.
- littlestymaar 9y ago> Generics aren’t Turing complete, unlike C++’s templates. They are actually, but only anecdotically (like PowerPoint is also Turing Complete).