home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / apl / 1260 < prev    next >
Encoding:
Text File  |  1992-12-22  |  3.8 KB  |  112 lines

  1. Newsgroups: comp.lang.apl
  2. Path: sparky!uunet!gatech!darwin.sura.net!spool.mu.edu!umn.edu!csus.edu!sfsuvax1.sfsu.edu!emclean
  3. From: emclean@sfsuvax1.sfsu.edu (Emmett McLean)
  4. Subject: Re: What's J, etc.
  5. Message-ID: <1992Dec22.181944.28862@csus.edu>
  6. Sender: news@csus.edu
  7. Organization: San Francisco State University
  8. References: <9212221607.AA27593@top.magnus.acs.ohio-state.edu>
  9. Date: Tue, 22 Dec 1992 18:19:44 GMT
  10. Lines: 100
  11.  
  12. To: dbrownfi@magnus.acs.ohio-state.edu
  13. Subject: Re: What's J, etc.
  14. Newsgroups: comp.lang.apl
  15. In-Reply-To: <9212221607.AA27593@top.magnus.acs.ohio-state.edu>
  16. Organization: San Francisco State University
  17. Cc: 
  18. Bcc: 
  19.  
  20. In article <9212221607.AA27593@top.magnus.acs.ohio-state.edu> you write:
  21. >It has been a long time since I've programmed with APL so I have a few 
  22. >questions:
  23. >     1. What's J?
  24.  
  25.       Basically, J is like an ASCII version of APL except that
  26.       some of the old APL instuctions have been generalized
  27.       or rationalized. (Actually some would argue that some
  28.       of todays implementations of APL, having an OOP
  29.       orientation and *lots* of open communication features
  30.       are *worlds* apart, but speaking from the point of
  31.       view of an old APL'er ..). J is both a pure functional programming 
  32.       language and an explicit programming language. Both languages
  33.       have the strong point of being program-at-the-speed-of-thought 
  34.       and list-at-a-time processing languages.
  35.  
  36.       J is very portable and runs on all popular platforms,
  37.       VAX , NeXT, MAC, IBMPC, Atari, Sun Sparc, and HPLX to
  38.       name a few. 
  39.  
  40.       At this point you won't be familar with J syntax, but here are
  41.       to verbs (aka functions) for you to look at:
  42.  
  43.       This one calculates the legendre polynomials:
  44.  
  45.    factors =. (%~ (-@<: , <:@+:))@ {.@$ 
  46.    last2   =. (,&0@{. , 0&,.@}.)@( _2&{.)
  47.    legendre =. ,.&0 , +/@(last2 * factors) 
  48.    basis =. =/~@i. 2
  49.  
  50.    So we can run legendre as:
  51.  
  52.    legendre ^:4 basis 
  53.        1     0     0     0     0     0
  54.        0     1     0     0     0     0
  55.     _0.5     0   1.5     0     0     0
  56.        0  _1.5     0   2.5     0     0
  57.    0.375     0 _3.75     0 4.375     0
  58.        0 1.875     0 _8.75     0 7.875
  59.  
  60.    (The basis is 1 0
  61.                  0 1)
  62.  
  63.    And written as a verb not refering to any other verbs :
  64.    l=. ,.&0 , +/@((,&0@{. , 0&,.@}.)@(_2&{.) * (%~ (-@<: , <:@+:))@{.@$)
  65.  
  66.    And the primes found by determining if any of the numbers between
  67.    1 and sqrt N divide N :
  68.  
  69.    ph =. (#~ (1&=)@(+/)@(0&=)@(|/~ i.@>:@<.@%:)"0)@(>:@+:@i.@>.@-:)
  70.  
  71.    Also, J includes a DOS extender and lets you build graphical
  72.    user interfaces for applications.
  73.  
  74.    **
  75.    You can get J from watserv1.waterloo.edu .  In the path
  76.    "languages/apl" or "languages/apl/j" you may find Dr. Dickey's
  77.    writeup What-is-J of interest. You'll find the executable
  78.    version of your program in "lanugages/apl/j/exec/*" .
  79.    (And if you're a C++ bug, you can compile the source code
  80.    on your machine. Oh yes, J allows calling to compiled C programs.
  81.  
  82.    Documentation is available at     
  83.  
  84.    Iverson Software Inc
  85.    33 Major Street
  86.    Toronto, Ontario, M5S 2K9 
  87.    (416)-925-6096
  88.    FAX (416)-488-7559
  89.  
  90.    For $34 ($24 + $10 handling) you get "The Dictionary of J",
  91.    comprehensive and concise description of commands, and
  92.    "An Introduction of J" a useful booklet with many useful
  93.    examples.
  94.  
  95. >     2. Is there a shareware/PD APL interpreter available for MS-DOS?
  96.  
  97.       Yes, at watserv1. Check out the file apl-j for details.
  98.  
  99. >     3. Has anyone ever come up with an APL compiler?
  100.  
  101.       From what I understand, much of Manugistics APL compiles.
  102.       I don't know about IBM's product APL2.
  103.  
  104.       Also, IBM is beta testing a APL to C translator. Translated
  105.       C programs run as fast as their C counterparts.
  106.  
  107.   I suppose I'll save this message since the question keeps poping up!
  108.  
  109.   Hope this helped,
  110.  
  111.   Emmett emclean@sfsuvax1.sfsu.edu
  112.