From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: lloda Newsgroups: gmane.lisp.guile.devel Subject: Rewrite of Guile's array system in Scheme Date: Tue, 6 Aug 2019 18:46:36 +0200 Message-ID: <621F9896-AC3C-4B2A-A523-C107B72B306E@sarc.name> Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160154"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 06 18:46:57 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hv2bw-000fXW-JX for guile-devel@m.gmane.org; Tue, 06 Aug 2019 18:46:56 +0200 Original-Received: from localhost ([::1]:35038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv2bv-0003AK-Fg for guile-devel@m.gmane.org; Tue, 06 Aug 2019 12:46:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48790) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hv2bl-0003A7-4Z for guile-devel@gnu.org; Tue, 06 Aug 2019 12:46:47 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hv2bj-00069B-T9 for guile-devel@gnu.org; Tue, 06 Aug 2019 12:46:45 -0400 Original-Received: from mta-08-4.privateemail.com ([198.54.122.58]:24323) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hv2bj-00064m-NK for guile-devel@gnu.org; Tue, 06 Aug 2019 12:46:43 -0400 Original-Received: from MTA-08.privateemail.com (localhost [127.0.0.1]) by MTA-08.privateemail.com (Postfix) with ESMTP id EE48260057 for ; Tue, 6 Aug 2019 12:46:38 -0400 (EDT) Original-Received: from [192.168.1.105] (unknown [10.20.151.215]) by MTA-08.privateemail.com (Postfix) with ESMTPA id 8C61D60051 for ; Tue, 6 Aug 2019 16:46:38 +0000 (UTC) X-Mailer: Apple Mail (2.3445.104.11) X-Virus-Scanned: ClamAV using ClamSMTP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 198.54.122.58 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20033 Archived-At: Hi, This is to announce that I've been working on a rewrite of Guile's array = system, entirely in Scheme. https://notabug.org/lloda/guile-newra https://github.com/lloda/guile-newra Newra works on Guile 2.2, but it's quite a bit faster on Guile 2.9. There are several reasons for this rewrite. A major one is that the = current array system forces constant switches between C and Scheme and = is opaque to the Scheme compiler. As the Scheme compiler improves this = becomes more noticeable.=20 The work is at a stage where all of the functionality of the old system = is available in the new one, except for a few items that require patches = to Guile itself (e.g. compiler support for literals, the C interface). = These are listed at the end of the README. On the other hand the new = system has a few extra whistles, such as basic rank extension / = broadcasting and lazy index vectors. This is still not a full featured array system, but it's a superset of = what Guile offers now and hopefully it's a better base to build on. There is a test suite and a benchmark. The documentation consists of the = README, plus docstrings. The output of the benchmark on two different = machines: debian i7-4930K - https://paste.debian.net/1094626/ mac i5-8500B - https://paste.debian.net/1094627/ On Guile 2.9 some things are appreciably faster already, others are = about the same. The only places where the C is still out of reach is = where there is a fast path, such as array-copy! between #t types, which = ends in a memcpy() in C. -- The reason I announce this now is that I'm at a point where some design = decisions are needed =E2=80=94 the old API is inconvenient and we should = have something that looks closer to they typical array API. I also could = use some help with optimization. Of course a review or any other kind of = feedback would be welcome as well. To be clear, it is my intention, in due course, to propose Newra for = inclusion in Guile. Regards - Daniel