emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Contributing LLVM.org patches to gud.el


From: Perry E. Metzger
Subject: Re: Contributing LLVM.org patches to gud.el
Date: Wed, 11 Feb 2015 11:17:22 -0500

On Tue, 10 Feb 2015 17:49:48 -0500 Richard Stallman <address@hidden>
wrote:
>   > So to reiterate: LLVM was created because of GCC's deliberately
>   > non-modular, non-reusable architecture, and not because GCC
>   > was GPLed. The fact that LLVM is not GPLed and permits
>   > proprietary forks is a side effect of the history (and
>   > potentially a very bad one) but was not what caused LLVM to
>   > come about to begin with.
> 
> That is true.  However, the issue for us is the effects of LLVM,
> not its motivation.

Perhaps I am mistaken, but it *appears* you have characterized LLVM as
a deliberate attempt to destroy particular works (such as GCC) of the
Free Software Foundation. I was presenting evidence that no such
deliberation existed in the design. Similarly, you characterized LLDB
as a deliberate attempt to undermine GDB, not merely as something with
the possible effect of undermining it. If I'm mistaking what you
said, please do inform me, I would prefer not to be mischaracterizing
your position.

>   > So to reiterate: LLVM was created because of GCC's deliberately
>   > non-modular, non-reusable architecture,
> 
> That is not so.  I made GCC as modular as I could.

But I believe you have asked in the interim that GCC not be made more
modular out of fear of proprietary reuse of the front or back
end. This has the effect of interfering with re-use of the code even
when it is linked directly in to GPLed tools like Emacs. Was that not
the substance of the recent argument about Emacs and completion via
GCC, in which you requested more time to consider the issue?

> There is one thing I tried to discourage, many years later:
> separating the front end and the back end into different
> processes.  You're supposed to link the back end with the front end.

Generally, LLVM also operates as a single executable. It is true
that, for convenience, its intermediate representation may be
presented as text, as a high density binary format ("bitcode"), or as
internal data structures, but the latter is what is generally used to
pass things around since it avoids lots of input and output.

The distinction here, of course, is that LLVM does not *require* that
you link the components together, or indeed, that you use them as
a compiler at all.  It provides a lot of APIs -- indeed, all of LLVMs
components are libraries with a thin wrapper that hooks them
together. For example, LLVM permits you to link the front end Clang
parser directly into your code for various purposes, including to
provide things like AST access for IDEs.

Now, if GCC permitted such access, since GCCs code is GPLed,
presumably resultant software would also be GPLed, but if I am not
mistaken you do not seem very keen on permitting that for fear that
people would then build executables that separated compiler passes.
Thus, I think we can state that LLVM is more modular than GCC, and
not because of technical reasons but because of a strategic political
decision. Am I deeply mistaken here?

> Designing modules to link together does not mean they are
> non-modular.

I am afraid that I'm having trouble seeing what the ultimate
distinction is -- again, LLVM all links together too.

People can do things like building static analysis tools to find bugs
in their C and C++ code using LLVM, but they cannot do that with GCC
even though they would be linking to GCC's code because there was
a fear that excess access would lead to things like proprietary front
and back ends. People can do things like building intelligent IDEs
using LLVM, but cannot do things like linking GCC's code into Emacs
and allowing for building high quality refactoring IDEs out of the
combination because of this fear.

So, yes, GCC is, so far as I can tell, deliberately made more
difficult to use in tools in this manner by policy. If I'm deeply
mistaken, please correct me, but I thought that was the whole
substance of the recent discussion about AST access from GCC in Emacs.

> In 1988 it didn't occur to me that anyone would ever think of doing
> that.  It would be too slow.  I took for granted that the front end
> and back end would link together, and wrote them for that.

It is now 27 years later. People are willing to alter GCC to be as
modular as LLVM is I believe, but I also think you do not want that,
so I'm not sure discussing the initial architecture is entirely
germane. That said, again, if I am misapprehending your intent,
forgive me, and I would be very pleased to know what you actually
intend.


-- 
Perry E. Metzger                address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]