3 ms·
Yeah, I think a degree of complexity is required to achieve being the fastest compiled language. To achieve that, you need stuff like monomorphized templates,
by trealira 3y ago
Yeah, I think a degree of complexity is required to achieve being the fastest compiled language.
To achieve that, you need stuff like monomorphized templates, actual arrays and slices being distinguished from pointers, well-defined rules on pointers (like Rust's rules about references and mutable references, or strict aliasing in C++), and the freedom to let the compiler reorder structure fields for better alignment and space usage. Runtime polymorphism, like virtual functions in C++, are better as a core language feature rather than something implemented as a struct of function pointers, because that way the compiler can devirtualize some calls.
All of these things, I think most C programmers would be against adding to C. And pointer rules are historically controversial; for example, Dennis Ritchie was against adding noalias to C in 1988[1].
[1]: https://www.yodaiken.com/2021/03/19/dennis-ritchie-on-alias-analysis-in-the-c-programming-language-1988/ https://www.yodaiken.com/2021/03/19/dennis-ritchie-on-alias-...