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

C is not aligned with modern hardware and optimizing compilers are severely hampered by things like undeclared pointer aliasing.



so then, add a declarator or two to solve the problem, don't just throw the baby out with the bathwater. The population of C programmers who understand how C works is the population of people who can understand how hardware works. The reverse has never been true, hardware designers have never understood software, and academic software experts have spent too much time babysitting college freshman who can't code and spend all their time dreaming about languages that freshmen could learn well enough to TA the course. But that's probably not a language good enough for systems programmers to adopt.


It is called restrict and usually a fun problem to debug if one causes UB by actually having two restrict pointers doing aliasing.


> C is not aligned with modern hardware and optimizing compilers are severely hampered by things like undeclared pointer aliasing.

Which language is?

I mean, if you're going to parrot this line, surely you have an example of a language that is more closely aligned to hardware than C, right?

I see this line repeated in every HN thread about C. It's not a new sentiment, but it is mostly wrong because the implication is that there exists some other popular language that actually aligns with the hardware better than C does.


A language can not be exactly aligned to every possible hardware variation at the same time of course. So C does dome abstracting from the hardware level but keeps the mental model of memory locations which can be pointed to by pointers.


> A language can not be exactly aligned to every possible hardware variation at the same time of course. So C does dome abstracting from the hardware level but keeps the mental model of memory locations which can be pointed to by pointers.

Sure, and I agree with you, but anyone complaining that the language which models hardware more closely than any other language, "doesn't model the hardware" should be prepared for the followup question of "Well, which other language in common use is closer to the hardware?"

It's really tiring reading the same old assertions in every thread about C; usually backed up by the same two or three sources that everyone has already read.




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

Search: