Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Francois Pottier <Francois.Pottier@i...>
Subject: Re: Alternative generic hash function

Dan,

> Why do you think the overhead would be high?

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.  That would allow
implementing the `pure' hash function proposed by Manuel Fähndrich, but
with a cost: the user would have to separate the mutable fields into a
sub-object, so as to allow the root object to be tagged as immutable.
Which other tricks do you have in mind?

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/