Dyalog '26 starts on 12 Oct - Visit the event website
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.
No install needed. Try APL in your browser.
Explore Dyalog
Try Dyalog for free for educational and non-commercial use, browse the documentation, and explore our products.
Stay in the loop. Follow Dyalog wherever you spend your time online for news, updates, and a bit of APL inspiration
Trusted for over 40 years
Dyalog is used by organisations worldwide to build and run important business systems.
Niels Hallenberg, SimCorp
Niels Hallenberg, SimCorp
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.
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’re a small team spread across half a dozen countries, united by a shared belief that powerful software doesn’t have to be complicated. A lot of us have been here for years, some for decades, because there’s still no shortage of interesting problems to solve.
…or perhaps even join the team!
News, ideas, technical insights, and stories from the Dyalog community.
Case Studies
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.
List every prime number up to 50.
gives
Dyalog is used by organisations worldwide to build and run important business systems.
Ready to write less code?
Download Dyalog free for non-commercial use, or talk to us about putting it to work on your problem.