[m-dev.] State of Play?
Fergus Henderson
fjh at cs.mu.OZ.AU
Fri Jul 28 02:50:42 AEST 2000
On 27-Jul-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> I was wondering what the state of play was wrt
> the inclusion into the compiler of several extensions
> that people seem to have been working on for a while
> now, in particular:
>
> 2. Nested unique modes (in whatever limited form).
In our CVS repository, there is an `alias' branch, which has a version
of the compiler that supports those, if I understand things correctly.
Unfortunately that version has some unsolved performance problems.
Currently no-one is working on solving those or merging the alias
branch back with the main branch.
> 3. Concurrency/coroutining.
Support for this is in the compiler, but not documented,
and not yet well tested.
(a) Parallelism:
The compiler has support for a new `&' (parallel conjunction) builtin.
This has not yet been documented in the Mercury language reference
manual, but hopefully it will be sometime in the not too distant
future, at least in the implementation extensions chapter, if not in
the main part.
Currently (and for the short to medium term future) it only supports
independent and-parallelism, and not for goals with determinism
`nondet' or `multi'. Each parallel conjunct spawns as a separate
Mercury thread. In the `.par' (`--parallel') grades, Mercury threads
are mapped many-to-one onto Posix threads. The `-P' option in the
MERCURY_OPTIONS environment variable sets the number of Posix threads.
In non-`.par' grades, parallel conjunction works just like sequential
conjunction, except that the compiler still enforces the mode
requirements for independence and the determinism restrictions.
The `.par' grades only work for the LLDS back-end, not for the MLDS
back-end. They are not installed by default but can easily be
installed using the source distribution by doing e.g.
`mmake LIBGRADES=asm_fast.gc.par install_libgrades'
(after running configure).
(b) Concurrency:
There's concurrency support in extras/concurrency.
In non-`.par' grades, you just get non-preemptive threading,
i.e. co-operative multi-tasking, with the consequent need
for explicitly yielding control to the next thread.
In `.par' grades, you can get proper concurrent pre-emptive threads.
(c) Coroutining:
The freeze function in the module extras/trailed_update/var.m
provides some support for the logic programming style of
coroutining via delay and wake-up. This is somewhat primitive
and cumbersome to use.
> 4. Polymorphic (ground) modes.
One of the main things this is waiting on is for the operations like
`std_util__construct' and `io__read' to be put in type classes.
Zoltan has done some work towards reoganizing the RTTI stuff and I
think he plans to do more in the short to medium term.
I think there was/is/will be some work done on the other part, i.e.
allowing inst variables in predicate mode declarations. Off-hand I'm
not sure what the current status of that is.
> 1. EDCGs.
> 5. Decent support for laziness.
Bed time for me now, I might say a bit more about the others tomorrow.
Cheers,
Fergus.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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