Hacker News new | comments | show | ask | jobs | submit login
FreeBSD built with clang now selfhosting - testers wanted (gmane.org)
87 points by durin42 2383 days ago | hide | past | web | 20 comments | favorite

I don't use FreeBSD, and I have no ill-feeling towards the GCC team who have done amazing things for the Free Software community (and lots of other individuals and organisations) over the years — but I'm quite excited to see how much progress Clang has made, and I begin to wonder whether maybe someday the Linux kernel will have two supported compilers.

I hope Clang vs. GCC turns out to be like the Webkit vs. Gecko rivalry - competing in public, but sharing ideas and even code to help improve the state of the art for everybody.

That analogy is perhaps uncomfortably apt, considering how soundly Webkit is beating Gecko on every front except for self-aggrandizing wankery over hypothetical freedom. The only active non-XUL Gecko application is Camino, the rest died several years ago or switched to webkit, and Camino's been threatening to do one of those too.

GCC was architected by Stallman to be intentionally inextensible, as a means of enforcing their interpretation of the GPL through technical means, by denying access to intermediate representations. That policy has been at least partially reverted 20 years later with the release of 4.5 on Wednesday with some plugin support, now that the LLVM projects are about to eat their lunch.

The LGPL adopted by Webkit is much more restrictive than the MPL adopted by gecko (gecko still adopts GPL and LGPL, just because them it can link with GPL software), if you're blaming gecko for supporting Theora but not H.264 I must remember that the WebKit codebase do not includes an H.264 codec, it's Apple and Google that link the codec against webkit, any application that uses the bare WebKit will have to include its own version of the H.264 code, that said technically webkit is advancing much faster than gecko in some areas (WebGL for example).

Concerning gcc, were you reading the mailing list of the gcc project for the last 20 years or so? What you said about Stallman is a fairly serious accusation, and as such must be supported with facts, as far as I know Stallman wasn't even important among gcc developers in the last 10 years, also in the very beginning gcc was intended to be the compiler of the GNU system, the technical reality for compilers in the 80s was probably different from now.

Nobody else ships codecs baked into their rendering engine because that's a fucking stupid thing to do, something you'd only do if you wanted to prevent users from using other codecs without forking the entire project. Everyone else links against an intermediary framework (QT, ffmpeg, gstreamer) and lets that dictate codec support. Chrome/Chromium does ship with a minimal libavcodec, but you can swap it out with a symlink to your system's full ffmpeg.

GCC was the canonical 'cathedral' project, controlled absolutely by Stallman through the FSF, a reign interrupted by the EGCS folks who had the gall to want a working compiler.

Mozilla may play up their whole 'community' angle, but they aren't very 'bazaar' at all in reality. Patches are unwelcome. A bunch of independent parties, most of them corporate enemies, contribute to the core WebKit project on a first-class basis. There have never been corporate contributors to Gecko, and they've repeatedly fucked over all the open source projects that used Gecko directly, to the point that only one is left (Camino). They don't even really support non-Firefox apps on top of XULrunner, including the ones they wrote themselves!

upvoted, really good response, but calm down man, it appears you're barking.

I have very little knowledge of GCC procedure, but I've seen these linked from a pro-clang comparison.



That's probably accurate, but supports something a bit different on the timeline: Stallman opposed a change in the gcc architecture in the 2000s that he thought would make it easier for companies to make proprietary derivatives. But that's not quite the same as saying he wrote it in the 80s to deliberately prevent it from being extensible. When he was writing it in the 80s, getting a whole C compiler written from scratch was probably the bigger design goal.

I tend to find the sniping at Stallman over gcc a little annoying overall. There are plenty of ways I disagree with Stallman's strategy, but from a "show me the code" perspective, he produced a free-software C compiler suitable for use in a modern free Unix 25 years before any of the MIT/BSD-license proponents did (until llvm, their only real alternative was the original pcc from the 1970s, which is why the BSDs all grudgingly use gcc).

There is nothing hypothetical about the freedom that Mozilla and GCC are trying to preserve.

NeXT tried to release Objective-C as a proprietary patch to GCC. It was only after the FSF told them that that was in violation of the GPL that they released the source under the GPL, now allowing Objective-C code to run on other platforms (I do in fact know people who deploy production code written in Objective-C on Linux, so this is not at all hypothetical).

Furthermore, NeXT^H^H^H^H Apple is now an even larger threat to computing freedom. They now have several Tivoized devices which forbid you from installing your own software on them unless you agree to an insane license from Apple that prevents you from writing any sort of interpreter or compiler that runs on or even targets those devices (oh, and also forbids political satire, apparently, unless you happen to be a Pulitzer prizewinner and get lots of press out of your rejection). People are talking of using these devices to replace their primary computer; people are even using these things, which are controlled by Apple and can have content remotely wiped from them, for government business. This is most definitely not an issue of "hypothetical" freedom; there are real freedoms being taken by Apple. They have even explicitly stopped upgrading to newer versions of GCC because of fear about the GPLv3; they don't want to make their platforms more free as the GPLv3 would require.

The H.264 issue is not hypothetical either. The licensing system is baroque and risky, as the MPEG-LA reserves the right to change the licensing in the future, meaning products with decoders, encoders, or even content encoded with H.264 may suddenly have massive royalties charged (with only a promise not to change anything for the next couple of years).

  Furthermore, NeXT^H^H^H^H Apple is now an even larger
  threat to computing freedom.
Sure. Mostly sponsoring the development of Clang and by shipping it for free with their OS.

GCC was architected by Stallman to be intentionally inextensible, as a means of enforcing their interpretation of the GPL through technical means

Yeah, Stallman hates extensible software. Look at Emacs, for example. That thing can't do anything Stallman didn't originally intend.

Try again.

> considering how soundly Webkit is beating Gecko on every front

When did WebKit get support for Direct2D?

Could the person who downvoted me elaborate on why he downvoted me? The newest Firefox nightly has Direct2D. If WebKit is "soundly ... beating" Gecko on every front, then one of those fronts would be hardware acceleration. When did WebKit get support for Direct2D?

Webkit has used Quartz on OS X to do accelerated drawing for a long time, and Apple's port to Windows had basic hardware compositing. The GTK+ port uses Cairo for drawing and gets whatever acceleration Gecko would on those platforms. Google wrote a library called Skia to do that on all the platforms they support (using OpenGL directly, Freetype, GDI+, etc.) — it was integrated into mainline Webkit a couple years ago, and is used by several of the forks.

Mozilla is very late to the party. It seems like they're following Microsoft's lead here after they released builds of IE9 that use Direct2D and started dropping talking points about 'accelerated graphics'.

> Webkit has used Quartz on OS X to do accelerated drawing for a long time, and Apple's port to Windows had basic hardware compositing

Quartz Compositor, as the name suggests, can only do compositing. This isn't just compositing. Windows Vista and above and Linux with Compiz also do compositing in hardware -- that isn't nearly comparable to Direct2D, though, because all these solutions render on the CPU.

QuartzGL, which is somewhat nearer to D2D in intent, still isn't enabled by default, even on Snow Leopard. http://www.tapper-ware.net/stable/web.dom.stresstest.transfo... is a good example of what's possible with true hardware acceleration and not just compositing: http://www.tapper-ware.net/files/stresstest.comparison.ogg shows how it performs on different browsers in Windows. Pretty stark difference, don't you think?

> Mozilla is very late to the party. It seems like they're following Microsoft's lead here after they released builds of IE9 that use Direct2D and started dropping talking points about 'accelerated graphics'.

It actually isn't. Mozilla started working on Direct2D support before Microsoft announced it, and the newest nightly is easily the fastest and most responsive browser currently available across any platform. It truly is a quantum leap, in that it is going to be impossible for a non-hardware accelerated browser to catch up.

I think this will happen in the next 3 years or so, but I think that Linux will support three compilers, gcc, clang and pcc which is being developed by OpenBSD hackers[1].

[1]: http://undeadly.org/cgi?action=article&sid=2009122823114...

IIRC apple is one of the primary contributors to the Clang project, yes? I wonder what motives they could possibly have for being so interested in compilers. Not to sound like a conspiracy nut, but is it possible that apple could impose a restriction on the iphone apps :"must be compiled with our own version of clang" etc?

LLVM is a great step forward in compilers but it's ties with apple and the recent devious deeds it is capable of is holding me back from contributing to LLVM.

They're interested in compilers because, unfortunately, GCC has never really had any emphasis on Objective-C support.

What would be their motivation for restricting down to a single compiler? They had a (silly) reason to lock people into Objective-C; but that reason doesn't apply here. And even if they did, how would that be different from now where GCC is the only option?

I think there are a few issues.

One is that Apple likes control. They could hire the lead LLVM developer, own the copyrights, and use a permissive license, allowing them to exert a lot more control over the project.

Another is that Apple is allergic to the GPLv3. They have stopped upgrading to newer versions of GCC in recent Mac OS X releases, because they are afraid that the GPLv3 may prevent them from Tivoizing the iPhone and iPad.

And back when they were NeXT, they tried to release their Objective-C extensions to GCC as a proprietary patch, but wound up being forced to release them as free software by the GPL. They may want to avoid that sort of thing in the future. For instance, I don't believe they release as free software their implementation of OpenGL which uses LLVM.

So yes, I think it's entirely possible at some point in the future that Apple will say "you must use Clang to compile for the iPhone/iPad platform." And it may even be a special, proprietary version of Clang, targeted at a custom chip in the iPhone or iPad. They have worked very hard to have full control of the platform and toolchain, and made sure that it's all under licenses that will allow them to make it proprietary whenever they wish. They can't quite switch to Clang yet, as its C++ support is not finished yet (though it does cover enough to self-host), but once they do, I absolutely would not be surprised if they mandated its use.

Yeah, that objective-c extensions (and objective-c++ even moreso) thing went so well for FSF too. Apple still ships a forked version of GCC (and binutils for that matter) because FSF never actually took all the patches, so I fail to see what good it really did the community, especially now that there's a non-GCC compiler that is open, and has a mainline that supports ObjC.

I know people who write and deploy code in Objective-C on Linux. So while mainline GCC hasn't accepted the patches, keeping the compiler free did help the community.

I don't believe that the FSF's tactics are correct in all cases. I think that they could do better about encouraging and not alienating certain developer communities. But software freedom is a very important goal, and they are one of the few groups out there truly dedicated to software freedom.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact