Richard Kenner wrote:
Robert Dewar <[EMAIL PROTECTED]> writes:

| It's interestinng to note that in the Ada world, there is an ISO
| standard for plugins, which is compiler/vendor neutral (at least
| in theory, in practice there are some implementation dependencies).
| That's the ASIS interface (Ada Semantic Interface Specification).

So, is it that plugins are good for Ada (and I presume the GNU Ada
front end) but not for GCC?

Robert is using the word "plugin" differently.  ASIS is an interface
and a library.  There are no plugins in the sense discussed here.  He
means it in a very generic sense, in the sense that we already have it
for GCC.

So I am not sure I understand Richard's points above, so let me be clear
about what ASIS is.

It is a set of libraries, and a well defined API, that allows generic
tools to be written that have full access to the semantic information
discovered by the compiler. This API is fully documented and defined
in a compiler-neutral form.

I am not at all clear that we have ANYTHING like that for GCC, so I
am completely puzzled by Richard's last remark.

Let's take an example, suppose we want to write a semantic analysis
tool (e.g. the Mozilla style checker mentioned earlier). For Ada,
we can write an ASIS application and we need to know NOTHING AT ALL
about the internals of the compiler we are using, we only read the
ASIS documentation. Indeed we could start writing that tool before
we decided which Ada commpiler we would use.

I know of nothing vaguely equivalent to this in the general gcc
context, am I really missing something that big?

On the other hand, if your mission is to plug in an extra optimization
pass, ASIS won't help since it is strictly a read-only interface with
no provision for feeding back information to the compiler.

It is theoretically possible to write a compiler back end using the
ASIS interface, but in practice I think this would be an extremely
difficult task. For sure it has never happened so far.

What is interesting is that ASIS provides a well-defined clearly
legally-ok interface from the commpiler to proprietary tools,
and there are a number of proprietary ASIS tools on the market.

Reply via email to