[m-dev.] diff: update NEWS file for MLDS trailing, etc.

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Dec 15 21:17:40 AEDT 2000


On 15-Dec-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> Fergus wrote:
> > Estimated hours taken: 0.25
> > 
> > extras/dynamic_linking/name_mangle.m:
> > browser/name_mangle.m:
> > 	Add support for the MLDS->C back-end.
> 
> Isn't there more to it than that?
> Why don't the closures generated by dl.m require the use of
> wrapper functions, which are generated by ml_gen_closure_wrapper
> for all other closures?

Oh -- I forgot about that!  You're right, in general wrappers are
needed.  The current implementation is broken.

In practice, though, it will almost certainly work OK on most systems
so long as you don't use arguments of type `float' or `char' (and
probably it's OK even for `char' in most cases).  That's why it worked
for the "hello world" test case when I tested it.

Thanks for pointing that out.  I plan to document that it works except
for argument types `float' and `char', and to change the code to (in
MLDS grades) check for those argument types and if they're found,
throw an exception.  I'll post a diff shortly.

> If there isn't more to it, is it possible to avoid generating
> the wrapper functions in ml_unify_gen.m in some cases?

Yes, when compiling to C, it would be possible to avoid the wrappers
in many cases.  It would require making some non-portable assumptions
about argument passing conventions, so it should be disable-able, but
in practice some simple assumptions will hold on the vast majority of
C implementations.  That is a good idea.

(However, it won't be possible for the Java back-end, and although it
it might be possible in IL, with our current implementation, it would
come at the cost of losing verifiability. If/when we change our IL
implementation to use delegates rather than function pointers, it
won't be possible.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- 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