No announcement yet.

GCC 4.6/4.7 vs. LLVM-Clang 3.0/3.1 Compilers

  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    There's alot of 'they' in your post, I find these generalizations do nothing but harm and with terms like 'GNU-soldiers' it shows you are just another partisan pointing fingers.

    Originally posted by vertexSymphony View Post
    I don't say they are wrong, but they don't show the entire picture, the arguments are partial and the words they choose leaves a lot to be desired
    Well neither to do you. There's a practical part to these licences which overshadow the GNU or BSD-zelotry. In GPL you are legally bound to release enhancements made to the source code should you ship it in binary form, this has a _practical_impact which is that someone who releases his source code under GPL is then as an end user be entitled to the enhancements made to his code. This is not the case with BSD, it of course doesn't preclude companies from releasing source code but there is no legal incentive, and if the code in question gives them an edge against competitors it's unlikely that they will release it, particularly since there's no reason to expect their competitors to do the same with their enhancements.

    Here GPL works great, all participants are legally bound to share their code enhancements as long as they want to option to ship binaries of said software, Linux and GCC has a huge amount of companies cooperatively developing these projects under GPL which underlines how well this works. There's no need for these companies to 'hope' the other company will do right by them, it's in the licence terms. In this respect GPL levels the playing field of it's participants.

    This works great for me as an end user aswell, I get to reap the benefits of all these enhancements and again that has a very practical impact.

    So looking at LLVM/Clang and GCC, yes barring GCC's maturity which in turn leads to it having stronger optimization and compability/architecture/language support, LLVM/Clang is indeed better from a technical standpoint. It's more modular, built on a newer codebase and offers solutions which GCC at the moment (and not in the foreseeable future) does.

    So with that in mind I'm really glad Clang/LLVM exists, it improves open source compiler technology and also helps fill gaps which GCC doesn't cover. However due to it's permissive licencing it lacks some of the practical benefits I as an end user find in GPL-licenced software, which is that there's no reason to expect all enhancements to be contributed back to the project. And having Apple (atleast up until now) as the main driving force behind it certainly doesn't quell those fears for me. That said I'm glad seeing Google recently throwing their weight behind LLVM/Clang as they do with GCC as they are a company which have a track record of wanting to contribute back.

    If companies keep on contributing their enhancements back to Clang/LLVM then the licencing doesn't really matter at all, but there's nothing requiring them to do so and if they think their enhancements can give them an edge on the competition and there's no legal reason for them to contribute these enhancements back then there's a good chance they won't, which in turn means the open source version will be inferior or duplication of effort will be required to bring it to par.

    Again, these are all _practical_ reasonings, not about GNU or how proprietary code is immoral or some such, and while I think Clang/LLVM offers up a great alternative to GCC, GCC will remain my primary toolchain (or at worst fallback toolchain should Clang/LLVM rapidly improve greatly) simply because it gives me the practical benefit of recieveing all enhancements made to it, something which I can't be sure Clang/LLVM will offer come tomorrow, though the increased support from Google and the non-profit community management thing elanthis mentioned certainly does help.


    • #17
      Originally posted by scottishduck View Post
      Except that GPL is a vested interest in itself.

      GCC codebase is a mess and poorly documented. LLVM is clean and well documented. That's why clang is exciting.
      Code base and documentation don't compile your code. That's why it's not so interesting.


      • #18
        Originally posted by joshuapurcell View Post
        This is one area where the differences between BSD and GPL arise. It should be no wonder that the BSD license is the preferred licence for companies who contribute to open source.
        This has no reflect in reality. In contrary EkoPath was released under GPL. Most companies contribute to GPL projects - Linux kernel, GCC.


        • #19
          More compilers is better compilers. One of the bunch will be fastest at any given thing. That's just the way it is.


          • #20
            Also there is things like this:

            AFIAK GCC does not target GPUS (yet).


            • #21
              Originally posted by kraftman View Post
              This has no reflect in reality. In contrary EkoPath was released under GPL. Most companies contribute to GPL projects - Linux kernel, GCC.
              I usually don't state this is an argument for why I know what I'm talking about, but I have a little insight on this subject from working at a one of the big tech companies who is seen as a major contributor and backer of open source (at least to those groups who listen to it's marketing ploys). Inside this company the term GPL is worse then any four letter word. If project managers get a wiff of even the possibility of the GPL license being anywhere close to the code we are developing (even in the tools we use to in some way interact with the code) then the lawyers are called in. The same can be said to a much lesser extent with Apache tools. I'm sure there are many companies who gladly use and contribute to GPL projects, but from my experience as it relates to developing potential future products it isn't the big corporations. I have no doubt that companies like this one are focused to a much greater extent on filing patents on their efforts and ensuring it is not possible for this work to meaningfully contribute to the greater body of open source work that exists.

              EDIT: By the way, Microsoft was one of the biggest contributors to Linux in the past year if I remember correctly, but this in no way means this organization is a proponent of open source (and especially not the GPL).
              Last edited by joshuapurcell; 05-11-2012, 12:59 PM.


              • #22
                what? seriously? faonboys again?

                this competition is good. if clang becomes better than gcc, i'll switch to it.

                but for now, gcc seems the best run-time speed wise

                this is the beauty of FOSS - we have the choice.