in design: for reasons of efficiency early programming languages reflected the characteristics of the early computers, and each generation of computers reflects the needs of the programming languages of the preceding generation.”
of operations is implicit • Operates on arrays of data (whole conceptual units), not pointers/ references to single words • Implicitly parallelizable • Equivalence and correctness can be demonstrated algebraically
programming language • Using only ASCII characters • Function-Level programming using a tacit, point-free, style • inspired by FP and FFP • High performance general purpose programming language
of function-level programming • Teach you enough about J to understand the semantics, if not the language (who learns an entire language in 40 minutes anyway?) • Set the tone for Lambda Lounge. ;)
block 10*7+0.2 NB. code (note the indentation) 72 NB. result #'I will use purple to call things out' 36 + y is the conjugate of y . For example, +3j4 is 3j_4 . This is code documentation:
atoms is a table. The dyad $ known as "shape" can create tables. the monad i. is "integers" and takes n arguments, where n the number of axes i.3 4 0 1 2 3 4 5 6 7 8 9 10 11 2 3 $ 7 7 7 7 7 7 7 2 2 $ 7 8 6 5 7 8 6 5
a noun, where shape is a list of the counts of atoms in each of its axes $ i.3 4 3 4 NB. rank 2 $ 0 50 10 3 NB. rank 1 $ 5 NB. rank 0 The number of axes is the noun's rank
consisting of cells, each part of the array, e.g., sub-arrays, that, when placed in a frame make up the entire array 2 3 $ i. 6 0 1 2 3 4 5 This array can be thought of as having 6 cells, where each is an atom. The frame therefore has the shape 2 3
2 3 4 5 It can also be thought of as having 2 cells, where each is a list, i.e., 0 1 2 and 3 4 5 The frame would then have a shape of 2, and each cell a shape of 3. It could also be thought of as an array of 1 cell, where the cell is a table. The frame shape would be empty
2 3 can be thought of as: • a 2 3 frame of cells that are atoms • a 2 frame of cells that are lists of shape 3 • an empty frame of a cell that is a table of shape 2 3 • The frame is a prefix of the shape of the array • The cell shape is the array shape with the frame prefix removed. • The length of the cell shape is the cell rank • The cells of an array are the subarrays that, when assembled into the corresponding frame, create the entire array
5 6 7 8 9 10 11 12 + will treat its left argument as a collection of cells of rank 0 in a 3 4 frame and its right argument as a cell of rank 0 (and an empty frame)
verb and rank of the left argument determine the frame of the left argument. Same goes for the right. • If the frames of the left and right arguments match or if one is a prefix of the other then they are compatible.
3 54 55 56 57 18 19 20 21 Left argument treated as having a frame of 3 4 and right argument as having a frame of 3. 3 is a prefix of 3 4 0 1 2 3 + 0 4 5 6 7 + 50 8 9 10 11 + 10
be applied to nouns or verbs (whereas verbs only take nouns) • Typically has a verb as a result (a derived verb) • Derived at a higher precedence than regular verb application