🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #6690

Re: Common subexpression optimization

#6690
From: Piercarlo Grandi
Date: Fri, 09 Feb 1990 20:26
31 lines
2101 bytes
In article <RAULMILL.90Feb7094338@alcor.usc.edu> raulmill@usc.edu (R D R) writes:
    
    On the other hand, there are languages like APL which with a few
    changes (like variable scoping, and function rank declaration) ought
    to make very nice compiling languages.  /* APL implementation of
    matrix multiply:  A <- B +.x C */.  From what I've heard, it is
    possible to DEVELOP code in APL about 6 or 7 times faster than what is
    usual with FORTRAN.

Well, this may be too optimistic, as APL has some obscurities
as well. On the other hand, APL is an application level
language, and here I have no qualms about optimizing it, as for
SQL, in another application context.

However, even languages at the correct level of abstraction for
the application, for which the compiler can use interesting
strategies for optimization, occasionally require the
programmer to use special attention, if the programmer knows
better than the optimizer. But thank goodness this is rarer.

There are many ways to code matrix multiplication; I'd rather
not write one and then expect the compiler to transform it into
another one that it thinks more appropriate, but just use the
high level concept and then the compiler can, more safely, do
what it wants. Unless of course I am the implementor of the
matrix multiplication module, where I want the compiler to
respect my code obediently.
-- 
Piercarlo "Peter" Grandi           | ARPA: pcg%cs.aber.ac.uk@nsfnet-relay.ac.uk
Dept of CS, UCW Aberystwyth        | UUCP: ...!mcvax!ukc!aber-cs!pcg
Penglais, Aberystwyth SY23 3BZ, UK | INET: pcg@cs.aber.ac.uk
Technical Details
Message-ID: <1627@aber-cs.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!aber-cs!pcg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!dcl-cs!aber-cs!pcg
From: pcg@aber-cs.UUCP (Piercarlo Grandi)
Newsgroups: comp.lang.misc
Subject: Re: Common subexpression optimization
Summary: APL == application level language!
Message-ID: <1627@aber-cs.UUCP>
Date: 9 Feb 90 20:26:25 GMT
Reply-To: pcg@cs.aber.ac.uk (Piercarlo Grandi)
Organization: Dept of CS, UCW Aberystwyth
 (Disclaimer: my statements are purely personal)
Lines: 31