[m-dev.] op/3, again.
Peter Schachte
schachte at csse.unimelb.edu.au
Tue Mar 14 11:36:09 AEDT 2006
On Mon, Mar 13, 2006 at 04:05:12PM -0500, doug.auclair at logicaltypes.com wrote:
> op/3 declarations have started to show up in auxilary libraries of
> mine, so I modified the op/3 build system ...
> this build system is entirely
> redundant to mmc
Hmmmm. OK, the Mercury team is never going to allow users to define
operators, preferring instead for them to be implemented as a
preprocessor. And if they're not going to accept op, they're
certainly not going to accept anything like term_expansion (I know;
I've argued for it before). Again, the argument is you should use a
preprocessor. And I know Zoltan has been working on a new parser
generator for Mercury, which I can only assume is a preprocessor. And
I know work is underway for a looping facility which I imagine will be
built into the language, but IMHO really should be done as a library,
again necessarily as a preprocessor.
So if preprocessors are going to be common for Mercury, the build
systems (at least mmc --make, and preferably mmake as well) should be
extended to better support preprocessing, and in particular multiple
preprocessing. I think the standard make approach -- preprocessing a
.whatever file to a .c file, which is then compiled to a .o -- is not
very good. It tends to force you to use only one mini-language per
source file, which can be an unwelcome restriction. Eg, I want to
include arbitrary Mercury code, including code built using another
mini-language, in my parser grammar.
What I'd really like is to be able to put a declaration in my library
source file to say that code that uses this library needs to be
preprocessed with a particular preprocessor, and have the build system
just Do The Right Thing, which would be to run the preprocessor,
putting its output into a temp file, and then run mmc on that file,
telling it to name all its outputs as if the input file were the
original input file. And when multiple preprocessors are needed, it
could automatically invoke each preprocessor on the output of the
previous.
BTW, I couldn't find any documentation for mmc --make. Where is it?
I also think I should be able to insert a declaration into a library
source file to say code that uses this library module needs to be
linked with a certain .a or .so file (or other linker options), and
have that happen automatically, but I'm not sure if that's already
supported or not.
--
Peter Schachte Life is what happens to you when you're making
schachte at cs.mu.OZ.AU other plans.
www.cs.mu.oz.au/~schachte/ -- Betty Talmadge
Phone: +61 3 8344 1338
--------------------------------------------------------------------------
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