From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Nelson H. F. Beebe" Newsgroups: gmane.lisp.guile.devel Subject: Re: propose deprecation of generalized-vector-* Date: Thu, 28 Feb 2013 16:04:42 -0700 (MST) Message-ID: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1362094259 21681 80.91.229.3 (28 Feb 2013 23:30:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2013 23:30:59 +0000 (UTC) Cc: Arnold Robbins , beebe@math.utah.edu To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 01 00:31:22 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UBCwb-000562-Gy for guile-devel@m.gmane.org; Fri, 01 Mar 2013 00:31:21 +0100 Original-Received: from localhost ([::1]:55174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBCwG-0006vz-Fr for guile-devel@m.gmane.org; Thu, 28 Feb 2013 18:31:00 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:47919) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBCw7-0006vN-UF for guile-devel@gnu.org; Thu, 28 Feb 2013 18:30:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UBCw4-0007uI-Ig for guile-devel@gnu.org; Thu, 28 Feb 2013 18:30:51 -0500 Original-Received: from mail.math.utah.edu ([155.101.98.135]:62841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UBCw4-0007tz-At for guile-devel@gnu.org; Thu, 28 Feb 2013 18:30:48 -0500 Original-Received: from psi.math.utah.edu (psi.math.utah.edu [155.101.96.19]) by mail.math.utah.edu (8.14.5/8.14.5) with ESMTP id r1SN4gio011253; Thu, 28 Feb 2013 16:04:42 -0700 (MST) Original-Received: from psi.math.utah.edu (localhost [127.0.0.1]) by psi.math.utah.edu (8.14.5/8.14.5) with ESMTP id r1SN4g8Q028543; Thu, 28 Feb 2013 16:04:42 -0700 (MST) Original-Received: (from beebe@localhost) by psi.math.utah.edu (8.14.5/8.14.5/Submit) id r1SN4gPJ028542; Thu, 28 Feb 2013 16:04:42 -0700 (MST) X-US-Mail: "Department of Mathematics, 110 LCB, University of Utah, 155 S 1400 E RM 233, Salt Lake City, UT 84112-0090, USA" X-Telephone: +1 801 581 5254 X-FAX: +1 801 581 4148 X-URL: http://www.math.utah.edu/~beebe X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.8 (mail.math.utah.edu [155.101.98.135]); Thu, 28 Feb 2013 16:04:42 -0700 (MST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 155.101.98.135 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15843 Archived-At: If guile introduces full-fledged support of arrays for numeric computing, and for communicating with external libraries, such as the currently-moribund Guile-numerics interface to GNU Scientific Library (GSL), libsndfile, FFTW, and LAPACK http://www.nongnu.org/guile-num/ please do not forget, as higher-level language programmers too often do, that array storage order matters a GREAT DEAL for efficiency. Modern processors operate in registers up to 500x faster than on (DRAM) memory, and cache (SRAM) is about 10x to 50x faster than DRAM. Thus, if you use Fortran column-major order (first subscript varying most rapidly), it can be MUCH faster to compute down the columns than to compute across rows. The C/C++ languages use row-major order (last subscript varying most rapidly), so for them, the situation is reversed: row traversals are preferred over column traversals. Java really screwed things up by using an arrays-of-arrays-of-... storage model, so MxN rectangular matrix data are spread over M or N separate contiguous vectors allocated at arbitrary locations in memory. With that arrangement, and Java's requirement that array accesses must be accompanied by mandatory bounds checks, it is difficult to make good use of cache. That serious deficiency is why IBM introduced new contiguous-array classes for Java, and why the (seemingly-now-defunct) Java Grande project was started: http://www.javagrande.org/ http://en.wikipedia.org/wiki/Criticism_of_Java The bounds-checking overhead can be reduced at a lower level: see Implicit array bounds checking on 64-bit architectures http://doi.acm.org/10.1145/1187976.1187982 For any scripting language that wishes to communicate array data with external libraries written in other languages, it seems desirable to offer support for remapping of (possibly-associative) arrays in the scripting language to contiguous arrays in both row-major and column-major order, with user-specified initializers for unset elements. That way, huge amounts of library code in Fortran, C, and C++ become accessible. The reverse mappings back from the external library to the scripting language are also needed. If arrays are handled with some generality in the latter, the library return might not even require copying any numerical data, just updating some metadata that record how array elements are to be found. The GNU gawk developers are currently working on similar extensions to the code world outside the scripting language; it would make sense for both gawk and guile groups to be aware of the efforts of the other: https://lists.gnu.org/mailman/listinfo/gawk-devel ------------------------------------------------------------------------------- - Nelson H. F. Beebe Tel: +1 801 581 5254 - - University of Utah FAX: +1 801 581 4148 - - Department of Mathematics, 110 LCB Internet e-mail: beebe@math.utah.edu - - 155 S 1400 E RM 233 beebe@acm.org beebe@computer.org - - Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe/ - -------------------------------------------------------------------------------