More thinking. Less code.
Approach problems like never before
Dyalog APL is an array-oriented programming language that lets you express complex ideas in remarkably little code.
We build it, support it, and have done for over 40 years.
Dyalog APL is an array-oriented programming language that lets you express complex ideas in remarkably little code.
We build it, support it, and have done for over 40 years.
Full commercial support · Source code escrow · Windows · Linux · macOS · Raspberry Pi
Explore Dyalog
Try Dyalog free for educational and non-commercial use, get started or view the docs.
Trusted for over 40 years
Dyalog is used by organisations worldwide to build and run important business systems.
And yes, we know it’s a bit unfair to the competition.
Less code you say?
APL works on whole arrays at once, so tasks that need loops and bookkeeping in most languages collapse into a single expression. And less code isn’t just tidier: it is less to read, less to maintain, and less to get wrong. Compare it for yourself below, across three everyday problems and six mainstream languages.
gives
Think you can improve on this?
Submission rules
The examples shown here are intended to be clear, sensible implementations rather than deliberately code-golfed solutions. If you can make one shorter, clearer, more idiomatic, or otherwise better, submit your version for review.
If accepted, your solution may replace the current example and your name will be shown alongside it.
Your submission must
- Solve the same problem as the existing example.
- Accept the same kind of variable input rather than being hard-coded for the example values shown.
- Produce the correct result for valid inputs.
- Preserve the behaviour and input/output requirements of the existing example.
- Be valid, runnable code in the selected language rather than pseudocode.
- Not contain a pre-generated or hard-coded answer.
- Not use external libraries, packages, services, or APIs to perform the task.
- Not use a built-in function that directly solves the whole problem.
Standard-library features are allowed. For example, using normal collection types, loops, ranges, sums, iterators, and other general-purpose language features is fine.
What counts as an improvement?
Fewer lines or characters can make a solution interesting, but this is not purely a code-golf competition. We will also consider:
- clarity;
- readability;
- idiomatic use of the language;
- elegance;
- and whether the submission offers a genuinely better approach.
The shortest submission will not automatically replace the current example. Dyalog will review submissions and decide which version is most appropriate to display.
Counting code
The line and character counts refer only to the code displayed in the comparison. Standard-library imports, #include directives, and unrelated class or program boilerplate are omitted and are not included in the count.
Whitespace used to format the displayed solution may be included in the character count, so the figures should be treated as a useful comparison rather than an absolute measure of which language is most concise.
Try some APL in your browser
A live Dyalog APL interpreter, running right on the page. Type an expression and press Enter to run it, or pick one of the examples to watch it execute. The glyph bar enters the APL symbols for you, so no special keyboard is needed. Because APL works on whole arrays at once, a few characters can do the work of many lines.
Enter runs the line. Click an earlier input line to bring it back and edit it. Names persist until you clear. Type APL glyphs with the keyboard above,
or with a backtick prefix (for example `i gives ⍳).
Ready for something more advanced? Put these ideas to work on the short, self-contained puzzles at APL Quest.
Apprehensive? Understandable.
Getting Started
Your first steps with Dyalog made easy, from installing and typing APL to writing code that does real work.
Documentation
Guides, references, and worked examples to support you at every level, from your first session to advanced production use.
Dyalog for Business
Expert training, consultancy, and migration support, with licensing designed around your success rather than seat counts.
About Us
We’re 31 people who believe the tool we make can be useful to the world. Only a couple of us are related, but we feel like a family.
News, ideas, technical insights, and stories from the Dyalog community.
We promote a culture where innovation, fun, pride, and acceptance is part of our daily life. We come from a variety of backgrounds, and our diversity enhances our creativity.
We promote a culture where innovation, fun, pride, and acceptance is part of our daily life. We come from a variety of backgrounds, and our diversity enhances our creativity.
…or perhaps even join the team!
Ready to write less code?
Download Dyalog free for non-commercial use, or talk to us about putting it to work on your problem.