Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Alternative generic hash function
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-05-30 (20:25)
From: Ken Wakita <wakita@i...>
Subject: Re: Alternative generic hash function

In message (<>)
from Francois Pottier <>,
talking about "Re: Alternative generic hash function",
on Mon, 29 May 2000 15:13:57 +0200

> I was thinking of a recording mutability per-field, rather than
> per-object. I agree that your proposal seems economical enough.
> > there are plenty of clever tricks you can put in the runtime system
> > that exploit the immutability of objects.
> Would you care to elaborate? I am no compiler expert, but I'm not sure
> why it would be so interesting to have this information at runtime,
> where it is already too late to do code optimization.

Mutability information is useful in distributed computing.  We have
been implementing a distributed Caml, which comes with distributed
shared memory.  To preserve assignment semantics over the network
(basically) we need to replace references to mutables with remote
pointers when they are remotely referenced.  In general, it is
impossible to tell remote/local reference at compile time.  Therefore
we need mutability information at runtime.

We modified the runtime representations for Caml mutable objects so
that the communication substrate can detect mutables (vectors and
mutable record fields).  For this purpose, our modifed compiler
assigns Mutable tag to vectors and arrays.  As for mutable record
field unboxed representation was replaced by boxed representation.
With the latter design, access to record fields can be slower but it
is negligible.

Ken Wakita