Remix.run Logo
▲ pjmlp a day ago

2018, and some of the comments are already outdated, SPARK 2014 is out there with ownership model.

▲dapperdrake a day ago | parent [-]

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 9 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 18 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.

▲pjmlp 10 hours ago | parent | next [-]

Itanium failed because AMD exists, without the rights to produce AMD64, Intel would be able to push Itanium no matter what, it was already the future of Windows 64 bit version, before AMD64 became public.

▲imtringued 6 hours ago | parent | prev [-]

In mutable aliasing world (aka C and C++ like languages), there is officially speaking, only one global memory with one very fast read and write port.

Under that model, VLIW is basically impossible. You need something that prevents mutable aliasing, because if you don't have mutable aliasing you can use software managed caches (including local register copies) and your software model has effectively as many write ports as there are pointers.

It's not a compiler problem, it's a language problem. You can't keep pretending that a inherently parallel machine can be programmed by an inherently sequential programming language.