Questions tagged [apl]

APL (named after the book A Programming Language) is an interactive array-oriented language. It is based on a mathematical notation developed by Kenneth E. Iverson. Do not use this tag for Alexa Presentation Language; use [alexa-presentation-language] instead.

Wiki

APL, short for A Programming Language, is an interactive array-oriented language and integrated development environment. It is an interpreted language with built-in array capabilities and outstanding debugging features that makes the language a perfect choice for the agile approach. APL is also the first functional programming language ever, and it is also considered as a tacit programming language.

Example

APL uses symbols, array comprehension, and implied Iverson brackets to make its code concise and enable thinking about it much like Mathematical formulas.

This example assigns the vector (list) value 4 5 6 7 to N:

N ← 4 5 6 7 

The code below then adds 4 to all elements of the vector (giving 8 9 10 11):

N + 4

Now we can get a Boolean mask indicating results of 10 or higher (giving 0 0 1 1):

10 ≤ N + 4

And sum that to find out how many sums fulfilled the criteria (giving 2):

+/ 10 ≤ N + 4

Tag usage

The tag should be used for programming related problems in implementing or using the APL programming language. Please avoid theoretical and conceptual questions on Stack Overflow. Other tags such as , or can also be used with tag . Make sure to specify which dialect you use, for example by using the tag.

Read more

341 questions
92
votes
7 answers

APL versus A versus J versus K?

The array-language landscape, while fascinating, is confusing to no end. Is there a reason to pick one of J or K or APL or A? None of these options seem to be open-sourced -- are there open sourced versions? I would love the expand my mind, but I…
fogus
  • 6,126
  • 5
  • 36
  • 42
23
votes
2 answers

Implementation of a function object "power" operator in Raku

In APL there is the power operator ⍣, which if applied to a function f superimposes the application of f. How to implement that operator in Raku? For example, with this definition of f: sub f(Int:D $i){ $i + 1 } the command say (f ⍣ 4)(10); should…
Anton Antonov
  • 726
  • 4
  • 11
15
votes
2 answers

Are there any open source projects written in APL?

I'm trying to learn APL (Kona), and I'm looking for example projects so I can get an understanding of how an experienced APL'er would organize his/her code. Any open source projects would be helpful but, non-financial or anything lacking heavy math…
jdeseno
  • 7,753
  • 1
  • 36
  • 34
15
votes
7 answers

Is there any open source implementation of APL?

I am aware of J & K; but neither are open source. I'm also aware of A+, but that seems outdated. Is there any decent open source implementation of APL? If so, where? If not, why?
anon
  • 41,035
  • 53
  • 197
  • 293
11
votes
4 answers

Where can I learn APL?

I want to learn APL (more specifically Dyalog APL), but I can't seem to find any good sources to learn from. The only source I could find was Dyalog's Documentation Downloads, but other than that, can anyone recommend a good source?
Ankit
  • 1,861
  • 18
  • 18
11
votes
5 answers

Which is the best (and free) APL interpreter?

I need an APL implementation to test some expressions, do your know which is the best interpreter for the language ? It would be great if it is free and it runs on Linux.
lurks
  • 2,576
  • 4
  • 30
  • 39
11
votes
2 answers

Change diff font in GitKraken

I program APL and have been considering switching from SourceTree to GitKraken. However, I have been unable to change the diff view font. As the font is pretty essential to APL, this is holding my move back. Is there a way to change font face (and…
Adám
  • 6,573
  • 20
  • 37
10
votes
7 answers

How to count the frequency of a element in APL or J without loops

Assume I have two lists, one is the text t, one is a list of characters c. I want to count how many times each character appears in the text. This can be done easily with the following APL code. +⌿t∘.=c However it is slow. It take the outer…
Chao Xu
  • 2,156
  • 2
  • 22
  • 31
10
votes
4 answers

Haskell's Monad vs. APL's Monad

In APL and Haskell, does the term monad mean two totally different things, or the same thing viewed from two different perspectives. I'm rather new to both languages and trying to make sense of the higher-level concepts.
Alex Shroyer
  • 3,499
  • 2
  • 28
  • 54
10
votes
6 answers

Conditional function in APL

Is there a symbol or well-known idiom for the conditional function, in any of the APL dialects? I'm sure I'm missing something, because it's such a basic language element. In other languages it's called conditional operator, but I will avoid that…
Tobia
  • 17,856
  • 6
  • 74
  • 93
9
votes
2 answers

K/APL style programming in C++?

I'm writing code in C++, but I really like K/APL's array-oriented style. Does anyone know of a good set of operator overloading tricks / macros / ... to allow some K/APL -style programming in C++? Thanks!
anon
  • 41,035
  • 53
  • 197
  • 293
8
votes
4 answers

Does development with scalaz require an Unicode/APL-like keyboard?

Can scalaz be used without a keyboard containing the appropriate Unicode characters or does every Unicode identifier also have an "ASCII" equivalent (and if yes, is there any guarantee that it stays that way)? Are there special keyboard layouts for…
soc
  • 27,983
  • 20
  • 111
  • 215
8
votes
2 answers

How is APL optimized to have great performance at array processing? What are some example tricks and optimizations it performs?

I am interested in how APL is so efficient at what it does, to the point of sometimes being benchmarked as outperforming C. So I'm curious, what are some of the optimizations done by the APL compiler to make the language so efficient?
8
votes
4 answers

How can I generate a "Social Golfer" matrix for worker seating arrangement?

EDIT: I am looking for an APL function, or MS Access VBA function, which takes as arguments the total number of employees, total number of dinning tables, and number of employees per dinning table for generating rotating seating assignments. This…
Joe R.
  • 2,032
  • 4
  • 36
  • 72
8
votes
2 answers

what language was cybersyn/cyberstride implemented in?

I am aware that it was implemented on the IBM 360 mainframe architecture but does anyone know what language(s) were used in particular? Supposedly the bulk of it was programmed and deployed in 3-4 months - that is a pretty rapid turn-around for any…
shaunxcode
  • 103
  • 6
1
2 3
22 23