DYNA26: 27 April 2026. More info

APL Language

APL began as a notation invented by Kenneth E. Iverson, a professor at Harvard University, to teach courses on automatic data processing – a precursor to modern computer science.

It was later implemented as a programming language, initially by IBM and then many others and has evolved over the years. Dyalog APL includes many modern conveniences which anybody learning computer programming these days will be familiar with, such as if-else and for-while control structures, object-oriented features such as classes and namespaces, and anonymous lambda functions.

Its concise syntax and focus on collections of data (arrays) makes it very powerful. Instead of breaking problems down into tiny steps, APL encourages you to think in terms of working on entire data structures at once, so you can express complex algorithms in remarkably few lines of code. Many programmers find that once they embrace APL thinking, they discover solutions that would be cumbersome in traditional languages.

Concise

Simple syntax and symbols used to represent common operations on data allow users to write and adapt short and elegant expressions for all kinds of purposes.

Mean average

      (+⌿÷≢)3 1 4 1 5
2.8

Windowed moving average

      2(+⌿÷⊣)3 1 4 1 5
2 2.5 2.5 3

Weighted average

      1 3 5 4 2(+.×÷+/⍤⊣)3 1 4 1 5
2.666666667

Performant

Often completely branchless, APL expressions present a high degree of mechanical sympathy ideally suited to SIMD processing. APL can offer high programmer efficiency, as well as all-out execution speed by leveraging modern processors  with dedicated vector-oriented instructions.

Which are vowels?

      'aesthetic'∊'aeiou' 
1 1 0 0 0 1 0 1 0

Remove vowels

      text←'this text is made of characters'
      text⌿⍨~text∊'aeiou'
ths txt s md f chrctrs

Remove interior vowels

      text←'can you read this?'
      text⌿⍨(0,0,⍨3∧/' '≠text)⍲text∊'aeiou'
cn yu rd ths?

Uppercase vowels

      text←'uppercase vowels'
      ('AEIOU',text)[('aeiou',text)⍳text]
UppErcAsE vOwEls

Expressive

Common patterns in APL can be applied in many use cases. Conversely, there are often many ways to tackle the same problem. The small code size makes for a low cost to trying several approaches and seeing what works best for your particular application.

A windowed plus-reduction gives the sum of each set of three consecutive numbers.

      3+/3 1 4 1 5 9 2 6 5 3 5
8 6 10 15 16 17 13 14 13

A windowed catenate-reduction returns the groupings as a list of lists.

      3,/3 1 4 1 5 9 2 6 5 3 5
┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
│3 1 4│1 4 1│4 1 5│1 5 9│5 9 2│9 2 6│2 6 5│6 5 3│5 3 5│
└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

A windowed less-than-reduction keeps the first 1 in each consecutive group of 1s in a Boolean array.

      1,2</' '≠'mark the start of each word'
1 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0
The @ (At) operator applies a function as specified locations.
      1⎕C@(1,2</' '∘≠)'title case text'
Title Case Text

Simple

Primitive functions and operators are represented by symbols that mnemonically suggest their meanings.

      ≢'apples'
6
      3↑'apples'
app
      3↓'apples'
les
      ⌽'reverse'
esrever
      3⌽'rotate'
aterot
      ⌈3.141
4
      3⌈5
5

Dyalog APL

Dyalog is a modern, batteries-included implementation of APL. The Dyalog interpreter has been tuned for high performance in common use cases.
 
The interpreter comes with a wide range of features to facilitate effective application development, and allows you to mix-and-match different programming paradigms to tackle different problems and express ideas naturally at different levels of your application. While a compiler or financial calculator might benefit from a linear data-flow pipeline, a business application can utilise structured programming techniques, with core computations leveraging the high-performance, mathematically-oriented primitive functions and operators.
 
Dyalog is well suited to exploration of data and algorithms. Its carefully chosen set of primitive functions and operators, together with system functions, can be combined to solve a wide range of problems across a variety of domains. It is particularly appropriate for data cleaning, preparation and format conversion in custom, bespoke, irregular or unusual data sources. Dyalog’s concise, expressive syntax makes it well-suited for involving subject matter experts in code development and review, and its flexibility is valuable when algorithms are still evolving or data structures are large, irregular, or multi-dimensional.
 
Tools are available at both the built-in language level and as importable utilities to help with all kinds of tasks from reading and writing data from external data sources such as files, databases and the internet as well as converting between data formats and interfacing with non-APL systems.

Language Extensions

Dyalog APL continues to evolve, from introducing primitive functions and operators to  system functions and general programming constructs, developed carefully over decades of experience together with our users. Dyalog-specific features include:

  • Sort any array with Total Array Ordering
  • Object-oriented features such as namespaces and classes
  • New and extended primitive functions such as Where and Interval-index (), Index-of ()
  • Operators for common usage patterns including the Power operator () and Key ()
  • System functions for easy data import and export such as ⎕CSV, ⎕NGET and ⎕NPUT
  • Dfns, lambda-style functions for functional programming

Learn more about Dyalog-specific features

Connectivity and Integration

Dyalog-based software can be deployed as scripts, graphical desktop applications, web applications and services hosted in the cloud, or integrated as part of an existing technology stack.

  • Provide and consume web services
  • Read, write and manage SQL databases
  • Create compiled libraries (.dll, .so, .dylib), and use those written in C or other languages
  • Use and create .NET assemblies to interoperate with C# and other .NET languages
  • Talk to live-running Python and R systems
  • Interface directly with Microsoft Excel and other Office products for automation

See our catalogue of tools and interfaces

Data-parallel and Asynchronous Programming

APL’s array-oriented primitive functions and operators are inherently data-parallel, and take advantage of SIMD optimisations on compatible hardware.

Dyalog also provides constructs for asynchronous programming with the Spawn operator (&) for green threads, and Isolates or .NET Tasks to utilise multiple processes.

CALL TO ACTION HERE

Something like “Get Started Now” or “Learn Dyalog APL“.

I am using the Products Master Page. You don’t need to tell Mike about this message, he knows!

Get Support

Technical advice and assistance on all aspects of Dyalog usage is available by e-mail (support@dyalog.com) and/or telephone (+44 1256 830030 – limited to U.K. office hours). Limited advice on design and coding is available, but is not intended to replace the use of the printed and on-line documentation. Except when reporting an issue with the software, users are encouraged to seek advice from the user community via the Dyalog Forum (reading the content of the forums does not require membership).

Search our website...
Dyalog Ltd