Live data from Hacker News

Extracting the abstract syntax tree from GCC

lwn.net

51–60 of 112 posts

Re: Extracting the abstract syntax tree from GCC

#51

> It took many years before the GNU Compiler Collection (GCC) changed its runtime library exemption in a way that allowed for GCC plugins, largely because of fears that companies might distribute proprietary, closed-source plugins. Am I the only one who finds it ironic that purported "free as in freedom" software is/was being held back because of fears of what someone can do with that freedom? Though once useful, the…

Stallman's held this view for a very long while. About fifteen years ago, he told someone to memory hole a GCC target to emit JVM bytecode [1] because of the vague threat that someone could take that, create a theoretical frontend that worked on JVM bytecode, and feed /that/ result into a proprietary compiler. Stallman's fear of the proprietary bogeyman has hamstrung GCC and Free toolchains from being a platform anywhere near as decent as other projects in providing realtime feedback into program design.

[1] http://gcc.gnu.org/ml/gcc/2001-02/msg00895.html

Re: Extracting the abstract syntax tree from GCC

#52

> It took many years before the GNU Compiler Collection (GCC) changed its runtime library exemption in a way that allowed for GCC plugins, largely because of fears that companies might distribute proprietary, closed-source plugins. Am I the only one who finds it ironic that purported "free as in freedom" software is/was being held back because of fears of what someone can do with that freedom? Though once useful, the…

The most free world is not the one where there are the fewest restrictions. Restricting peoples' natural freedom to kill each other or steal from each other, for example, arguably makes everyone more free. The GPL is based on the same principle. Restricting certain antisocial behavior increases net freedom.

Re: Extracting the abstract syntax tree from GCC

#53
post #41

Earlier quoted context omitted.

> the right to look at every single detail of GCC and make it work better for yourself. And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other.

> And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other. At the risk of someone building a closed backend off an artifact of the GCC frontend; at the risk of someone profiting off RMS' work without following his conditions for making that work free. It's important to remember that he isn't against Emacs getting the information it ne…

You're certainly free to keep typing this stuff however the irony is that we all understand RMS clear, consistent position on the matter. The issue is that, by his own admission, he doesn't understand the other side.

Re: Extracting the abstract syntax tree from GCC

#54

The summary from this seems to be that RMS is against having a non-free tool consume the output of a free tool? Is that an accurate summary? If so this seems like a very strange position to take to me.

You have to understand the perspective of the FSF. They view non-free software as fundamentally morally evil. In the same way that most people today view slavery as fundamentally wrong. The comparison to slavery is one RMS and the FSF often make themselves.

To extend the analogy: if picking cotton was only economically viable if done with slave labour, then most people would agree we are better off not picking cotton at all. Similarly the FSF position is that if solving a problem using computers is only possible in a way that uses or enables non-free software, then we are better off not using computers to solve that problem at all.

Re: Extracting the abstract syntax tree from GCC

#55

Its hard for me to come up with a way in which this is not RMS advocating restricting the freedom of users of GCC. If he is so opposed to proprietary software using GCC output why not use a license that prohibits that? Its not even too late for new versions since the FSF owns the copyright to all GCC code.

There are 2 different kinds of outputs here. A license that restricted or applied GPL to the object code emitted by the compiler would create gigantic waves.

The compiler's AST isn't usually an output. This does seem like a dated issue, 20 years ago, there weren't as many C and C++ parsers, now there are a number of free ones. I feel pretty confident that 20 years ago, there would have been some proprietary compilers derived from GCC if they could emit the AST in an unrestricted sort of way. On more than a couple embedded projects I worked on some vendor distributed an absolutely PoS compiler because they had to to sell their parts and couldn't or wouldn't play ball with GCC. Honestly, now I'd think GCC's real value is in the optimizer, not so much the parser.

Seems like a fairly simple addendum to the license could GPL the GCC intermediate representation and their usage outside of GCC. That does create a logical loophole in that you don't want code compiled with GCC to be considered intermediate output and then GPLed by definition.

Re: Extracting the abstract syntax tree from GCC

#56
post #53

Earlier quoted context omitted.

> And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other. At the risk of someone building a closed backend off an artifact of the GCC frontend; at the risk of someone profiting off RMS' work without following his conditions for making that work free. It's important to remember that he isn't against Emacs getting the information it ne…

You're certainly free to keep typing this stuff however the irony is that we all understand RMS clear, consistent position on the matter. The issue is that, by his own admission, he doesn't understand the other side.

> we all understand RMS clear, consistent position on the matter.

Then why are "we" all still using his software (which was given a license to match his philosophy) and complaining when he maintains his "clear, consistant position on the matter" and refuses to compromise his beliefs.

To use a poor analogy, it's like going to church and complaining when they talk about God.

There are lots of other options out there for editors, compilers, and OSes. If "we" really do understand his position, and disagree with it to the point that "we" want to make changes incompatible with his position, "our" time and energy would be better served working with an OS and software which better matches "our" ideology (like FreeBSD; awesome software under the BSD license).

> The issue is that, by his own admission, he doesn't understand the other side.

That seems like his problem, not ours. And he's not making it our problem; we're making it our problem by trying to use FSF software in a way other than what they intended.

EDIT: Scare quotes around We and Our are used because I, personally, agree with RMS. I didn't used to, but over the years I have grown to appreciate the GPL, the FSF, and the openness these extreme ideologies have brought about for us.

RMS popularity among newer programmers is always low (for the exact reasons outlined here, his software isn't "free" enough), and yet I find that after years of experience, we begin to appreciate that without his staunch support, we would be developing software in a very different world.

A world which we have a taste of now, in the Apple, Microsoft, Google and Facebook walled gardens: I don't know how Swift works. I can't fix bugs in Swift's implementation, and I can't build upon Swift for the betterment of all, should I so desire.

Re: Extracting the abstract syntax tree from GCC

#57
post #41

Earlier quoted context omitted.

> the right to look at every single detail of GCC and make it work better for yourself. And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other.

> And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other. At the risk of someone building a closed backend off an artifact of the GCC frontend; at the risk of someone profiting off RMS' work without following his conditions for making that work free. It's important to remember that he isn't against Emacs getting the information it ne…

>If Emacs doesn't need the full AST, why would you give it to them?

Because the range of ways people might want to process code is vast. It's impossible to predict in advance what all those possibilities might be. The only way to allow the full range of transformations is to provide the full AST. Denying people the ability to manipulate code using code is to deny them a very important and powerful tool in computing. It reminds me a lot of when Apple tried to restrict what languages people could use when developing for iOS.

Re: Extracting the abstract syntax tree from GCC

#58
post #41

Earlier quoted context omitted.

> the right to look at every single detail of GCC and make it work better for yourself. And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other.

> And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other. At the risk of someone building a closed backend off an artifact of the GCC frontend; at the risk of someone profiting off RMS' work without following his conditions for making that work free. It's important to remember that he isn't against Emacs getting the information it ne…

Emacs does need the full AST. The whole point of Emacs is to allow users to write applications that were UNANTICIPATED by its developers. You can't predict exactly what sort of information users will need, so you can't make some "safe" amount of information available.

It's mind boggling that this even needs to be explained. I get the sense that rms doesn't really grok the Emacs philosophy anymore.

Re: Extracting the abstract syntax tree from GCC

#59
post #41

Earlier quoted context omitted.

Because RMS' stance has nothing to do with your productivity, and has everything to do with giving you the right to look at every single detail of GCC and make it work better for yourself. If he did open it up for a proprietary component to make its way into GCC (while avoiding the licensing terms), and it becomes mainstream, you have lost that right to view and modify the software that runs on your box, and that is…

> the right to look at every single detail of GCC and make it work better for yourself. And yet, the referenced discussion breaks down into RMS on one side and people who want to make gcc work better for themselves on the other.

What's the term for a program that's deliberately crippled to prevent you from doing what you want? Defective by design?

Re: Extracting the abstract syntax tree from GCC

#60
post #29

Earlier quoted context omitted.

"if you take code, you must give back code." That's not the intention. It's a forward mechanism, not a backwards one. If you distribute code to person/company/entity X then you must also distribute the source code, or provide a way for X to get the source code. If you make changes but never distribute the code then you don't need to distribute your modified code to anyone. If you only provide a service then you don't…

While incidentally true and pursuant to his real goal, I don't believe this is his ultimate goal. His goal is, and always has been, to make sure that you as the user of the software built upon his work, are always capable of opening it up and looking under the hood, and making adjustments as you see fit. Throw a proprietory module on the end which relies on his work but gets around the GPL, and you've lost that right…

I believe you've just restated what I wrote.

Quoting from the Free Software Definition page at https://www.gnu.org/philosophy/free-sw.html :

> You should also have the freedom to make modifications and use them privately in your own work or play, without even mentioning that they exist. If you do publish your changes, you should not be required to notify anyone in particular, or in any particular way.

There is nothing that obligates giving back code. Rather, that obligation is against the four freedoms of the free software. Hence, "if you take code, you must give back code" is not, as jordigh understood, one of rms's intentions.

Post reply on HN