News for hackers. Stuff that matters.
Re:Sayonara, C++, and Hello to Rust by MauranKilom on Tuesday December 07, 2021 @05:07AM (#29470800)
> Sure, because they're not type safe. Templates simply aren't a type system extension, they're more like macros.

Could you elaborate in which way C++ templates are not type-safe? Does the upcoming concepts feature alleviate any of it?

Re:Sayonara, C++, and Hello to Rust by choeger on Tuesday December 07, 2021 @10:57AM (#29473901)
A type safe language has a deterministic, terminating algorithm that can prove the absence of certain errors in a program. For instance you cannot use integers instead of functions in well-typed a Haskell program whereas you can make this mistake in a python program.

C++ Templates are not type safe because they need to be evaluated before you can make any statement about their successful, correct application. This evaluation might not terminate. Macros habe the same issue, of course, but they explicitly give you a Turing-complete programming language so it feels more natural.