[m-dev.] 0.13 release: op/3 syntax

Ralph Becket rafe at cs.mu.OZ.AU
Fri Mar 3 14:59:49 AEDT 2006

Peter Schachte, Friday,  3 March 2006:
> That's much closer.  But for this to work, there would have to be only
> one such program, and every module that wants operators would have to
> use that one, so this preprocessor needs to be a standard Mercury
> tool.  Otherwise we're back to the problem of mixing operators from
> different modules, and your argument breaks down.

Yes, but it addresses Doug's request as far as I can see (although Doug
has said that he thinks it a terrible idea, but not why).

> But it's all still rather painful to work with the standard mmake and
> mmc --make technology, so those should also be amended to do the
> preprocessing automatically.

Not really.  Just use an ordinary Makefile to automatically run the
preprocessor over any changed Mercury-with-op/3 files to get vanilla
Mercury files, then get it to run `mmc --make'.  Problem solved.

> And as I've argued before, modules should be able to export operators
> much as they do predicates and funtions.  So you'd need to modify your
> preprocessor to read the interface sections of imported modules
> looking for :- op declarations.  But OK, that's doable.

Before we get on to the mechanics of how it could work, you have to
convince a skeptical bunch of language designers that we should add the
facility in the first place.

> OK, now you've got the functionality right.  But unfortunately you've
> slowed down compilation a bit, so it would be a good idea to do some
> profiling and see if you can't speed it back up.

I assure you that filtering of this kind would be unnoticeable in any

> Maybe you could
> removing the completely pointless process launch/read/write phase?
> Not a huge expense, but you might as well merge the preprocessor into
> the Mercury compiler.  Then you could also back out the changes to
> mmake and mmc --make.
> OK, that's got it.  :-)

Now you're optimising something that doesn't exist for a facility that
shouldn't exist :-)  (IMHO)

-- Ralph
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au

More information about the developers mailing list