[m-dev.] for review: add Mission Critical extensions
Peter Ross
petdr at cs.mu.OZ.AU
Thu Jul 6 18:54:18 AEST 2000
On Thu, Jul 06, 2000 at 11:59:54AM +1000, Simon Taylor wrote:
>
> This is not a full review. I've only reviewed the comments, not the code.
>
> > Estimated hours taken: 16
> >
> > Add the Mission Critical extensions to the compiler. These extensions
> > are only turned on if --enable-mc is supplied to configure.
> > The point of this change is to minimize the diff between the Mission
> > Critical Mercury compiler and the Melbourne Mercury compiler.
>
> Please add something here to explain why the Mission Critical version
> of the compiler needs to be different, and why these features can't be
> enabled by default.
>
Mission Critical have adapted the io library so that the io predicates
also work on sockets and streams under WinNT. This requires a change to
the interface of the io library. All this change does is put in place
the background machinery for this change.
> > configure.in:
> > Add --enable-mc to configure. This options turns on the Mission
> > Critical extensions to the compiler.
>
> The option name should describe the feature being enabled, rather
> than the user of that feature. `--enable-mc' is also a bad name for
> this option because until Mercury 0.7 `mc' was the name of the
> Melbourne Mercury Compiler.
>
Good point. I will change that to --enable-miscrit-exts.
> > runtime/mercury_conf.h.in:
> > Add MR_MISCRIT_EXTS which is defined when --enable-mc is passed to
> > configure.
> >
> > runtime/mercury_conf_param.h:
> > If we are using the Mission Critical extensions, define
> > MISCRIT_STREAMS.
>
> The names of these #defines should describe the features, rather
> than who uses them.
>
IMO that does describe the feature, it is the version of stream handling
which is used by Mission Critical. I like to make it clear which parts
of the compiler are dependent on Mission Critical. People will now who
to ask when looking at code.
> > runtime/mercury_library_types.h:
> > If MISCRIT_STREAMS is defined use the Mission Critical version of
> > the type MercuryFile. The new definition of MercuryFile makes it
> > possible for Mercury to handle streams connected to sockets and
> > pipes under WinNT. The MercuryFile structure now contains pointers
> > to functions to do the basic operations on streams, which allows
> > them to be changed according to the type of stream.
> > All this extra functionality is then hidden behind macros,
> > allowing the original definition of MercuryFile to coexist.
>
> Isn't this useful for users other than Mission Critical?
>
However sockets and streams are read/write which means that input and
output streams need to be equivalent. This is a change to the interface
of the io library, and may lead to less type safe code.
Currently this change to the interface of the io.m library will be
part of the diff applied by Mission Critical whenever they want to
upgrade their compiler. I have just attempted to place all the
machinery which doesn't change any interfaces into the compiler.
> > library/exception.m:
> > Export the modes of try/2 and try_io/4 that take det predicates as C
> > functions. This allows Mission Critical to change the semantics of
> > these two calls, in their own libraries.
>
> To do what? Why can't these `:- pragma export' declarations be placed
> in Mission Critical's libraries?
>
I tried that, and it didn't work. I just tried again, and it did work.
Beats me what I did wrong! I will remove this change.
> > Index: runtime/mercury_conf.h.in
> > ===================================================================
>
> > +
> > +/*
> > +** MR_MISCRIT_EXTS
> > +** Set this if you want to use the Mission Critical version of the
> > +** compiler.
> > +*/
> > +#undef MR_MISCRIT_EXTS
>
> Again, this needs more documentation about the extensions.
>
The Mission Critical version of the compiler includes
-- changes to the MercuryFile structure to allow it to be used with
sockets and pipes under WinNT.
Pete
--------------------------------------------------------------------------
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