Re: Hashing a procedure object reliably

2025-04-13 Thread tomas
On Sun, Apr 13, 2025 at 07:59:21PM +0200, Maxime Devos wrote: > > On 13/04/2025 19:47, to...@tuxteam.de wrote: > > On Sun, Apr 13, 2025 at 07:03:56PM +0200, Maxime Devos wrote: > > > > [...] > > > > > > Typical hashing of the non-cryptographic kind aren't designed to > > > > virtually eliminate

Re: Hashing a procedure object reliably

2025-04-13 Thread Maxime Devos
Spacing appears to have been messed up, so here's the same thing with extra newlines On 13/04/2025 18:55, Maxime Devos via General Guile related discussions wrote: On 11/04/2025 15:49, Olivier Dion wrote: My goal here is that I have GOOPS object. The object is used to produce a pure result

Re: Hashing a procedure object reliably

2025-04-13 Thread Maxime Devos via General Guile related discussions
On 13/04/2025 19:47, to...@tuxteam.de wrote: On Sun, Apr 13, 2025 at 07:03:56PM +0200, Maxime Devos wrote: [...] Typical hashing of the non-cryptographic kind aren't designed to virtually eliminate hash collisions [...] Nit: given a "reasonable" hash, the collision probability should be the

Re: Hashing a procedure object reliably

2025-04-13 Thread tomas
On Sun, Apr 13, 2025 at 07:03:56PM +0200, Maxime Devos wrote: [...] > > Typical hashing of the non-cryptographic kind aren't designed to > > virtually eliminate hash collisions [...] Nit: given a "reasonable" hash, the collision probability should be the same for crypto or non-crypto hash (for t

Re: Hashing a procedure object reliably

2025-04-13 Thread Maxime Devos via General Guile related discussions
On 11/04/2025 15:49, Olivier Dion wrote: My goal here is that I have GOOPS object. The object is used to produce a pure result which I can store in a cache on the disk, given the hash of the object. I can then re-fetch the result on disk in another Guile process if the hashes match. As you c

Re: Hashing a procedure object reliably

2025-04-11 Thread tomas
On Fri, Apr 11, 2025 at 11:34:37AM -0400, Olivier Dion wrote: [...] > I think the definition of equivalent here is that the pure behavior of > the procedures are the same. Say we're hashing `(lambda (x y) (+ x y))' > and `(lambda (u v) (+ u v))'. These procedures does not have equivalent > sour

Re: Hashing a procedure object reliably

2025-04-11 Thread Thompson, David
Hi Olivier, On Fri, Apr 11, 2025 at 9:50 AM Olivier Dion wrote: > > Like mentioned in the comment (look for the `(procedure? value)' > clause), this does _not_ yield the same hash for a procedure if the > module where this procedure came from is compiled. And it's not > possible to pass the proc

Re: Hashing a procedure object reliably

2025-04-11 Thread Olivier Dion
On Fri, 11 Apr 2025, Vivien Kraus wrote: > Hello, > > Le vendredi 11 avril 2025 à 09:49 -0400, Olivier Dion a écrit : >> But some fields seems to >> not be taken into account and you will end up with fetching >> substitute >> in the store.  I want to avoid this element of surprise in my case. Sid

Re: Hashing a procedure object reliably

2025-04-11 Thread Zelphir Kaltstahl
On 11.04.25 21:49, Olivier Dion wrote: Hi Guile users! I have a hashing procedure that can hash many things like so: (define (hash value) (cond ((pair? value) (let loop ((elements value) (acc (srfi:hash '())) (k 1)) (if (null? el

Re: Hashing a procedure object reliably

2025-04-11 Thread Vivien Kraus
Hello, Le vendredi 11 avril 2025 à 09:49 -0400, Olivier Dion a écrit : > But some fields seems to > not be taken into account and you will end up with fetching > substitute > in the store.  I want to avoid this element of surprise in my case. >From what I understand, here (problem A), you want to