On Fri, Mar 30, 2012 at 10:23:16AM +0200, Ludovic Courtès wrote:
> Hi,
> 
> David Malcolm <dmalc...@redhat.com> skribis:
> 
> > How do other plugin authors feel about the API?
> 
> I think this approach would lead to a duplication of each GCC API.
> 
> The needs of plug-ins cannot be anticipated; artificially restricting
> what plug-ins can do is likely to hinder wider extension of GCC.
> 
> As an example, when Emacs was written, probably nobody expected that
> email and IRC clients would be written in it; likewise, probably most of
> the projects at <http://llvm.org/ProjectsWithLLVM/> were not anticipated.


I entirely agree with the above statements. More generally, we cannot
predict what plugins will be written for GCC, and what part of the API they
will use, and for what purposes they will be written. I guess than most
plugins would provide something which would not have its place inside GCC.
(I also guess that some plugins might be written to experiment passes which
could go inside GCC, but which won't be proposed quickly into GCC, in
particular because having a patch being reviewed and accepted, when that
patch comes from a newbie, is very time consuming).


> 
> What about sticking to the current ???API??? instead, and explicitly marking
> as internal those parts that core developers know are still in flux?

I tend to like that, but my feeling is that there might not be a consensus
on what the current API is, and on what the API used by plugins should be.

(I have the impression that people discussing that on gcc@ list tend to
attach slightly different meanings to these terms)

 
> For instance, I would expect a large subset of <tree.h> and <cgraph.h>
> to be stable (it???s been the case in my experience between 4.5 and 4.7.)
> The rest can be tagged with a special convention (for instance, an ???i_???
> prefix), to make it clear that it???s only meant for internal consumption.

I like that approach. I also feel that the headers should contain structured
comments from which some (imperfect) documentation of (an imperfect API)
could be produced.

Regards.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

Reply via email to