[m-dev.] IL standard library problems

Jonathan Morgan jonmmorgan at gmail.com
Thu Nov 8 21:48:11 AEDT 2007

On Nov 8, 2007 3:50 PM, Julien Fischer <juliensf at csse.unimelb.edu.au> wrote:
> On Thu, 8 Nov 2007, Jonathan Morgan wrote:
> > Implement mutables for ILs.
> I don't think implementing mutables for other backends, like the IL
> backend, is worth it with the current implementation of mutables.
> Mutables were originally intended to provide trailed global variables
> with impure access methods for implementing constraint stores for
> solvers.  Since the original implementation they have
> been extended to support non-trailed mutables, attached to the
> I/O state mutables, thread-local mutables, "constant" mutables,
> atomic access in parallel grades etc.
> The source-to-source transformation currently used to implement the
> above is becoming increasingly creaky, e.g. trailed mutables that are
> floats or non-word sized foreign types don't work properly in the hlc grades,
> thread local mutables cannot be trailed, etc.
> A better approach would be to support mutables directly in the HLDS,
> MLDS, LLDS and not have the compiler implicitly generate foreign procs
> all over the place.   In short, I think future work on mutables should
> be directed in this direction rather than extending what is rapidly
> becoming an unmaintainable mess, i.e. the current implementation.

Alright.  It's interesting to note that the error message I get refers
to the foreign_name attribute, when the mutable declarations in
pretty_printer do not contain a foreign_name attribute.  I don't know
why this might be the case.

error message:
pretty_printer.m:862: Error: foreign_name mutable attribute not yet implemented
pretty_printer.m:862:   for the IL backend.
pretty_printer.m:865: Error: foreign_name mutable attribute not yet implemented
pretty_printer.m:865:   for the IL backend.

in pretty_printer.m:
:- mutable(io_formatter_map, formatter_map, initial_formatter_map, ground,
    [attach_to_io_state, untrailed, thread_local]).

:- mutable(io_pp_params, pp_params, pp_params(78, 100, triangular(100)),
    ground, [attach_to_io_state, untrailed, thread_local]).

mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au

More information about the developers mailing list