Live data from Hacker News

Defending GCC considered futile

lists.gnu.org

121–130 of 209 posts

Re: Defending GCC considered futile

#121
post #11

So this was a discussion in /r/linux last week about LLVM and GCC et al, so I'm just reposting my statements on why a world where GCC is irrelevant is bad: It takes little effort on Apples or Googles or Microsofts part to take advantage of an LLVM dominated world to close off their own changes to it and try to force developers to use their own proprietary LLVM distributions on their own operating systems. It stops ev…

This is a common belief. It is, I believe, the reason Stallman wrote the GPL and the reason Torvalds continues to use the GPL 2.

But Eric Raymond convinced me that it's irrelevant ( http://esr.ibiblio.org/?p=928 ):

"If we live in 'Type A' a universe where closed source is more efficient, markets will eventually punish people who take closed source code open. Markets will correspondingly reward people who take open source closed. In this kind of universe, open source is doomed; the GPL will be subverted or routed around by efficiency-seeking investors as surely as water flows downhill.

"If we live in a 'Type B' universe where open source is more efficient, markets will eventually punish people who take open source code closed. Markets will correspondingly reward people who take closed source open. In such a universe closed source is its own punishment; open source will capture ever-larger swathes of industry as investors chase efficiency gains.

"In a Type A universe, reciprocal licensing is futile. In a Type B universe, reciprocal licensing is unnecessary. In neither universe can the GPL’s attempts to punish what we regard as misbehavior have more than short-term, temporary effects."

Re: Defending GCC considered futile

#122
Eric is right, but not for the right reasons.

For starters, Apple's money is not the main driver of LLVM (In fact, publicly, Apple is not the #1 contributor anymore).

Second, "but merely the fact that compiler technology has advanced significantly in ways that GCC is not well positioned to exploit. " is simply false

In fact, that's exactly the problem for GCC: Compiler technology has not advanced roughly at all.

GCC caught up to everyone else for the same reason.

Time for a history lesson.

About 14 years ago,a group of folks including Diego Novillo, Jeff Law, Richard Henderson, Andrew MacLeod, me, and Sebastian Pop (along with bug fixes/changes from a lot of others) sat around and build a "middle end" for GCC.

Prior to that, GCC had a frontend, and a backend. The frontend was very high level (and had no real common AST between the frontends), the backend was very low level.

There was nothing in between.

We cherry picked the state of the art in compilers and research, and build a production quality IR and optimizer out of it.

This research has not really changed that much in about 10-15 years. Most of the research these days focuses not on straight compiler opts, but on things like serious loop transforms, and helping runtimes (GPU, GC, etc), or dynamic languages.

You can see all the tree ssa work here: https://github.com/gcc-mirror/gcc/blob/master/gcc/ChangeLog....

This covers only until the branch was merged. At that point, it was "not a piece of crap", but this was before people added all the stuff on top of this architecture. On top of that architecture, it took another few years to get good, and a few years after that to get really good.

Bringing us to today.

LLVM was started around the same time, but had less contributors back then.

Essentially, you could view it as "instead of build something in between two really old parts, what could we do if we just redid it all". People thought it was a waste of time for the most part, but Chris Lattner persevered, found a bunch of crazy people to help him over the years, and here we are.

Because you see, it turns out compiler technology has not really changed at all. So, algorithmically, LLVM and GCC implement the same optimization techniques in the middle of their compilers. Because there is nothing better to do. Just slightly different engineering tradeoffs. To put it another way: Outside of loop transforms, essentially static language compilers targeting CPU architectures are solved. We know how to do everything we want to do, and do it well. It just has to be implemented.

So given enough time/effort, LLVM and GCC will produce as good of code as each other there. The question becomes "will they keep up with each other as engineering/tuning happens" and "who can generate great code faster".

The problem for GCC on this front is three fold 1. The backend, despite being pretty heroic at this point, really needs a complete rewrite, but people value portability over fast code.

LLVM, having started completely from scratch, has a modern, usable backend. They are not afraid to throw stuff away.

2. For any given thing you can implement, it's a lot easier to do it in LLVM than GCC, so, given time, LLVM will produce faster code because it takes less work to make it do so than it does to make GCC do so.

3. Because it was architected differently and more modernly, clang/LLVM are significantly faster at compiling than GCC. GCC can remove most if not all of the middle end time (and does), but it's still slow in other places, and that's really really hard to fix without fundamental changes (See #1)

Re: Defending GCC considered futile

#123
post #24

Earlier quoted context omitted.

You have to realize that RMS's goal isn't to "steer important projects", and you should give him more credit in that he probably could be "connected with the present technology" if he wanted to. The fact that "he doesn't know enough anymore" doesn't say much about Stallman; instead it says a lot about how his goal of making sure software is libre has been shoved aside by everyone else for other priorities. Also, RMS…

> The fact that "he doesn't know enough anymore" doesn't say much about Stallman Yeah, actually, it does: specifically, its says a lot about his qualifications to apply theoretical ideals to real world situations. To intelligently plan how to achieve the goals of the ideology, you need more than devotion to and deep understanding of the ideology, you need deep understanding of the existing context to understand the p…

But RMS has never really been pragmatic in the sense I think you mean here. RMS is the spiritual leader, other people have always done a lot of the implementation. When the principles collide with the ability to do some specific thing, RMS has pretty much always come down on the side of the principles. This is nothing new.

Just because you disagree with some of the results of his principles, probably because you're focused on getting shit done in your little corner of the world (I'm typing this on a Mac, I'm just like you), doesn't mean that RMS is somehow fundamentally flawed or incapable of being the philosophical leader of a movement.

Re: Defending GCC considered futile

#124
post #88

Earlier quoted context omitted.

It's not just that his knowledge is outdated, it's also that his philosophical principles will always take precedence over everything else, which includes sound and/or pragmatic technological decisions. I'm not fond of esr in general but he's spot on with this post.

Note this is explicitly RMS' philosophy, which hasn't changed. For him, freedom takes precedence over technological quality. He has been saying this for ages, for example when he explained that Open Source (as represented by Eric Raymond) and Free Software (as represented by the FSF) have very different goals. If you accept that RMS' worldview is about freedom, even if it sometimes means sacrificing some technologica…

The problem is that the number of users is directly proportional to technological quality.

People use gcc over non-copyleft compilers because they perceive it as technically superior. People use emacs over non-copyleft editors because they perceive it as technically superior.

Sacrificing technological quality to fulfill an agenda will actually have the opposite effect, because it'll drive users to non-copyleft solutions in order to get the better piece of software.

It's not just the number of users, either. When your software is dominant, you're in control. You get to have a say in the direction of the technology, and you get to prevent the lesser players from having their say.

By sacrificing technological quality for ideological purity, RMS is giving up both his userbase and his dominant position he can use to prevent non-free software from taking over.

Re: Defending GCC considered futile

#125
post #44
post #13

I don't know why you would make this argument now. Stallman argued clearly in January why copyleft was more important to him than technical superiority. https://gcc.gnu.org/ml/gcc/2014-01/msg00247.html

Everybody already knew that copyleft was more important to Stallman than technical superiority. The problem is that there are a lot of people who put a higher value on technical superiority than copyleft. Those people could be counted upon as GCC users and contributors as long as GCC was the technically best compiler available as open source (all free software is open source, not all open source is free software, etc…

He does not need to beat LLVM for GCC to remain available.

It would be detrimental to GCC to lose developers, sure, but I think one of the reasons for the disconnect between RMS and others is that RMS' goals does not require a large user base, and so he is willing to make decisions that seems counterproductive to anyone who cares about usability and user acceptance first.

The mere continued existence of GCC (and the other GNU tools) in many ways safeguards the freedoms he cares about: It allows users to jump ship if they in the future are prevented from doing what they want with the alternatives. It's not the ideal scenario, but it better serves his goals than giving in, and potentially see these freedoms slipping away at some future point.

Of course he'd be better served by GCC outcompeting LLVM. But if that isn't happening, his goals are better served by slowing developer migration than "capitulating" in a way that might affect developer mindshare by putting LLVM tools in front of more people.

As you say, of course the problem with this is that a lot of us care more about the technical superiority. Especially when the competition is a project that is as open as LLVM.

Re: Defending GCC considered futile

#126
post #6

> Already my own experiments suggest that LLVM is a superior compiler, by every metric I know of Except that it isn't copyleft, which is one of the most important metrics to Stallman, FSF et al, and is why they're unlikely to stop defending it.

This suggests that the FSF should create a GPL-licensed fork a Clang/LLVM. Such a fork could continue to receive all upstream improvements (since they're under a more liberal license), but not the other way around - the upstream project would not be able to use patches licensed under the GPL. Thus (in theory) it could end up being strictly superior to the original.

This is a common FSF tactic. It doesn't always end well (both GNU TLS, and GNU Mach come to mind). Not necessarily because they do bad things, but because they aren't able to get enough people using the software to make a significant improvement.

Re: Defending GCC considered futile

#127
post #66

Earlier quoted context omitted.

Sure - "The loud fanatics" who have no following certainly drop into irrelevance. I think if what you say were completely true we would not have had any movement forward on positions that were considered radical just 10 - 20 years ago - like same-sex marriage. It is only because certain people with large followings - Andrew Sullivan and others - began making a vocal argument for gay marriage, which wasn't even consid…

There's an enormous difference between having an opinion which is not aligned with mainstream and being a radical. The radical usually wants the world to convert to his/hers own views, which is why they tend to get closed minded and hard to talk with as they get older.

"I'll say nothing against him. At one time the whites in the United States called him a racialist, and extremist, and a Communist. Then the Black Muslims came along and the whites thanked the Lord for Martin Luther King."

Re: Defending GCC considered futile

#129

Earlier quoted context omitted.

>>Can someone explain to me what all the hubub is about. As far as I understand it and even as RMS himself states, isn't this mostly about them trying to block clang/LLVM tie ins to the debugger more than anything else? The "problem" RMS has with llvm is its non-copyleft license. And yes, the issue is that he doesn't want to support llvn with GNU tools. When LLVM started they used GCCs front end to compile C code unt…

"I don't understand it either. GCC is still a great compiler. Developers seem to prefer the modular design of LLVM and they're probably right in that." There are lots of things that are simply very hard to do with GCC, but are easily doable with LLWM. IDE integration is just one, because it has the ability to compile just lines(at least the Apple's version). Things we have done with LLVM: Millions of mollecules 3D pa…

Could you please expand on what particular features of LLVM enabled you to do this in months/weeks instead of years (presumably with gcc)?

Re: Defending GCC considered futile

#130
post #88

Earlier quoted context omitted.

It's not just that his knowledge is outdated, it's also that his philosophical principles will always take precedence over everything else, which includes sound and/or pragmatic technological decisions. I'm not fond of esr in general but he's spot on with this post.

Note this is explicitly RMS' philosophy, which hasn't changed. For him, freedom takes precedence over technological quality. He has been saying this for ages, for example when he explained that Open Source (as represented by Eric Raymond) and Free Software (as represented by the FSF) have very different goals. If you accept that RMS' worldview is about freedom, even if it sometimes means sacrificing some technologica…

His position is certainly consistent but definitely not reasonable.
Post reply on HN