[m-dev.] Re: Lazy Semantics?

Andrew Bromage bromage at cs.mu.oz.au
Fri Aug 1 12:50:03 AEST 1997


G'day.

Marko Schuetz wrote:

> > Is there work being done on a 'Lazy Mercury'?

Fergus Henderson replied:

> No, there's not, at least not that we know about.
> But it would not be too difficult to do.
> This might make an interesting project for someone...

Tom and I had a non-serious think about some similar things some months
ago.  From memory, a translation from a lazy functional language into
Mercury which preserves fully lazy semantics is not a simple job.  It
would require at least polymorphic modes and a demand-driven
scheduler.

As for lazy Mercury, it would also require a weird scheduling policy,
bu it would probably be significantly less useful than one might think
anyway.  For example, semidet code must be evaluated fully even though
the outputs may not be needed just in case it fails.  I can't think of
an application which can't be done more efficiently (though not
necessarily more neatly) using either coroutining or the right kind of
closures or a combination of both.

Did Marko have a particular application in mind?

Cheers,
Andrew Bromage



More information about the developers mailing list