News for hackers. Stuff that matters.
Re:Goal: embeddable array programming language with a byteco... by RodgerTheGreat on Monday February 05, 2024 @10:34AM (#39262218)
APL-family languages have a long history of using the symbol / as "over"; a reduction adverb. The composition +/ for taking a sum is mutually intelligible in APL, J, K, and Goal. It's only a comment, in this case, if it is preceded by whitespace.
Re:Goal: embeddable array programming language with a byteco... by nerdponx on Monday February 05, 2024 @10:59AM (#39262546)
Is that not a pun on the use of "/" for division, and how it's often expressed in spoken English? It might still be a weird sense of priorities, but an historical one rather than a new one.
Re:Goal: embeddable array programming language with a byteco... by abrudz on Tuesday February 06, 2024 @12:15AM (#39271038)
No, it stems from North American use of ÷ for division, which is then ASCIIfied to %.
Re:Goal: embeddable array programming language with a byteco... by nerdponx on Tuesday February 06, 2024 @08:41AM (#39274057)
I get that, but why is / "over"?
Re:Goal: embeddable array programming language with a byteco... by tosh on Tuesday February 06, 2024 @09:04AM (#39274261)

  +/1 2 3 4 5
meaning

  plus over 1 2 3 4 5
meaning

  the plus reduction of 1 2 3 4 5
meaning

  1+2+3+4+5
meaning

  15
"over" (/) is a higher order function that takes the function "+" and applies it to "1 2 3 4 5"

over can also be used with *

  */1 2 3 4 5
meaning

  the product reduction of 1 2 3 4 5
meaning

  120 
"/" as "over" comes from a mathematical notation by Ken Iverson: APL (A Programming Language) [0][1] which Ken names "reduction" (h/t mlochbaum)

> An operation (such as summation) which is applied to all components of a vector to produce a result of a simpler structure is called a reduction.

"/" is known as "insert" in J [2] and "over" in k dialects (like Goal)[3].

[0] https://en.wikipedia.org/wiki/APL_(programming_language)#Mat...

[1] https://www.softwarepreservation.org/projects/apl/Books/APRO...

[2] https://code.jsoftware.com/wiki/Vocabulary/slash

[3] https://k.miraheze.org/wiki/Primitives

Re:Goal: embeddable array programming language with a byteco... by tosh on Tuesday February 06, 2024 @12:01PM (#39276928)
also see

"/" as "over" in k reference (see Chapter 5)

http://www.nsl.com/k/k2/k295/kreflite.pdf

and "over" in the Q reference:

https://code.kx.com/q/ref/over/