NOTE: This page is awaiting content review and has not been designed.
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.
Average (Mean):
(+⌿÷≢)3 1 4 1 5
2.8 Windowed moving average (window size: 2):
2(+⌿÷⊣)3 1 4 1 5
2 2.5 2.5 3 Weighted average:
weights ← 1 3 5 4 2
values ← 3 1 4 1 5
weights (+.×÷+/⍤⊣) values
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 (the letters a, e, i, o, and u)?
'aesthetic'∊'aeiou'
1 1 0 0 0 1 0 1 0 Remove vowels (that is, select elements of text that are not members of the list of vowels):
text←'this text is made of characters'
text⌿⍨~text∊'aeiou'
ths txt s md f chrctrs Remove interior vowels (that is, select elements that are not both vowels and in the middle of a group of three non-spaces?):
text←'can you read this?'
text⌿⍨(0,0,⍨3∧/' '≠text)⍲text∊'aeiou'
cn yu rd ths? Make vowels uppercase (that is, map from a list of lowercase vowels followed by the text itself, to a similar list which begins with the list of 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 (in this case, 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 each set of three consecutive elements 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 less-than-reduction for windows of length 2 detects windows where the first element is 0 and the second element is 1, thus locating 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 the uppercase function (1⎕C) to locations where a letter follows a blank:
1⎕C@(1,2</' '∘≠)'title case text'
Title Case Text Simple
Primitive functions and operators are represented by symbols that mnemonically suggest their meanings. For example:
≢'apples'
6
3↑'apples'
app
3↓'apples'
les
⌽'reverse'
esrever
3⌽'rotate'
aterot
⌈3.141
4
3⌈5
5 Dyalog APL
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 (⍣)
- Fast aggregation using the key operator (⌸)
- System functions for easy data import and export such as ⎕CSV, ⎕NGET, and ⎕NPUT
- Dfns, that is, lambda-style functions for functional programming
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
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“.