16 ms·
> I’m not sure whether this has been true in the past Phoronix.com has a lot of Clang benchmarks over the years. I recall seeing some benchmark that showed th
by nh2 6y ago
> I’m not sure whether this has been true in the past
Phoronix.com has a lot of Clang benchmarks over the years.
I recall seeing some benchmark that showed that as Clang approached GCC in performance of compiled output, the compile speed also went down to approach GCC levels.
But I haven't managed to find that exact benchmark yet.
- baybal2 6y agoAn expected result when they copy GCC's features, and functionality. Isn't it? Pretty much the sole point of Clang/LLVM to the corporate sponsors is to get the GCC, but without GPL
- the_pwner224 6y agoI've heard this said before. Why would someone want this? AFAIK the GPL isn't really relevant unless you're modifying and redistributing GCC itself. Even if you use modified GCC internally for compiling for-profit software you just need to allow the employees who use GCC to see your modified code, which doesn't seem like a big deal since you already trust them with your application code.
- saagarjha 6y agoBecause Apple modifies and distributes LLVM in their proprietary developer tools.
- redwatch 6y agoIt is somewhat easy to work and modify llvm tools: an optimization pass for instance. Also, LLVM tools were designed to be interchangeable. One can pick specific parts of LLVM and integrate into the workflow of others.
- redis_mlc 6y agoBecause Apple is intensely allergic to the GPL. The reasons are: - As somebody else mentioned, Apple redistributes developer tools, clang being the poster child - Since they releases OS products, they don't want to co-mingle their software with GPL code. (So they use an older bash on Mac OS X.) - fear of an Apple developer quietly copying GPL source into a commercial product (well-founded, actually) - Apple Legal exerting an "abundance of caution" on IP - at this point, it's institutional. When I worked there, Linux and MySQL were forbidden, for example, but that has relaxed recently. Also, I think you misunderstand the GPL. If you distribute modified gcc, anybody receiving it can ask for sources. So employees plus end-users. (One of the strangest examples is that Yamaha uses real-time linux in their synths, and you can download the GPL portions. I can't imagine a musician ever wanting to do that!) Source: ex-Apple.
- sjwright 6y ago> Apple is intensely allergic to the GPL. Their actual marketplace behaviour demonstrates that they're allergic to GPL version 3 specifically, not the GPL or copyleft in general.
- stephen_g 6y agoWhich I think is reasonable - I do think GNU went too far with the version 3 licenses. I think Rob Landley's perspective is interesting, where he was involved with Busybox and the legal action against companies violating the GPL with that software, but later created an alternative to Buysbox that was more permissively licensed because he felt that the whole GPL legal action exercise had been counter-productive for open source software in general (net effect of not encouraging many companies to contribute back but instead just making many companies avoid GPL-licensed software altogether).
- saagarjha 6y agoThey’re fairly allergic to copyleft these days; I can’t recall them adopting a new project with any version of GPL for quite a while.
- sjwright 6y agoThere aren't so many GPL 2.0–only projects out there to adopt.
- pcwalton 6y ago> (So they use an older bash on Mac OS X.) Presumably you mean that Apple specifically avoids GPL3 then, because bash was never distributed under anything other than the GPL to my knowledge. Bash moved from GPL2 to GPL3 though.
- jabl 6y agoThey've been on a general GPL purge rampage, in each macOS release there's less and less GPL software (there was some blog post with numbers). As for bash, in the latest release the default shell is zsh, though I think the old bash is still there, although clearly on the way out.
- kevin_thibedeau 6y agoYou don't technically have to disclose internal mods to all employees because everyone is part of a single legal entity and no binary distribution occurs.
- marcoperaza 6y agoPerhaps but then you will kick yourself the first time you want to give a customer or business partner access to your modifications. Unforeseen business needs or opportunities can always make you need to distribute a tool you previously thought would only be internal. I'm not saying this is a slam-dunk reason to not use GPL tools, but I'm just pointing out that there is a legitimate worry here that is not fully alleviated by your point.
- deleted 6y ago[deleted]
- NobodyNada 6y agoOne argument I've heard before is that GCC's architecture is intentionally designed to make it difficult to extend GCC or integrate it into other tools such as IDEs, because that sort of modularlization could enable interoperability with non-GPL software. I'm not sure whether this argument has any merit, but see e.g. this email from ESR: https://gcc.gnu.org/legacy-ml/gcc/2014-01/msg00209.html https://gcc.gnu.org/legacy-ml/gcc/2014-01/msg00209.html Edit: that email from ESR cites a talk from an LLVM developer which goes into more detail about this argument and about a lot of the architectural differences between GCC and LLVM: https://www.youtube.com/watch?v=lqN15lrADlE https://www.youtube.com/watch?v=lqN15lrADlE. I'm not sure how up-to-date this is though, as it looks like it was recorded in 2012. At least in the Apple ecosystem, the results of LLVM certainly spoke for themselves. Immediately after hiring Chris Lattner and adopting LLVM, Apple's developer experience began to improve massively in a very short time, coming out with automatic reference counting, Objective-C 2.0, the Clang static analyzer, live syntax checking and vastly improved code completion, bitcode, Metal shaders, and Swift within just a few years. Of course, I don't know how much of this was due to technical reasons rather than legal reasons (but Apple did make most of this work open-source).
- gumby 6y agoWhile RMS is opposed to such a thing there is no architectural reason for it not to happen, just little to no support for anything not GPLed. ESR has no idea what he is talking about. It is true that GCC's architecture dates to the 80s and so isn't modular in the same way LLVM is, but that is hardly due to some sort of policy-embodied-in-code. As well, RMS no longer controls gcc, and has not since the late 90s when I engineered a fork of gcc from the FSF and into the hands of an independent steering committee. At the time such an idea was radical...thankfully it is now commonplace.
- NobodyNada 6y agoThank you for the clarifications, this is really quite interesting. Compiler development is fascinating, and I love these sorts of threads because I always learn something new about the technology/culture/history.
- magicalhippo 6y ago> AFAIK the GPL isn't really relevant unless you're modifying and redistributing GCC itself. A lot of interesting LLVM use-cases are all about that, adding custom frontends or backends used in software that is distributed. Some random examples: https://www.elementscompiler.com/elements/island/ https://www.elementscompiler.com/elements/island/ https://ispc.github.io/ https://ispc.github.io/ https://www.khronos.org/spir/ https://www.khronos.org/spir/
- pjmlp 6y agoJust like GCC has had Cobol, Ada, Fortran, Modula-2, Pascal, Java, Go and plenty of other ones throughout the years.
- magicalhippo 6y agoAnd how many of those were/are commercial or similar? The point is that GCC requires you to adhere to the GPL, which may not be desirable. The Island platform that I linked to is one such commercial example, made and sold by RemObjects[1]. OpenCL support in graphics drivers is another example. [1]: https://www.remobjects.com/ https://www.remobjects.com/
- pjmlp 6y agoGNATPro is commercial, which is GNAT plus some extra stuff and commercial support from AdaCore. Modula-3 frontend was commercial, by Elego Software Solutions. Then naturally Objective-C and Objective-C++ frontends used on NeXTSTEP and OpenSTEP.
- the_why_of_y 6y agoGCC's C, C++ and Fortran frontends are commercial products of at least Red Hat and SuSE, for example see https://developers.redhat.com/products/developertoolset/overview https://developers.redhat.com/products/developertoolset/over... and https://suse.com/c/suse-linux-essentials-where-are-the-compilers-understanding-the-development-tools-module/ https://suse.com/c/suse-linux-essentials-where-are-the-compi... GCC's Go frontend is still commercially supported as part of RHEL7 but was replaced by the more popular Go implementation in later versions. GCC's Java frontend used to be commercially supported in the days before OpenJDK.
- bluGill 6y agoDistributuon is a common use case. Not as much for a compiler, but for other things. My company spends a lot of time (money) ensuring we can ship the right source code when asked even though paying us $5 for it is silly when you can get it from the internet for free. I'd say nobody has ever asked, but that isn't true. One person in the test group actually read the entire eula and sent us $5 to get the source code. (I found out when his letter was returned to sender - we officially went through the entire release process just to fix the address at great expense. Even though it was still internal not released legal demanded we show good faith in correcting the problem) testers like that are worth far more than anyone pays them.
- stephen_g 6y agoYou seem to be implying having a competitor to GCC is a bad thing? While there is something to be said for duplicated effort, I think it's actually helped improve GCC a lot because they also 'copied' good things Clang did (like much better warnings, built-in static analysis etc.). So really everybody has benefited. It's good to have a bit of diversity and options, especially when they're all trying to be compatible.
- TheDong 6y ago> So really everybody has benefited. > It's good to have a bit of diversity and options It can be consistent to hold that those two statements do not hold in this case. GCC requires that developers uphold certain user freedoms (i.e. compiler extensions must be free software). Clang allows user's freedoms to be more easily violated. It's fine if you want to hold those two opinions, but if you state them as if they're the only opinions, that's not great. If you don't acknowledge that they're predicated on beliefs such as "user freedom isn't important to the expense of software improving in other ways" (or such), then of course you'll have trouble understanding why one might view clang/llvm in the negative light of effectively enabling "GCC, but without GPL".
- mhh__ 6y agoHaving two good compliant compilers is great for C++ too: it keeps both compilers honest and also makes spotting weird behaviour easier in big codebases (i.e. to first order if your code results in different behaviour in GCC or Clang then it could be dangerous). Also has the added benefit of reducing the need to use compilers like Intel's (not sure on current benchmarks) but I really wouldn't want to ship something for AMD CPUs with Intel's compiler.
- pjmlp 6y agoContrary to what gets discussed here, C++ has more than just two good compliant compilers. https://en.cppreference.com/w/cpp/compiler_support https://en.cppreference.com/w/cpp/compiler_support and embedded compilers, or more legacy like platforms aren't listed.
- dcow 6y agoAll good sibling comments. Also Clang is Chris Lattner's baby from his days back at University of Illinois. It was never intended to be "GCC without the GPL". It demonstrates an entirely different compilation paradigm where you optimize abstractly based on clang's IR. If you can compile to IR (a clang front end) you can apply the same optimizations universally. Obviously it has it's practical hiccups like still needing to have an architecture specific optimization pass but it's a cool idea and has proven rather successful.
- enriquto 6y agoIn defence of the OP, notice that they did not talk about the original intent of clang, which is as you mention. They talk about the main reason of its corporate sponsors, which is an entirely different thing. It seems plausible to me that these sponsors may have different motivations than the creator of the project.
- mpweiher 6y ago> Clang is Chris Lattner's baby from his days back at University of Illinois. No, that's LLVM. Clang was Steve Naroff's baby after he stepped down from managing the team.
- gumby 6y agoAnd for those who think there's some malicious (as opposed to friendly) competition between the two projects: Steve Naroff was also instrumental (both technically and managerially) to get Steve Jobs to pay us to get Objective C++ working in gcc back in the NeXT days.
- mpweiher 6y agoSteve Naroff spoke about the motivation for clang at the (first, I think) LLVM meet-up, which I also attended: http://llvm.org/devmtg/2007-05/ http://llvm.org/devmtg/2007-05/ Slides: http://llvm.org/devmtg/2007-05/09-Naroff-CFE.pdf http://llvm.org/devmtg/2007-05/09-Naroff-CFE.pdf Video: https://www.youtube.com/watch?v=Xx7zFn31PLQ&feature=youtu.be https://www.youtube.com/watch?v=Xx7zFn31PLQ&feature=youtu.be So there was a real technical need. IIRC, there was also a personal need, as Steve wanted to do something else, and I am sure not being dependent on gcc was also a big deal. From long experience, Apple doesn't like to be dependent on others for crucial bits of their tech stack. Relations with the gcc team weren't the best, even without the GPL issues, although the new GPL v3 was also seen as a problem. I think Apple switched before having to adopt v3.
- IshKebab 6y agoI don't think that was the original motivation, and Clang also introduced other features that GCC didn't / doesn't have: good error messages, cross compilation without having to recompile the compiler, library interface, etc.