| ▲ | dapperdrake a day ago | |||||||||||||
C abstract machine is from 1989 and also wants to be compatible with machines like a VAX or microcontrollers with Harvard architecture from back then. x86_64 is useful and widespread maybe because it is so easy to use like pointers are just integers and because the IBM PC was cheap back in the day and still is affordable today. And backwards compatibility just like Java. Itanium was not backwards compatible and died almost immediately. For better or for worse, C tries to run on all kinds of hardware that is obscure today. Like one's complement or sign-magnitude integers. This is why no C or C++ library will ever have decent bounds checked arrays. And back in 1989 it was decided that coming from a PDP-11 and faced with this "anything goes". Until compiler writers used UB to intentionally break SSL, everything looked fine. We are still learning from this. One problem with overflow safer languages on LLVM is that LLVM IR was originally designed for C++ and some NULL pointer UB weirdness or signed overflow weirdness specific to C was baked into LLVM's IR at the lowest level. As long as we do this it will be horrible. No escape hatch to sane behaviour. Except for people to skip all the UB by writing assembly for random proprietary microcontrollers. | ||||||||||||||
| ▲ | pjmlp 10 hours ago | parent | next [-] | |||||||||||||
There are other systems languages, some which older than C, without such problems, because contrary to C, they decided from the start that some operations are unsafe, like conversion between plain integers and raw pointers, thus these kind of issues don't arise like they do in C and C++. It jumps to the eyes that such conversion is being attempted instead of having a easy to ignore type cast, where the optimiser takes all sorts of liberties. | ||||||||||||||
| ▲ | chuckadams 19 hours ago | parent | prev [-] | |||||||||||||
Itanic failed because the Sufficiently Smart Compiler that could pack its instruction set decently well never materialized. Funky pointer representation is something compilers could handle from long experience at it, EPIC still is not, and today’s processor pipelines seem to show that it it isn’t even necessary. | ||||||||||||||
| ||||||||||||||