From: Alain Frisch <alain.frisch@lexifi.com>
To: Gabriel Scherer <gabriel.scherer@gmail.com>,
"Soegtrop, Michael" <michael.soegtrop@intel.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Specify the default hash function for a type
Date: Fri, 13 May 2016 14:23:52 +0200 [thread overview]
Message-ID: <cb67869e-f827-e406-d8e5-36d10f8367c5@lexifi.com> (raw)
In-Reply-To: <CAPFanBEpjPrnWXC3=Lxd=3y7jzSZcsZpx8GWerYFr4Qg5PY9qg@mail.gmail.com>
On 13/05/2016 14:01, Gabriel Scherer wrote:
>>From the C side it is possible to create "custom" values that come
> with user-specified comparison and hashing functions. However, for now
> the runtime does not allow creating them from OCaml -- this is indeed
> a desirable feature, but it's not trivial to implement. I don't really
> whether it's actually "really hard", or just that it requires some
> effort that nobody has invested yet -- the latter would be my guess.
The problem is that the custom comparison function could move objects in
the heap if it triggers a GC, and the polymorphic functions
(compare/hash) would need to take this into account, i.e. register all
"pending" nodes as GC roots. This could slow them down quite a bit.
Alain
next prev parent reply other threads:[~2016-05-13 12:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 7:52 Soegtrop, Michael
2016-05-13 8:13 ` Ben Millwood
2016-05-13 8:40 ` Soegtrop, Michael
2016-05-13 9:06 ` Alain Frisch
2016-05-13 9:26 ` Soegtrop, Michael
2016-05-13 12:01 ` Gabriel Scherer
2016-05-13 12:23 ` Alain Frisch [this message]
2016-05-13 12:32 ` Soegtrop, Michael
2016-05-13 13:50 ` Pierre Chambart
2016-05-13 13:56 ` Alain Frisch
2016-05-13 16:17 ` Soegtrop, Michael
2016-05-13 18:57 ` Thomas Braibant
2016-05-13 22:45 ` Soegtrop, Michael
2016-05-14 8:41 ` Thomas Braibant
2016-05-14 9:06 ` Soegtrop, Michael
2016-05-17 13:03 ` Soegtrop, Michael
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb67869e-f827-e406-d8e5-36d10f8367c5@lexifi.com \
--to=alain.frisch@lexifi.com \
--cc=caml-list@inria.fr \
--cc=gabriel.scherer@gmail.com \
--cc=michael.soegtrop@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox