From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: Matrix or array operations library Date: Fri, 28 Dec 2018 18:16:02 -0500 Message-ID: References: <1C6C55C9-24B1-4952-BC1A-18CF80749565@bluewin.ch> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1546040028 3479 195.159.176.226 (28 Dec 2018 23:33:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2018 23:33:48 +0000 (UTC) Cc: guile-user , Matt Wette To: Daniel Llorens Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Dec 29 00:33:44 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 1gd1dP-0000oz-Q8 for guile-user@m.gmane.org; Sat, 29 Dec 2018 00:33:43 +0100 Original-Received: from localhost ([127.0.0.1]:33800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd1fW-0004Pk-JG for guile-user@m.gmane.org; Fri, 28 Dec 2018 18:35:54 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gd1eh-0003tz-6P for guile-user@gnu.org; Fri, 28 Dec 2018 18:35:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gd1MZ-0002a1-1T for guile-user@gnu.org; Fri, 28 Dec 2018 18:16:21 -0500 Original-Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:44720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gd1MW-0002M7-Su for guile-user@gnu.org; Fri, 28 Dec 2018 18:16:17 -0500 Original-Received: by mail-wr1-x432.google.com with SMTP id z5so22113425wrt.11 for ; Fri, 28 Dec 2018 15:16:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kXLyx+iDsKFp4BXdKXD6gwZyLbRdwa0kCJ0uQd82UJw=; b=WKQBORzlJF/VdXb+yWXSQsh9f5m5aqSiowP0nRPePl1TVe6qi2r5T/SzoAzPkSlpQO psdIVQYKlylWgjtzWM6WPUmaqsEa1qFZ1U37js1Srbkv5ax6exEs0sp9SkhKGT0n0va5 lclp5ldK4zl3pKtOQh/l25movUCTgxcP5GxrpwCWRZbuefVAoVzQWjS9GvMswiSzeUJG BuhmcTLNLfSNySD/EovZUpDIz2uYXBQ3ZOmsFR067hcVOJK0sk2/urjSn/PXvKHuBW9+ bB7UAzgJWwwwOCOFQfSm0tw/LwzM6k+qeQe3mS/yeIHweQr1Koo/ibPZAlR1lbZyaGoA C2kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kXLyx+iDsKFp4BXdKXD6gwZyLbRdwa0kCJ0uQd82UJw=; b=nt3yZsQwTuCuY+71L2kT+GlE4xUrAN8JNB/6ScUj2WY0hhlzMqj3tDBF0Cm21Kr7Wg iM/a43oFPxVSxgwOhg/WWQi5l2CMDEerIO6X2wogt99DtMpkRCaRWXVRCARpaPt/MAaC gBvE7cXMgASNWc3lgrwfvkvn6xBSUGWkc/i5iGD3Gy2hELRq+bF2t2VYPH30yVsdSBfK 0aRJoyPntH3wDPq40NQfSA1u/04638BhtYJ07QIQpGRVI49eItJC4NNjlofimhv2bl+o UfCr9FDtL9YidMfM9E5BbykMvHD7pTjIUOrL7G26Icvj0S5TbqdblsMz7DMZEl5b6Onh rRgg== X-Gm-Message-State: AJcUukcI6w29sS9fPI4oj7+qsTy1zvmSEbOjlNzSAgSSsL0VyCcTtBim d6cJL2wT1IR2I2hw1lh/pXN/2Auce5l7cc3eYzbhvA== X-Google-Smtp-Source: ALg8bN782NEIWAuPWU8l26Dq0cTXe/eQZiDd1rzIvJ92SME3CLEtU0xdf9uvOEaWsdy9aJ8lFXTEMG1kHBFBlZESN1M= X-Received: by 2002:a5d:5089:: with SMTP id a9mr27275727wrt.327.1546038973029; Fri, 28 Dec 2018 15:16:13 -0800 (PST) In-Reply-To: <1C6C55C9-24B1-4952-BC1A-18CF80749565@bluewin.ch> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 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:15167 Archived-At: On Fri, Dec 28, 2018 at 4:34 PM Daniel Llorens wrote: Of course all those other languages have extensive (and more or less > consistent) array facilities, while base Guile only has make-shared-array > (and transpose-array, for some reason). If array objects don't have an offset (the index in the backing store of the [0,0, ... 0] element), you can't do arbitrary translations, unfortunately. If Guile doesn't have that, it should. > For what is worth I think the array type needs to be moved to Scheme, but > this should be done in a backwards compatible way. Layering a Guile compatibility mode over SRFI 122 might be a Good Thing. Arrays there allow arbitrary affine transformations of the indices, provide lazy elementwise mapping (you can get eager mapping by composing mapping with copying), and have fast paths for arrays of up to 4 dimensions. Read-only and read-write arrays defined by arbitrary getter and setter functions are also provided, and work exactly like storage-based arrays. SRFI 122's only major limitation, which IMO is not a serious one, is that it doesn't handle 0-dimensional arrays (with one element) or degenerate arrays with non-positive dimensional ranges (with zero elements). The code is in Gambit Scheme, but translating it to portable Scheme is an easy matter (I just haven't gotten around to it). The main Gambit-specific dependency is define-macro (non-hygienic) macros, but nothing very bad is done with them. There is a post-SRFI fork at https://github.com/gambiteer/srfi-122/ which will fairly soon become an updated SRFI. -- John Cowan http://vrici.lojban.org/~cowan cowan@ccil.org Yakka foob mog. Grug pubbawup zink wattoom gazork. Chumble spuzz. --Calvin, giving Newton's First Law "in his own words"