[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guix build side - including modules (guix hash), (guix gcrypt): How
From: |
Ludovic Courtès |
Subject: |
Re: Guix build side - including modules (guix hash), (guix gcrypt): How to provide shared library? |
Date: |
Mon, 02 Jan 2017 23:03:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
David Craven <address@hidden> skribis:
>> Also, why is sha256 used via FFI via an external library? It's not exactly
>> difficult to implement in Guile :P
>
> I'm not sure we want to write our own crypto primitives... And it's
> not quite as trivial, I don't know or care what a Newton-Raphson
> algorithm is ;)
> http://stackoverflow.com/questions/24093199/a-pure-scheme-implementation-r5rs-of-sha256
I suspect it would be slow with Guile 2.0, and (guix hash) is used in
performance-critical locations.
That said, if there’s a need for it on the build side where performance
does not matter much, it makes sense to add a pure-Scheme
implementation. I think Weinhölt’s Industria library has one.
Alternately, we could make it easier to import (guix hash). All we need
is to create a custom (guix config) module where ‘%libgcrypt’ is found
to the right thing, or something like that.
HTH!
Ludo’.