From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) 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 Message-ID: <87y3yt86h5.fsf@gnu.org> References: <20170102031618.731a77b0@scratchpost.org> <20170102145137.41830372@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOAhh-0006jn-I2 for guix-devel@gnu.org; Mon, 02 Jan 2017 17:03:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOAhd-0001SY-LP for guix-devel@gnu.org; Mon, 02 Jan 2017 17:03:41 -0500 In-Reply-To: (David Craven's message of "Mon, 2 Jan 2017 15:31:31 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: David Craven Cc: guix-devel David Craven skribis: >> Also, why is sha256 used via FFI via an external library? It's not exact= ly 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=E2=80=99s a need for it on the build side where perform= ance does not matter much, it makes sense to add a pure-Scheme implementation. I think Weinh=C3=B6lt=E2=80=99s 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 =E2=80=98%libgcrypt=E2=80= =99 is found to the right thing, or something like that. HTH! Ludo=E2=80=99.