[m-rev.] for review: ordering the items in interface files

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Mar 21 12:00:59 AEDT 2005


On Mon, 21 Mar 2005, Ralph Becket wrote:

> Zoltan Somogyi, Sunday, 20 March 2005:
> > For review by Julien.
> >
> > compiler/modules.m:
> > 	Put lists of items into an approximation of a standard order
> > 	when generating interface files. This should reduce the number
> > 	of times modules are unnecessarily recompiled because of a change
> > 	in a module that *reorders* its exported items without *changing*
> > 	the set of exported items.
>
> The change looks good, but it's not clear to me why you can't traverse
> the list of items collecting interface and implementation sections as
> you go (i.e., regardless of how many top-level interface sections there
> are in the source file, there should be only one in the interface file).
> Nested sub-modules complicate matters somewhat, but my intuition is that
> you would still end up with simpler sorting code.  What am I missing?
>

One reason is that the compiler occasionally adds items to the front
of the list outside before any implementation or interface declaration,
although admittedly this is a bug.  The main reason for makeing the change
this way is simply that you can't guarantee that the compiler won't do
that at the moment.  The proper fix is to change the way that the parse
tree is represented, ie. have more structure than just a list of items.

I've discussed this with Zoltan before and such a change is going to
be a sizable (if rather dull) undertaking.  At the time I think we agreed
that it's probably best done after the current parser is replaced (with an
elk based one).

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list