From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from minnie.tuhs.org (minnie.tuhs.org [45.79.103.53]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 7f7d0652 for ; Wed, 18 Sep 2019 04:48:32 +0000 (UTC) Received: by minnie.tuhs.org (Postfix, from userid 112) id B84879B9DE; Wed, 18 Sep 2019 14:48:30 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 8118F94797; Wed, 18 Sep 2019 14:47:57 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=yaccman.com header.i=@yaccman.com header.b="RIIEcXS3"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id DA45D94797; Wed, 18 Sep 2019 14:47:55 +1000 (AEST) X-Greylist: delayed 102450 seconds by postgrey-1.36 at minnie.tuhs.org; Wed, 18 Sep 2019 14:47:54 AEST Received: from barn.birch.relay.mailchannels.net (barn.birch.relay.mailchannels.net [23.83.209.11]) by minnie.tuhs.org (Postfix) with ESMTPS id 94265946BD for ; Wed, 18 Sep 2019 14:47:54 +1000 (AEST) X-Sender-Id: dreamhost|x-authsender|scj@yaccman.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id AFC72341B76; Wed, 18 Sep 2019 04:47:53 +0000 (UTC) Received: from pdx1-sub0-mail-a95.g.dreamhost.com (100-96-114-48.trex.outbound.svc.cluster.local [100.96.114.48]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 102DA341AB3; Wed, 18 Sep 2019 04:47:53 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|scj@yaccman.com Received: from pdx1-sub0-mail-a95.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.17.5); Wed, 18 Sep 2019 04:47:53 +0000 X-MC-Relay: Junk X-MailChannels-SenderId: dreamhost|x-authsender|scj@yaccman.com X-MailChannels-Auth-Id: dreamhost X-Ski-Obese: 2403c4bc1630ee4b_1568782073489_1315145089 X-MC-Loop-Signature: 1568782073489:3796833878 X-MC-Ingress-Time: 1568782073488 Received: from pdx1-sub0-mail-a95.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a95.g.dreamhost.com (Postfix) with ESMTP id 205927FFFC; Tue, 17 Sep 2019 21:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=yaccman.com; h=message-id :from:to:in-reply-to:subject:date:content-type:mime-version; s= yaccman.com; bh=yZyQ15BMVQ35+gctGdL46ujz0z8=; b=RIIEcXS3uym2GfwU /0wYKZLA5VF3tSaw66mM1rqn88YIEmfn5rnW6Uw68icE5PtjYoTtTx6wi3MWKhSI 36BpUcW5C3X1I8MCOKDj/Ab5qbjYiAtWUCHUzR0zl3uNWqrm+1IRXo314g7nu4nZ Fh7aA5uODiHm2QU/rYKQ8hIbcDo= Received: from localhost (ip-66-33-200-4.dreamhost.com [66.33.200.4]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: scj@yaccman.com) by pdx1-sub0-mail-a95.g.dreamhost.com (Postfix) with ESMTPSA id 521757FFF0; Tue, 17 Sep 2019 21:47:47 -0700 (PDT) Message-Id: <2af4396e3f1133dfb93c2a92722e6f0e850ade55@webmail.yaccman.com> X-DH-BACKEND: pdx1-sub0-mail-a95 From: "Steve Johnson" To: "Doug McIlroy" , tuhs@tuhs.org, jnc@mercury.lcs.mit.edu X-Mailer: Atmail 7.8.0.2 X-Originating-IP: 10.35.42.221 in-reply-to: <201909171731.x8HHVq2L096688@tahoe.cs.Dartmouth.EDU> Date: Tue, 17 Sep 2019 21:47:47 -0700 Content-Type: multipart/alternative; boundary="=_9fe284a63c25ef5f19d10fc8194964d8" MIME-Version: 1.0 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrudejgdeklecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefkhffvofhijgfuffgtggesrgdtreerredtjeenucfhrhhomhepfdfuthgvvhgvucflohhhnhhsohhnfdcuoehstghjseihrggttghmrghnrdgtohhmqeenucfkphepieeirdeffedrvddttddrgedpuddtrdefhedrgedvrddvvddunecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtpdhinhgvthepieeirdeffedrvddttddrgedprhgvthhurhhnqdhprghthhepfdfuthgvvhgvucflohhhnhhsohhnfdcuoehstghjseihrggttghmrghnrdgtohhmqedpmhgrihhlfhhrohhmpehstghjseihrggttghmrghnrdgtohhmpdhnrhgtphhtthhopehjnhgtsehmvghrtghurhihrdhltghsrdhmihhtrdgvughunecuvehluhhsthgvrhfuihiivgeptd Subject: Re: [TUHS] block operations in editors, was My EuroBSDcon talk X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --=_9fe284a63c25ef5f19d10fc8194964d8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is one of my pet peeves.=C2=A0 "Random Access" memory is far from= =0Arandom when you look at the time it takes to do the accesses.=C2=A0 W= ith=0Amodern memories, accessing a column can be 20 to 40x slower than= =0Aaccessing a row.=C2=A0 This is particularly irritating when doing AI= =0Atraining, where training reuses 4-d tensors transposed, a very painfu= l=0Aoperation.=0A=0AIn FORTRAN days, I once used a vector package in whi= ch you described a=0Avector by giving the first element, the second elem= ent, and a count.=C2=A0=0ASo you could describe rows, columns, a matrix= diagonal, and even rows=0Aand columns from back to front.=C2=A0 Fortran= passed arguments by address,=0Awhich made the whole thing easy and fast= .=0A=0ASteve=0A=0A----- Original Message -----=0AFrom: "Doug McIlroy" =0ATo:, =0A= Cc:=0ASent:Tue, 17 Sep 2019 13:31:52 -0400=0ASubject:Re: [TUHS] block op= erations in editors, was My EuroBSDcon talk=0A=0A Noel Chiappa wrote:=0A= =0A > > From: Doug McIlroy=0A >=0A > > the absence of multidemensional a= rrays in C.=0A >=0A >?? From the 'C Reference Manual' (no date, but circ= a 'Typesetter=0AC'), pg. 11:=0A >=0A > "If the unadorned declarator D wo= uld specify an n-dimensional array=0A.. then=0A > the declarator D[in+1]= yields an (n+1)-dimensional array"=0A >=0A >=0A >I'm not sure if I've _= ever_ used one, but they are there.=0A=0A Yes, C allows arrays of arrays= , and I've used them aplenty.=0A However an "n-dimensional array" has on= e favored dimension,=0A out of which you can slice an array of lower dim= ension. For=0A example, you can pass a row of a 2D array to a function o= f a=0A 1D variable, but you can't pass a column. That asymmetry=0A under= lies my assertion. In Python, by contrast, n-dimensional=0A arrays can b= e sliced on any dimension.=0A=0A Doug=0A=0A --=_9fe284a63c25ef5f19d10fc8194964d8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is one of my pet peeves.=C2=A0 "Random Access" memory is fa= r from random when you look at the time it takes to do the accesses.=C2= =A0 With modern memories, accessing a column can be 20 to 40x slower tha= n accessing a row.=C2=A0 This is particularly irritating when doing AI t= raining, where training reuses 4-d tensors transposed, a very painful op= eration.

In FORTRAN days, I once used a vector packag= e in which you described a vector by giving the first element, the secon= d element, and a count.=C2=A0 So you could describe rows, columns, a mat= rix diagonal, and even rows and columns from back to front.=C2=A0 Fortra= n passed arguments by address, which made the whole thing easy and fast.=

Steve



----- Original Message -----
=
From:
"Doug McIlro= y" <doug@cs.dartmouth.edu>

To:
<tuhs@tuhs.= org>, <jnc@mercury.lcs.mit.edu>
Cc:

Sent:
Tue, 17 Sep 2019 13= :31:52 -0400
Subject:
Re: [TUHS] block operations in= editors, was My EuroBSDcon talk


=0ANoel Chiappa wrote:
<= br>=0A> > From: Doug McIlroy
=0A>
=0A> > the= absence of multidemensional arrays in C.
=0A>
=0A>?? From t= he 'C Reference Manual' (no date, but circa 'Typesetter C'), pg. 11:
= =0A>
=0A> "If the unadorned declarator D would specify an n-di= mensional array .. then
=0A> the declarator D[in+1] yields an (n+= 1)-dimensional array"
=0A>
=0A>
=0A>I'm not sure if I'= ve _ever_ used one, but they are there.

=0AYes, C allows arrays o= f arrays, and I've used them aplenty.
=0AHowever an "n-dimensional ar= ray" has one favored dimension,
=0Aout of which you can slice an arra= y of lower dimension. For
=0Aexample, you can pass a row of a 2D arra= y to a function of a
=0A1D variable, but you can't pass a column. Tha= t asymmetry
=0Aunderlies my assertion. In Python, by contrast, n-dime= nsional
=0Aarrays can be sliced on any dimension.

=0ADoug
<= br>
--=_9fe284a63c25ef5f19d10fc8194964d8--