[mercury-users] Native garbage collector for Mercury

Ralph Becket rwab1 at cam.sri.com
Sat Sep 12 19:36:44 AEST 1998


The man with the double reply says:

Tyson:
> [Mercury is good for OS functionality]

Agree 100%.  In fact, I'd go as far as to say it would be my language
of choice for pretty much everything that requires some weight on this
side of the barrier (except for those annoying heavily stateful
computations...)

Fergus Henderson wrote on 12 Sep:
> 
> With a suitable programming style, Mercury can actually be very close
> to the bare metal.  In some respects, it's even better than C in this area.
> Machines have multiple registers, but C doesn't let you return multiple
> arguments; unlike C, Mercury has output modes, which let you return
> multiple values in registers.  Tail calls in Mercury compile to jumps,
> whereas in C there's no easy way to get a cross-function jump.

I suppose my concern is that optimisation in languages like Mercury
involves a fair amount of code transformation at several different
levels, making it harder to guess accurately what sort of output the
compiler is going to generate in those circumstances where it is
important.  That said, one can always bail out to C if necessary, but
that's cheating.

> Of course, you don't *have* to write Mercury code in a "close to the metal"
> style.  Like C++, Mercury aims to be a wide-spectrum language: one where
> you can write both low-level code and high-level code in the same language.

Yes; still, I'd be uncomfortable if I had to write a device driver in
Mercury - mind you, it's just the sort of experiment that tends to
produce interesting results...  One of these days...

Cheers,

Ralph

-- 
Ralph Becket  |  rwab1 at cam.sri.com  |  http://www.cam.sri.com/people/becket.html



More information about the users mailing list