Newsgroups: comp.lang.apl Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!blister!itcyyz!yrloc!hui From: hui@yrloc.ipsa.reuter.COM (Roger Hui) Subject: Re: Statistical Functions in J Message-ID: <1991May31.171148.12753@yrloc.ipsa.reuter.COM> Reply-To: hui@yrloc.ipsa.reuter.COM (Roger Hui) Organization: Iverson Software Inc. References: <1991May12.145907.19563@yrloc.ipsa.reuter.COM> <356@tslwat.UUCP> <1991May21.042804.21102@yrloc.ipsa.reuter.COM> <414@tslwat.UUCP> <1991May29.191441.1279@aplcen.apl.jhu.edu> <1991May29.204803.26927@jato.jpl.nasa.gov> Date: Fri, 31 May 91 17:11:48 GMT Dave Weintraub writes: > I fully agree. This is the path taken by IBM with APL2: write external > functions (in Assembler, FORTRAN, PL/I, C, ...) and make these available > using QuadNA. Dave, this is in fact possible with LinkJ. LinkJ permits calling J from C and C from J. C functions so introduced behave like primitive verbs, in the sense that they may be assigned names, and (independently) may serve as arguments to adverbs and conjunctions. For example, f =. 10!:57 NB. f is an external function encoded by 57 f"r y NB. Apply f to rank r cells of y x f"r y NB. Apply f to rank r cells of x and y f/y NB. f insertion ("reduction") x f/y NB. f table ("outer product") 10!:362"r y NB. Apply the external fn encoded by 362 to rank r cells Sam Sirlin writes: > An interesting path in this vein is the path taken by ProMatlab. It uses the > dynamic linking capabilities of modern machines. Hence a variety of compiled > routines are available (and more can be written by the user) that are easily > linked in while running the Matlab interpreter, ... Sam, this is possible with LinkJ on systems supporting dynamic linking. Lou Kates writes: > >I am puzzled. How would a belief in regression and projection > >instead of expectation as the key concept materially affect > >the design of the primitives m., n., and s.? > ^^^^^^^^^^ > When everything you can think of gets put into the lanugage its hard > to see how they all qualify as primitive. > ... > I guess its whether you believe in parsimony or not. > > Personally I would rather have a wider family of powerful > operations at my disposal (such as regression, constrained linear > optimization a la simplex or Karmarker, eigenvalue calculations, > etc.) that are not easily derivable from each other rather than a > large set of functions which are all readily derivable from the > ideas of regression and projection. My own preference, and I > suspect that of many others too, would be that if you feel the > need to have zillions of functions at your disposal, define a > standard library so that you can take them out of the language so > as to keep the language smaller and more manageable. > ... It may be helpful to consult your copy of the Dictionary. In it, you'd find that (a) not everything you can think of is in the language; (b) we do not in fact have zillions of functions in the language; (c) the ISO APL %. (matrix inverse and matrix divide, what you called regression) is in the language; (d) characteristic values and vectors are in the language. Many primitives can be derived readily from each other. One could argue that *: (nand) makes the other boolean functions redundant, as do - (minus) and % (divide) for + (plus) and * (times). Similarly, one can derive |. (reverse), |: (transpose), u;.n (cut), u . v (generalized determinant), %. (domino), and so forth, from { (from). There is more to parsimony than reducing the number of primitives. ----------------------------------------------------------------- Roger Hui Iverson Software Inc., 33 Major Street, Toronto, Ontario M5S 2K9 (416) 925 6096