开发者

How does C-- compare to LLVM?

开发者 https://www.devze.com 2023-01-19 11:14 出处:网络
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 \'thing\' is built.

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 'thing' is built.

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

So I'm looking for some information helping me understand the main differences between these two projects... and开发者_开发技巧 why both exist.

For me LLVM looks a bit like the ultimate Swiss Army knife for compiler infrastructure, and C-- looks far less advanced.


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

The LLVM machine is pretty expressive. The C-- machine on the other hand, puts a lot of responsibility on the language front end. Quoting from the C-- FAQ: "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. Someone called it "almost absurdly easy to work with".

On the other hand C-- is much smaller and probably easier to entirely comprehend. (I imagine a normal person with some dedication can fully understand all aspects of it.)

0

精彩评论

暂无评论...
验证码 换一张
取 消