I have been working on getting a quite complex C++ code base (3M+ LOC) with heavy template use to compile on clang. Along the way, I have found many violations of the C++ standard that GCC silently accepts, several obscure GCC features that clang does not support, and up to now filed three clang bug reports.
The project compiles now, but the resulting executable is still not passing basic regression tests :)
I think our codebase has been depending for too long on just one compiler, and clang C++ support isn't perfect yet. (FreeBSD has mostly C code which is very stable). I will keep pushing to get it all working :)
We have been using clang on Apple, Linus, and FreeBSD. It's a lot nicer to work with and compiles faster than GCC, including 4.7. As people point out, the generated code is on average a little slower.
Linus' ultimate plan for Linux. Replace brain with Linux. Circle complete. Spleen still uses binary blob for driver. Open-source attempt to recreate it called Splouveau.
Outside the license, the main benefit seems to be that in Clang the different stages are less intertwined than GCC. This is supposed to make developing Clang easier (since you don't have to understand so much), allowing optimizations to be tested and added easier.
On the user side, Clang is well known for providing much better error messages. Some error messages will even suggest possible fixes (you might get something like "Can't assign a pointer to a something, did you mean *pointer?").
The GCC guys have been improving their compiler for a long time, and over the last few years they have been working hard to make GCC easier to work on and optimize. I believe that GCC is usually faster or the binaries are smaller by a few percent, but it's not generally a drastic difference.
A:
Modular design. You can change everything, modify to make your own compiler and even include on a proprietary project if you want(license much more permissive than GPL)).
It lets you interpret C and C++, if you want.
It lets you compile in C, C++ to bytecode like java if you want, native code if you want too.
It can compile JIT fast things like OpenCL or javascript.
D: It is huge for a compiler. I believe gigabytes or so.
If you want a more technical review of LLVM, I think this is a very good one: http://www.aosabook.org/en/llvm.html (Chris Lattner is the creator of LLVM)
I'm excited about this change. I was working on a C++ project last summer that had a lot of templates. Clang was a lot faster, and a lot easier to use.
Aren't they pretty much doing anything these days to make it easier for Apple to “steal” their code, considering that most consumers of BSD code are Apple users?
As someone who tends to release on more-permissive licenses, I just want to clarify the causal model here.
It's not "doing something extra" to release with BSD; the "doing something extra" comes when you want to properly release with GNU.
After a long random walk over the licensing attitudes graph, I have found myself for the last several years stably located at one node. This node is, "licensing is about lawsuits." People often release with the GNU GPL because licensing, for them, is not about lawsuits but has some other import and use -- perhaps moral. But for me, a license is strictly about defining what sorts of lawsuits are possible.
Copyleft is a threat to sue. More precisely, it is the threat "I may sue you if you don't threaten to sue others." And that just sounds crazy. Why would you do that? Well, the stated goal of copyleft is to eliminate all fears of lawsuits by using legal threats.
Let me hasten to add that this is a very pretty idea. If you know the religions of India, this idea is called tantra -- that sometimes the most precise tool for removing a thorn is other thorns, or sometimes the best way to remove dirt from your clothes is with an abrasive substance -- like other (cleaner) dirt. The reason that Stallman is sometimes described as religious may come back to the attendant mysticism that tantric approaches usually bring with them.
My point is, this sort of thinking is an active choice and requires you to enforce the threat, at least in principle. The BSD license is much simpler: it says "I won't sue you, and you're not allowed to sue me." It is a Buddhist-nonviolence approach to eliminating lawsuits: "I have stopped causing suffering in this world, Angulimala -- now why don't you stop?"
It is nothing extra to release this way: you simply promise to not sue anyone, and you only give permission conditional on the fact that they will not sue you, you write it once and then it is done. It's clean and elegant. If you want to actually be a productive GPL licenser, you have to either hope that the threat in the docs is enough, or else find everybody who is "conveying" your software, and slap them with a lawsuit so that they learn how much lawsuits suck.
If by steal you mean hiring the best contributors to the project(like Cris Lattner), and releasing a big part of that work freely, then yes, they are letting Apple steal them blatantly.
Wheres the "WHAT?!". The BSD guys have gone on record multiple times saying that they think that RMS and GNU are a joke. It seems natural that they would try and phase out GNU when possible in light of this belief.
[+] [-] mrich|14 years ago|reply
The project compiles now, but the resulting executable is still not passing basic regression tests :)
I think our codebase has been depending for too long on just one compiler, and clang C++ support isn't perfect yet. (FreeBSD has mostly C code which is very stable). I will keep pushing to get it all working :)
[+] [-] raverbashing|14 years ago|reply
Or maybe it's C++ violations that are "commonplace" and would break several existing softwares.
And herein lies the biggest hurdles with C++
Heavy templating and inheritance is the way to ensure your C++ program will be unmaintainable and not forward compatible with GCC (or other compilers)
I've been in a similar situation where I spent a lot of time fixing compiler errors (on GCC 3.X if I'm not mistaken) that would be ignored on 2.X
[+] [-] maybird|14 years ago|reply
The code builds with Clang, but the runtime crashes deep inside Boost.
It's been very frustrating because we're well past the point where refactoring-out Boost would be cost effective.
[+] [-] TwoBit|14 years ago|reply
[+] [-] quink|14 years ago|reply
Linus' ultimate plan for Linux. Replace brain with Linux. Circle complete. Spleen still uses binary blob for driver. Open-source attempt to recreate it called Splouveau.
[+] [-] harshreality|14 years ago|reply
clang, now with a compile-to-DNA backend.
[+] [-] Turing_Machine|14 years ago|reply
Someone want to give (or link to) a brief rundown of the advantages/disadvantages?
[+] [-] MBCook|14 years ago|reply
http://clang.llvm.org/comparison.html#gcc
Outside the license, the main benefit seems to be that in Clang the different stages are less intertwined than GCC. This is supposed to make developing Clang easier (since you don't have to understand so much), allowing optimizations to be tested and added easier.
On the user side, Clang is well known for providing much better error messages. Some error messages will even suggest possible fixes (you might get something like "Can't assign a pointer to a something, did you mean *pointer?").
The GCC guys have been improving their compiler for a long time, and over the last few years they have been working hard to make GCC easier to work on and optimize. I believe that GCC is usually faster or the binaries are smaller by a few percent, but it's not generally a drastic difference.
[+] [-] stonemetal|14 years ago|reply
Faster compile times.
Better error messages.
BSD license.(More in line with their project not a judgement on my part.)
Designed to make use in tools easier.
Cons:
Code produced isn't as fast, but not much slower.
[+] [-] forgottenpaswrd|14 years ago|reply
It lets you interpret C and C++, if you want.
It lets you compile in C, C++ to bytecode like java if you want, native code if you want too.
It can compile JIT fast things like OpenCL or javascript.
D: It is huge for a compiler. I believe gigabytes or so.
[+] [-] pooriaazimi|14 years ago|reply
[+] [-] maxharris|14 years ago|reply
[+] [-] mp3geek|14 years ago|reply
[+] [-] soc88|14 years ago|reply
[+] [-] drostie|14 years ago|reply
It's not "doing something extra" to release with BSD; the "doing something extra" comes when you want to properly release with GNU.
After a long random walk over the licensing attitudes graph, I have found myself for the last several years stably located at one node. This node is, "licensing is about lawsuits." People often release with the GNU GPL because licensing, for them, is not about lawsuits but has some other import and use -- perhaps moral. But for me, a license is strictly about defining what sorts of lawsuits are possible.
Copyleft is a threat to sue. More precisely, it is the threat "I may sue you if you don't threaten to sue others." And that just sounds crazy. Why would you do that? Well, the stated goal of copyleft is to eliminate all fears of lawsuits by using legal threats.
Let me hasten to add that this is a very pretty idea. If you know the religions of India, this idea is called tantra -- that sometimes the most precise tool for removing a thorn is other thorns, or sometimes the best way to remove dirt from your clothes is with an abrasive substance -- like other (cleaner) dirt. The reason that Stallman is sometimes described as religious may come back to the attendant mysticism that tantric approaches usually bring with them.
My point is, this sort of thinking is an active choice and requires you to enforce the threat, at least in principle. The BSD license is much simpler: it says "I won't sue you, and you're not allowed to sue me." It is a Buddhist-nonviolence approach to eliminating lawsuits: "I have stopped causing suffering in this world, Angulimala -- now why don't you stop?"
It is nothing extra to release this way: you simply promise to not sue anyone, and you only give permission conditional on the fact that they will not sue you, you write it once and then it is done. It's clean and elegant. If you want to actually be a productive GPL licenser, you have to either hope that the threat in the docs is enough, or else find everybody who is "conveying" your software, and slap them with a lawsuit so that they learn how much lawsuits suck.
[+] [-] forgottenpaswrd|14 years ago|reply
[+] [-] Peaker|14 years ago|reply
FreeBSD apparently have no issues with donating their work to corporations.
[+] [-] rsynnott|14 years ago|reply
Wait, what?
[+] [-] batista|14 years ago|reply
Seconds, there is no "stealing". They provide a license that explicitly allows such a use.
[+] [-] Sicp|14 years ago|reply
[+] [-] unimpressive|14 years ago|reply
An example: http://openbsd.org/lyrics.html#43
You can even download an MP3 or Ogg of it being sung (With backing.) by Nikkos Diochnos.