Remix.run Logo
jayd16 12 hours ago

So redo the templates.

AlotOfReading 12 hours ago | parent [-]

They did, hence concepts and constexpr. Rust has more powerful versions of both in traits and macros.

jayd16 11 hours ago | parent [-]

Aren't Rust compiles slow as well? I'm suggesting they take a different approach. Are these systems really needed seeing as other languages do without?

AlotOfReading 9 hours ago | parent [-]

Other languages don't do without them, the costs are just worse in Rust (and C++). Go for example consciously tried to avoid shipping generics and was forced to implement them by community pressure. They now pay the same kinds of monomorphization costs as C++ and Rust because the alternatives have greater runtime costs. Go is simply a faster-compiling language overall though and the problem is less noticeable. Macros are similarly ubiquitous in other functional languages, but most of them aren't compiled or meaningfully optimized.

Rust is complex, highly expressive, and does a lot of optimization. None of that's good for compile times. C++ is even worse because of how awful the template abuse gets and the amount of duplicated code that's fed into the compiler from how #includes work.