APL is an array-oriented programming language that will change the way you think about problems and data. With a powerful, concise syntax, it lets you develop shorter programs that enable you to think more about the problem you're trying to solve than how to express it to a computer.
TryAPL runs on Dyalog, which you can download for free, or try it now by entering an expression (use the language bar above to type the special APL symbols), or clicking one of these expressions, followed by Enter, to see it in action:
2 + 2
No points for guessing this
4 2 3 + 8 5 7
Functions apply to arrays
⍳10
Generate the first ten integers
+/⍳100000
Sum the first 100 000 integers
×/⍳10
A long, slow way to write !10
Avg←{(+⌿⍵)÷≢⍵}
Average is the sum divided by the count
Avg 1 6 3 4
… and apply it
throws←?10000⍴6
Store 10 000 dice throws
+/1=throws
Of 10 000 throws, how many 1s?
+/(⍳6)∘.=throws
Frequency of all 6 possibilities
'Hello, World!'
Not just about maths!
{⍺,≢⍵}⌸'Mississippi'
See?
What can APL do for you?
Are you a Problem Solver (a domain or subject matter expert with problems to solve) or a Programmer (someone who translates those solutions into a computer-executable format)? Problem Solvers benefit from APL's ability to concisely express advanced concepts without getting bogged down with a lot of computerese syntax. Programmers benefit from APL's productivity and brevity. Shorter programs means quicker development time and less code to maintain and debug.
In either case, concepts that take several lines of code in other languages can often be reduced to a few characters in APL. You'll quickly find that APL's symbols are organized in a logical, mnemonic manner that makes it easy to express advanced concepts clearly and concisely, and makes it easy to learn too. Move to the Learn tab and get started or visit the Primer tab to explore on your own!!
Use the language bar above to insert glyphs. Click on a glyph below to print basic usage and how to type it. Enter ]help followed by a symbol for details; for example ]help +.
Mathematics
Logic and Comparison
Structural
Selection and Set Operations
Search and Ordering
Operators
Miscellaneous
Additional features
The below subset of Dyalog's functionality is also supported in TryAPL. Enter for example ]help ]display for details:
Listing
]Display ⍳2 3 fully visualise array's structure )VARS list variable names )FNS list function names )OPS list operator names
Use the language bar above to insert glyphs. Click on a glyph in the Primer tab to print basic usage and how to type it. Enter ]help followed by a symbol for details; for example ]help +.
Use the language bar above to insert glyphs. Hovering over a symbol in the language bar, or clicking on it in the Primer tab, will show:
The APL symbol.
The common names for the concepts that the symbol represents.
The symbol's Tab input method: Enter two symbols, then press Tab to combine them. For example, <-Tab yields the ← symbol.
The symbol's Prefix input method: Press any one of the prefix keys
`,
§,
°,
²,
µ,
º,
½ or
ù, and then the key according to the en-US keyboard diagram here.
More information on entering APL symbols using your keyboard can be found on the APL Wiki.
Shortcut keys
Enter
Execute current line
Shift+Escape
Clear current line
Ctrl+Shift+Backspace or Alt+Up
Previous input
Ctrl+Shift+Enter or Alt+Down
Next input
Access-key h
Open language help
Access-key z
Zoom right pane
Access-key l
Permalink in URL bar
Access-key b
Use black theme
Access-key w
Use white theme
You can navigate the tabs using the keyboard:
Access-key i
Open and focus on Intro tab
Tab
Focus on next tab
Shift+Tab
Focus on previous tab
Space
Select focused tab
While running a notebook:
Access-key s
Stop current
Access-key r
Restart current
Access-key p
Previous step
Access-key n
Next step
About TryAPL
TryAPL free open source software and consists of a JavaScript front-end sending requests to a state-less Jarvis back-end which uses Safe Execute for Dyalog APL under Docker. Dyalog APL runs under Linux, including Raspberry Pi, Microsoft Windows, and macOS.
The back-end is available for direct use too. This means that anyone can write a new front-end or otherwise avail themselves of the computation engine. The simple API is described on APL Wiki.
The Learn tab's lessons are Jupyter Notebooks documents and can be used locally. We welcome submissions of notebooks for inclusion in TryAPL, as well as reports of anomalies, suggestions, criticisms, and comments to tryapl@dyalog.com.
Limitations
TryAPL has limited support for multi-line input. Lines that form a block with the previous line must begin with a tab character (U+09) which is automatically inserted if a line or block is missing closing one or more braces (}). For tradfns, and multi-line control structures, continue the current block using Alt+Enter. Press Esc to leave multi-line input mode.
Output, whether using ⎕← (other than at the beginning of a statement), ⍞←, or implicit output, is not supported.
To protect the server, expressions are checked against a whitelist while ⍎, ⍕, ⍣, ⌶, and ⎕FX have limited functionality. All supported quad-names, system and user commands are listed on the Primer tab.
Space and time limits can be queried with ]State. Exceeding the maximum time for execution of an expression causes the execution to be cancelled and the workspace will remain as it was before the expression was entered.
When using TryAPL, your workspace is automatically saved to local storage in your web browser. No data is stored on our servers; it is only sent across the network when you execute code. Manage your data from the File tab.
Credits
Implementation
Brian Becker
Design
Brian McCormick
Additional tutorials
Will Robertson
Reimplementation
Richard Park
Redesign
Adám Brudzewsky
Inspiration
Joel Hough
Ideas
John Scholes, Andy Shiers, Roger Hui, John Daintree
Access-key l will generate a shareable link in the URL bar for the line of code indicated by your text cursor.
Workspace Data
By default, your workspace is not saved between page visits, unless you opt in:
If the tickbox above is checked, then your workspace is automatically saved in your browser. You can always save your workspace to disk manually ― see below. No data is ever stored on our servers; it is only sent across the network when you execute code.
Use ⎕NL-⍳9 to see which names are used in your workspace.
Use )CLEAR to remove all names from your workspace.
Use )ERASE name to remove name from your workspace.
If the URL contains the clear parameter (tryapl.org?clear) then you will have a clear workspace and changes will not be saved. Removing the clear parameter will restore the data, if it exists and the checkbox above is ticked.
You can download your workspace as a .tryapl file:
You can upload a .tryapl workspace from your computer or load it from a URL:
Load failed!
×
WARNING
Loading another workspace will overwrite your current workspace.
Use the Download… button to save your workspace now.