views:

246

answers:

1

After learning a bit of how LLVM work I'm really excited about how portable low-level code can be generated and how modular this 'things' is built.

But I discovered today the existence of C-- that seems to share some concepts with LLVM.

So I'm looking for some informations helping me to understand the main differences between this two projects... and why both exist.

For me LLVM look a bit like the ultimate swiss-knife for compiler infrastructure, and C-- look far least advanced.

+6  A: 

They differ in how expressive the low level machine type system is.

The LLVM machine is pretty expressive, but the C-- machine puts a lot of responsibility on the language front end, quoting from the C-- home page: "simply, C-- has no high-level types---it does not even distinguish floating-point variables from integer variables. This model gives the front end total control of representation and type system"

Also visually they look a lot different. C-- looks a lot like C, LLVM looks a lot like assembler.

Pragmatically, LLVM has a lot more momentum right now. It has a JIT compiler, Apple is using it for 3D pipeline things and people are using it to connect to GCC and all sorts of weird and wonderful things.

On the other hand C-- might be smaller and easier to understand.

Amigable Clark Kant
So, if I understand correctly the main difference is the abstraction level of the intermediate representation used by theses compiler. thanks !
Alois Cochard
@Alois Cochard, that is how it seemed to me. I am no compiler expert, I just play one on Stack Overflow. :-)
Amigable Clark Kant
+1 Good answer Amigable
Aiden Bell
@Aiden Bell, thanks!
Amigable Clark Kant