Hacker News new | past | comments | ask | show | jobs | submit login

Simplest to compile, but very hard to optimize, hence why register and restrict are needed, among many other tricks.

But that is a talk for other day.




Most compilers I know of do register allocation better than nearly all humans where optimization is important.

Aliasing is a problem, but I don't think it's strictly inherent to C.


> Most compilers I know of do register allocation better than nearly all humans where optimization is important.

Nowadays yes, you are forgetting C has 40 years of research into compiler optimization.

We could easily beat the register allocator in the 90's with Assembly coding, specially in x86.

There is a quote from a famous woman in compiler research from the mid-80's, where she claims C semantics have thrown the optimization research back to the dinosaur age.

Sadly I cannot find it, as I don't remember the exact words.

> Aliasing is a problem, but I don't think it's strictly inherent to C.

Most languages have stricter semantics for aliasing and do not decay arrays into pointers.

Also they tend to have better type information, which can help the optimizer.


Far from being needed, "register" has been completely ignored by compilers for many years now.


Nowadays, but back when C was barely used outside UNIX it was essential.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: