From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tk Newsgroups: gmane.lisp.guile.user Subject: Re: Matrix or array operations library Date: Mon, 24 Dec 2018 23:06:59 +0000 Message-ID: References: <7a362a59-3a4d-44c8-f4cd-5b232b6dffce@gmail.com> Reply-To: Tk NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545692735 9704 195.159.176.226 (24 Dec 2018 23:05:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Dec 2018 23:05:35 +0000 (UTC) Cc: "guile-user@gnu.org" To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 25 00:05:30 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gbZHu-0002Ok-Aa for guile-user@m.gmane.org; Tue, 25 Dec 2018 00:05:30 +0100 Original-Received: from localhost ([127.0.0.1]:39096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbZK0-0002jo-SM for guile-user@m.gmane.org; Mon, 24 Dec 2018 18:07:40 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gbZJf-0002jj-DH for guile-user@gnu.org; Mon, 24 Dec 2018 18:07:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gbZJb-0004gH-NE for guile-user@gnu.org; Mon, 24 Dec 2018 18:07:19 -0500 Original-Received: from mail4.protonmail.ch ([185.70.40.27]:39453) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gbZJZ-0004cs-62 for guile-user@gnu.org; Mon, 24 Dec 2018 18:07:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=default; t=1545692826; bh=5Q4tUiFGjzD24aogrTdwfSVAAiiw8NNXP4FOOrmACQ0=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References: Feedback-ID:From; b=aGdN8cPY2EZy3Cu+E8vOI4YJ7zhDLDDW4hRwy4ak78MWZK3TmBRteDCxVYjMXLayf 950XkgmHW4RX24H7eJMAxwSrsV0Cyh2/QazwQEt4VYAvW51vMp8FQvRaVi+ly+SoCH V1l1pMMwyJzmURZcKFrmhaIZw+jknV4z667cQ7tk= In-Reply-To: <7a362a59-3a4d-44c8-f4cd-5b232b6dffce@gmail.com> Feedback-ID: H-HDHPDhHGpnHYYqEeeELdj-Ly2a7MuykpUWpBFgfQ1BCJpPfO2vKz9YpJUb7-VnGIEXLb5c-uxqytN6PxXV2Q==:Ext:ProtonMail X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.70.40.27 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15141 Archived-At: =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Monday, 24 December 2018 23:01, Zelphir Kaltstahl wrote: > Hello Guile Users, > > Is there some library, that enables high performance matrix operations > or even n-dimensional array operations? I am thinking of something like > NumPy in the Python ecosystem. I think NumPy in turn also uses some > lower level thing to do what it does. I think OpenBLAS or MKL, depending > on the architecture. I wonder if there is any wrapper around OpenBLAS > for Guile or something similar. > > I am writing a little code for matrix operations and currently I am > using Guile arrays, as they are made of vectors and have constant access > time, which is already great. My guess is, that this would be the right > choice if using pure Guile. I am writing data abstraction procedures, so > that later on I could exchange what is used to represent the data. > > Maybe, if there is something like NumPy or lower level, I should use > that instead? (Would I have to learn how to use FFI first?) > > Or maybe Guile's implementation is already so fast, that it would not > make that much difference to use a lower level thing? > > Currently I have only a little experimental program, started today, so > no huge plan. OK, one can fantasize about stuff like Pandas data frames > in Guile, but I have no illusion, that it is a work of a few days or > even weeks. It would be nice to learn, how to use a low level thing or > maybe even Pandas, if there are any such bindings for Guile. I could > make the implementation use different representations, depending on a > parameter or something like that. > > Regards, > > Zelphir I took a different route. Instead of merely binding functionality in a lowe= r level language, I use Guile to generate lean-and-mean modern Fortran code= . The building blocks can be found here: https://gitlab.com/codetk/schemetr= an (wanted to save this for potluck, but here it goes ... ). Fortran compil= ers take care of efficient execution on HPC platforms. Actually, it is beyo= nd me why anyone would bother with any other programming language when it c= omes to expressing maths efficiently. I built a pseudo-spectral Navier-stokes solver that can work on MPI, shared= -mem (OpenMP), and hopefully soon GPU/Xeon accelerators (OpenMP 4) atop of = schemetran. I still need to see about publishing it under an Libre licence.