DYNA25: Spring Edition is taking place on 7 April in New York City. More info
Dyalog delivers a world-class APL development environment that allows both Subject Matter Experts and IT specialists to efficiently convert their ideas into software solutions
You can also stay up to date with Dyalog on these channels:
APL is an array-oriented programming language. Its natural, concise syntax lets you develop shorter programs while thinking more about the problem you’re trying to solve than how to express it to a computer.
APL uses its own character set rather than reserved words written out in English like most other languages, like C or Python. As a language, APL sits at a very high level of abstraction, making it well suited to concise formulations of algorithms.
We continually provid and improve tools and interfaces to integrate Dyalog with the latest technology stacks.
Take advantage of the .NET ecosystem, all without leaving APL
Combine Python packages with the expressive power of APL – from Python or from APL
Interface to SQL databases including Oracle, Access, MySQL and DB2
Deploy your apps quickly with our public Docker containers
In the following examples, we’ll explore the elegance and efficiency of APL through various snippets that will introduce you to its unique symbols, array-oriented approach, and how it simplifies complex operations.
Representing primitive concepts with symbols facilitates code with high semantic density.
Define a function to compute the mean average of a list of numbers.
The sum of the list (+⌿⍵)
divided by (÷)
the length of the list (≢⍵)
.
Average ← {(+⌿⍵) ÷ ≢⍵}
Average 3 1 4 1 5
2.8
In array-oriented programming, functions apply to collections of data of different shapes in similar ways.
Use the same function to compute the average of a list of numbers, or the average of columns in a matrix.
matrix ← 2 3⍴3 1 4 1 5 9
3 1 4
1 5 9
Average matrix
2 3 6.5
Each column in points is a random point in a unit quadrant.
Their distances from the origin are the square root (*0.5
) of the sum (+⌿
) of squares (*2
).
Points are inside the quarter circle if their distance to the origin is less than or equal to 1. (This gives 1 for true and 0 for false.)
The count of inside points is the sum (+⌿
) of this.
Pi is approximately 4 times the count of inside points to the total number of points.
Pi←{
points ← ?2 ⍵⍴0
distances ← (+⌿points*2)*0.5
inside ← distances≤1
count ← +⌿inside
4 × count ÷ ⍵
}
Pi 10000
3.1412
This 3-train, or fork, is equivalent to the function defined in example three.
Syntactic function composition rules mean we don’t have to repeat ourselves by mentioning the argument explicitly.
This implicit reference to arguments is called tacit (or point-free) programming.
Average ← +⌿ ÷ ≢
Average 3 1 4 1 5
2.8
The same 3-train pattern is used here to partition (⊆)
the right argument (⊢)
where it is not equal to the left argument (≠)
.
Of course, you don’t have to write your own CSV parser from scratch – Dyalog ships with many tools to simplify application development and system interaction.
Split ← ≠ ⊆ ⊢
','Split'comma,delimited,text'
┌─────┬─────────┬────┐
│comma│delimited│text│
└─────┴─────────┴────┘
Dyalog has been honed over the last four decades into a robust environment for creating concise, powerful, software solutions
APL directly manipulates arrays without loops or mapping.
Natural Representation: Most data collected from the real world fits naturally into a list, table or cube.
Interpreted APL is competitive with compiled code.
But still quick to Iterate: Arrays consume less memory and allow faster iteration than other structures.
As in mathematics, symbols remove ambiguity.
Timeless Solutions: Refactor code when your business requirement changes, not simply when technology changes.
A rich ecosystem of tools and interfaces.
Modern Convenience: APL remains modern and relevant through its enduring design.
Decades of history and experience.
We’ve Been Around the Block: Software engineers and subject matter experts, all happy to share.
Explore data in real time to construct solutions.
Flexible Solutions: Use the right tool to suit your needs, optimise your workflow effectively.
We promote a culture where innovation, fun, pride, and acceptance is part of our everyday life. We come from a variety of backgrounds, and we learn from each other’s diversity.
An extensive collection of videos cover all aspects of the language.
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).