https://tryapl.org File Intro Learn Primer Links Help Got a minute? -- Try APL! 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 x/[?]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! Interactive lessons We use the Jupyter Notebook format to provide interactive lessons. Limitations apply. For full functionality, download Dyalog APL for free. [ ] Load failed! Basics Using the TryAPL Tutorials APL Expressions Arrays Functions Closer Looks Arithmetic Functions: + - x / * [?] [?] [?] | Grading and Sorting: [?] [?] Modifying Rank and Depth: | | [?] [?] Random Numbers: ? Boolean Functions and Boolean Algebra: [?] [?] [?] [?] etc. Comparison Functions: < <= = >= > [?] Reduce and Scan: / \ Further Explorations Conway's Game of Life Lookup Without Replacement Sudoku Solver Viewing lesson: Cheat Sheet Primitives 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 [+] [-] [x] [/] [[?]] [[?]] [*] [!] [|] [[?]] [*] [[?]] [[?]] [[?]] [?] 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 Undoing Assignments )CLEAR clear workspace )ERASE name delete name(s) Settings [?]CT Comparison Tolerance [?]DIV Division Method [?]FR Floating-Point Representation [?]IO Index Origin [?]PP Print Precision [?]RL Random Link Definition [?]AT Attributes [?]CR Canonical Representation [?]FX Fix Definition [?]NR Nested Representation [?]VR Vector Representation Information [?]DR Data Representation [?]NC Name Class [?]NL Name List [?]SIZE Size of Object [?]TS Time Stamp Text Manipulation [?]C Case Convert [?]FMT Format [?]R Replace [?]S Search [?]VFI Verify & Fix Input Data Conversion [?]DR Data Representation [?]DT Date-time Convert [?]JSON JSON Convert [?]UCS Unicode Convert [?]XML XML Convert Other [?]A Alphabetic Characters [?]D Digits [?]DL Delay Useful links APL Wiki Most information is available on the APL Wiki, for example: * Learning resources * How to run APL * Online documentation Getting help Having trouble? You might find your question already answered on: * APLcart * Stack Overflow If that didn't do it, just get in touch with the welcoming community: * Chat in the APL Orchard, a very active chat room * Ask a question on Stack Overflow * Post on the Dyalog Forums * Ask on the r/apljk subreddit * Dyalog social media: Twitter, Facebook, LinkedIn Recommended videos There are lots of good APL videos out there, including these hand-picked masterpieces: * Conway's Game of Life in APL * Palindromic Expression for Phi in APL * A Sudoku Solver in APL * APL demonstration 1975 * Why APL Is Still Cool (at QCon 2011) * Design Patterns vs Anti pattern in APL (at FnConf17) * Pragmatic Functional Programming with Dyalog's CTO (Talks at Google, 2015) * Dyalog TV (webinars and user meetings) Help and About Primitives 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 `, SS, deg, 2, u, o, 1/2 or u, 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 is 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 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 Function and Operator definitions must be single-line and either tacit or dfns. 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 Adam Brudzewsky Inspiration Joel Hough Ideas John Scholes, Andy Shiers, Roger Hui, John Daintree Domain Shaun Gilchrist APL web service Jarvis APL whitelist Safe Execute Split panes Split.js Text font Nunito Markdown Marked.js Formulas MathJax Sharing code 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: [ ] Save workspace using local storage 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: Download... You can upload a .tryapl workspace from your computer or load it from a URL: Upload... [ ] Load failed! [ ] [ ] [ ] x WARNING Loading another workspace will overwrite your current workspace. Use the Download... button to save your workspace now. Download... Load Cancel