News for hackers. Stuff that matters.
Re:Which programming language or compiler is faster by ReleaseCandidat on Saturday December 18, 2021 @03:07PM (#29608046)
> There's no way C can be other than marginally faster than C++

In theory `restrict` (to disallow pointer aliasing like in Fortran) could lead to optimization gains, same as not having exceptions (the possibility of exceptions prohibits certain optimizations of the C++ compiler).

Re:Which programming language or compiler is faster by dorinlazar on Saturday December 18, 2021 @03:37PM (#29608275)
I agree; of course, both clang and gcc extend C++ with __restrict__ if I remember correctly; from what I know, there are more things that can be done in C++ to improve over C than the other way around.
Re:Which programming language or compiler is faster by khoobid_shoma on Saturday December 18, 2021 @09:05PM (#29610692)
IIRC, __restrict__ in clang and g++ does nothing when you write C++ code. It is there just for compatibility with C.