SHARP APL

From APL Wiki
Revision as of 22:17, 10 September 2022 by Adám Brudzewsky (talk | contribs) (Text replacement - "</source>" to "</syntaxhighlight>")
Jump to navigation Jump to search

SHARP APL running under DOSBox

SHARP APL was an APL implementation offered by I.P. Sharp Associates (IPSA), originally as part of its time-sharing service and later as a stand-alone product. It was split off from STSC's APL*PLUS, which until then had been sold jointly by the two companies. SHARP APL was the source of many developments in flat array theory, driven by Ken Iverson and other APL designers at IPSA.

Primitive functions

Arithmetic

Scalar

All scalar functions have rank zero.

Glyph Monadic Dyadic
<source lang=apl inline>+</syntaxhighlight> Conjugate/Identity Addition
<source lang=apl inline>-</syntaxhighlight> Negate Subtraction
<source lang=apl inline>×</syntaxhighlight> Signum Multiplication
<source lang=apl inline>÷</syntaxhighlight> Reciprocal Division
<source lang=apl inline>*</syntaxhighlight> Exponential Power
<source lang=apl inline>⍟</syntaxhighlight> Natural Logarithm Base-⍺ Logarithm
</syntaxhighlight> Magnitude Residue
<source lang=apl inline>!</syntaxhighlight> Factorial Out-Of/Combinations
<source lang=apl inline>⌊</syntaxhighlight> Floor Minimum
<source lang=apl inline>⌈</syntaxhighlight> Ceiling Maximum
<source lang=apl inline>○</syntaxhighlight> Pi Times Circle functions
<source lang=apl inline>∧</syntaxhighlight> And/Least Common Multiple (LCM)
<source lang=apl inline>∨</syntaxhighlight> Or/Greatest Common Divisor (GCD)
<source lang=apl inline>⍲</syntaxhighlight> Nand
<source lang=apl inline>⍱</syntaxhighlight> Nor
<source lang=apl inline>~</syntaxhighlight> Not See Miscellaneous
<source lang=apl inline>?</syntaxhighlight> Roll See Non-scalar

Non-scalar

Glyph Rank Monadic Ranks Dyadic
<source lang=apl inline>⌹</syntaxhighlight> 2 Matrix inverse ∞ 2 Matrix divide
<source lang=apl inline>?</syntaxhighlight> See Scalar * * Deal
<source lang=apl inline>⊤</syntaxhighlight> ∞ ∞ Encode
<source lang=apl inline>⊥</syntaxhighlight> ∞ ∞ Decode

Relational

Glyph Rank Monadic Ranks Dyadic
<source lang=apl inline>=</syntaxhighlight> See Miscellaneous 0 0 Equals
<source lang=apl inline>≠</syntaxhighlight> See Miscellaneous 0 0 Not Equals
<source lang=apl inline><</syntaxhighlight> See Structural 0 0 Less Than
<source lang=apl inline>≤</syntaxhighlight> 0 0 Less Than or Equal
<source lang=apl inline>≥</syntaxhighlight> 0 0 Greater Than or Equal
<source lang=apl inline>></syntaxhighlight> See Structural 0 0 Greater Than
<source lang=apl inline>≡</syntaxhighlight> ∞ ∞ Match
<source lang=apl inline>∊</syntaxhighlight> 0 ∞ Membership
<source lang=apl inline>⍷</syntaxhighlight> ∞ ∞ Find

Indexing

Glyph Rank Monadic Ranks Dyadic
<source lang=apl inline>@</syntaxhighlight> See Miscellaneous 0 ∞ From
<source lang=apl inline>⍳</syntaxhighlight> 1 Count 1 0 Index Of
<source lang=apl inline>⍸</syntaxhighlight> ∞ ∞ Index
<source lang=apl inline>⍋</syntaxhighlight> Numeric Grade up ∞ ∞ Character Grade up
<source lang=apl inline>⍒</syntaxhighlight> Numeric Grade down ∞ ∞ Character Grade down

Structural

Glyph Rank Monadic Ranks Dyadic
<source lang=apl inline>⍴</syntaxhighlight> Shape of 1 ∞ Reshape
<source lang=apl inline>↑</syntaxhighlight> See Miscellaneous 1 ∞ Take
<source lang=apl inline>↓</syntaxhighlight> Raze 1 ∞ Drop
<source lang=apl inline><</syntaxhighlight> Enclose/Box See Relational
<source lang=apl inline>⊃</syntaxhighlight> Conditional Enclose ∞ ∞ Link
<source lang=apl inline>></syntaxhighlight> 0 Disclose/Open See Relational
<source lang=apl inline>,</syntaxhighlight> Ravel ∞ ∞ Catenate
<source lang=apl inline>⍪</syntaxhighlight> Table ∞ ∞ Catenate-Down
<source lang=apl inline>⌽</syntaxhighlight> 1 Reverse 0 1 Rotate
<source lang=apl inline>⊖</syntaxhighlight> Reverse-Down ∞ ∞ Rotate-Down
<source lang=apl inline>⍉</syntaxhighlight> Monadic Transpose 0 ∞ Dyadic Transpose

Miscellaneous

Glyph Rank Monadic Ranks Dyadic
<source lang=apl inline>⊣</syntaxhighlight> Stop ∞ ∞ Left
<source lang=apl inline>⊢</syntaxhighlight> Pass ∞ ∞ Right
<source lang=apl inline>≠</syntaxhighlight> Nubsieve See Relational
<source lang=apl inline>↑</syntaxhighlight> Nub See Structural
<source lang=apl inline>=</syntaxhighlight> Nubin See Relational
<source lang=apl inline>~</syntaxhighlight> See Scalar ∞ ∞ Less
<source lang=apl inline>@</syntaxhighlight> 1 All See Indexing
<source lang=apl inline>⍕</syntaxhighlight> Monadic Format * ∞ Dyadic Format
<source lang=apl inline>⍎</syntaxhighlight> * Execute

Primitive Operators

Glyph Operands Ranks Monadic Call Dyadic Call
<source lang=apl inline>/</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Reduce
<source lang=apl inline>⌿</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Reduce-down
<source lang=apl inline>\</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Scan
<source lang=apl inline>⍀</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Scan-down
<source lang=apl inline>/</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Copy/Compress
<source lang=apl inline>⌿</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Copy-down/Compress-down
<source lang=apl inline>\</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Expand
<source lang=apl inline>⍀</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> Expand-down
<source lang=apl inline>⊂</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> <source lang=apl inline>rf lf</syntaxhighlight> Swap
<source lang=apl inline>&</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>∞</syntaxhighlight> <source lang=apl inline>∞ ∞</syntaxhighlight> Select
<source lang=apl inline>⍤</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>mg</syntaxhighlight> <source lang=apl inline>mg mg</syntaxhighlight> On (close Over)
<source lang=apl inline>⍤</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>n</syntaxhighlight> <source lang=apl inline>n</syntaxhighlight> <source lang=apl inline>n n</syntaxhighlight> Rank
<source lang=apl inline>⍤</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>mg</syntaxhighlight> <source lang=apl inline>mg mg</syntaxhighlight> Cut
<source lang=apl inline>⍥</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>mg</syntaxhighlight> <source lang=apl inline>mg mg</syntaxhighlight> Upon (close Atop)
<source lang=apl inline>¨</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>mg</syntaxhighlight> <source lang=apl inline>mg mg</syntaxhighlight> Under
<source lang=apl inline>¨</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>mg</syntaxhighlight> With (Bind)
<source lang=apl inline>¨</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>n</syntaxhighlight> <source lang=apl inline>mf</syntaxhighlight>
<source lang=apl inline>.</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>2</syntaxhighlight> <source lang=apl inline>∞ ∞</syntaxhighlight> Alternant Inner-product
<source lang=apl inline>.</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>g</syntaxhighlight> <source lang=apl inline>∞ ∞</syntaxhighlight> Tie, Outer-product
<source lang=apl inline>.</syntaxhighlight> <source lang=apl inline>f</syntaxhighlight> <source lang=apl inline>m</syntaxhighlight> <source lang=apl inline>mf</syntaxhighlight> Ply

Implementation

Numeric types

SHARP originally supported only real numbers using double (8-byte) precision. Numbers were stored in one of three types:

  • Boolean, with one bit per value
  • Integer, with four bytes per value
  • Floating, with eight bytes per value

SATN-40 describes the addition of complex numbers to SHARP APL.

SHARP APL Technical Notes

Features of SHARP APL were documented in "technical notes" issued by IPSA. These notes are numbered following the scheme "SATN-0". Earlier notes typically had no author listed. A pdf collection of SHARP APL Technical Notes is hosted at jsoftware.com, as are html transcriptions of some notes, linked in the table below.

Number Issued Revised Author Title
0 1976-01-01 SATN Introduction
1 1976-01-01 TASKID
2 5 1979-02-14 Control Messages
3 1976-01-01 ⎕OUT
4 2 1978-04-01 N-tasks and B-tasks
5 2 1978-08-01 Batch APL
6 1976-01-01 Execute
7 1976-01-01 Latent Expression
8 2 1978-03-01 HSPRINT
9 1 1979-08-01 John D. Burger Usage Inquiry System
10 2 1978-06-01 SORTREQ
11 1976-01-01 )RESET
12 1976-01-01 )COPY
13 1978-03-10 Early Warnings
14 2 1978-08-15 Package - A New Variable Type
15 Index
16 1976-04-20 File System Must-Write Buffers
17 1976-06-01 Formatting Primitive
18 1976-07-01 ⎕FMT
19 1977-01-01 Fileprint
20 4 1978-06-01 System Variables, Session Variables and System Functions
21 1 1978-06-01 ⎕WS and ⎕FD
22 2 1979-01-01 Bob Bernecky and Mike Symes APL Worspace Transfer
23 1977-06-10 1 1978-07-15 Bob Bernecky Comparison Tolerance (web)
24 1977-03-23 Symbol Table
25 1977-05-15 Extensions to Argument Passing
26 1977-09-10 Enhancements to the File System
28 1977-07-11 Terminal Control
29 1978-06-15 System Time and Timestamps
30 1979-01-01 Numeric Display
31 1979-02-01 Line Editing in SHARP APL
32 1979-03-30 Shared Variables
33 1979-03-26 Event Trapping
34 1980-08-15 Bob Bernecky Replication
35 1980-08-15 Peter Wooster Extended Upgrade and Downgrade
36 1980-04-20 Ken Iverson Direct Definition
37 1 1982-06-01 John D. Burger IBM 3270 User Guide
39 1981-06-01 Richard Lathwell The SHARP APL S-task Interface
40 1981-06-20 Eugene McDonnell Complex Numbers (web)
41 1981-06-20 Ken Iverson Composition and Enclosure (web)
42 1982-04-01 Ken Iverson Determinant-Like Functions Produced by the Dot-Operator (web)
43 1982-11-05 Peter Wooster Improved Display for Enclosed Arrays and a New System Variable ⎕PS
44 1983-04-02 Robert C. Metzger Enhancements to Event Handling
45 1983-05-02 Various Language Extensions of May 1983
46 1983-08-05 Eric Iverson Enhancements Provided in Update #1 to the May 1983 Release of SHARP APL
47 1983-10-01 Mike Symes IBM 3270 User Guide (IDSH)
48 1983-11-30 John D. Burger Workspace 1 HCPRINT


APL dialects [edit]
Maintained APL+WinAPL2APL64APL\ivApletteAprilCo-dfnsDyalog APLDyalog APL Visiondzaima/APLGNU APLKapNARS2000PometoTinyAPL
Historical A Programming LanguageA+ (A) ∙ APL#APL2CAPL\360APL/700APL\1130APL\3000APL.68000APL*PLUSAPL.jlAPL.SVAPLXExtended Dyalog APLIverson notationIVSYS/7090NARSngn/aplopenAPLOperators and FunctionsPATRowanSAXSHARP APLRationalized APLVisualAPL (APLNext) ∙ VS APLYork APL
Derivatives AHPLBQNCoSyELIGleeIIvyJJellyK (Goal, Klong, Q) ∙ KamilaLispLang5LilNialRADUiua
Overviews Comparison of APL dialectsTimeline of array languagesTimeline of influential array languagesFamily tree of array languages