Depth-first search in APL
Dyalog2 HN recommenders · recommended in 3 months, 2019-2021
11K views · 12 years ago · tutorial · evergreen
John Scholes builds a depth-first tree-search operator step by step in a Dyalog APL session. It covers higher-order functions and runs the search on the N-Queens problem.
HN commenters call it a beautiful, brilliant demonstration of APL's expressiveness and a model of clear narration.
9:43A Sudoku Solver in APL
Dyalog
47K views • 14 years ago
59:03Breaking Down Programming Paradigms: APL's Surprising Learning Curve // Aaron Hsu // Dyalog '17
Dyalog User Meetings
7K views • 9 years ago
30:37High-performance Tree Wrangling, the APL Way // Aaron Hsu // Dyalog '18
Dyalog User Meetings
6K views • 7 years ago
7:48Conway's Game Of Life in APL
Dyalog
236K views • 17 years ago
1:30:45The Simple Essence of Automatic Differentiation - Conal Elliott
Microsoft Research
17K views • 8 years ago
1:54:46Lenses, Folds, and Traversals
Edward Kmett
54K views • 13 years ago
1:19:57Simon Peyton Jones: Data Parallel Haskell
nuACM
28K views • 16 years ago
1:31:06William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]
PapersWeLove
367K views • 9 years ago
1:04:16Simon Peyton-Jones: Escape from the ivory tower: the Haskell journey
Churchill College, University of Cambridge
170K views • 9 years ago
1:12:56Lecture 1A: Overview and Introduction to Lisp
MIT OpenCourseWare
420K views • 7 years ago
1:02:15Lambda Calculus - Fundamentals of Lambda Calculus & Functional Programming in JavaScript
Fullstack Academy
227K views • 9 years ago
1:04:45Stanford Seminar - Concatenative Programming: From Ivory to Metal
Stanford Online
14K views • 8 years ago
1:03:34Simon Peyton Jones - Linear Haskell: practical linearity in a higher-order polymorphic language
Curry On!
19K views • 8 years ago
12:56Stephen Wolfram's Introduction to the Wolfram Language
Wolfram
924K views • 12 years ago
1:00:58The Next Five Years of ClojureScript - David Nolen
Metosin
19K views • 10 years ago
1:05:51The Functional Programmer's Toolkit - Scott Wlaschin
NDC Conferences
79K views • 7 years ago
40:20"Shen: A Sufficiently Advanced Lisp" by Aditya Siram
Strange Loop Conference
26K views • 12 years ago
40:31Understanding Specter: Clojure's missing piece
Misophistful
12K views • 9 years ago
1:07:10Brian Beckman: Don't fear the Monad
jasonofthel33t
415K views • 13 years ago
1:13:10Parsing with Derivatives
Stanford
13K views • 15 years ago
5 comments from Hacker News
You might like looking at how Dyalog handles higher-order functions; John Scholes really put this beautiful presentation together about using them as a depth-first search reusable function ▶ this video and if you haven't seen it, you should!
If you have cycles in your graph, you can build a tree out of a vector of indices, or as a table of parent/child node keys. The former is what John Scholes does[1], and the latter has plenty of common SQL examples. [1]: ▶ this video If you have a non-cyclic tree (e.g. a 256-trie) you can nest it directly: @/ will traverse to nodes, and COW keeps updates from trashing memory too much. However trees are rarely the best data structure: Binary search on a sorted list can beat b-trees simply because the end of the search will already be in cache, so for a routing table of IP address ranges, I use something like: ipStart where ipStart bin x
That 1975 APL demonstration is lovely. Much has been preserved in Dyalog and GNU APL - it's very interesting to see how timeless the core APL functions are. I'm very fond of a number of videos by the late John Scholes narrating APL solutions step by step, including the well-known demonstration of Conway's Game of Life in APL (0). His videos on depth-first search (1) and solving sudoku (2) are also brilliant. (0) link (1) ▶ this video (2) link
APL is great. If you haven't seen them, the late John Scholes did a number of absolutely beautiful demonstrations programming in APL[1], [2], [3]. [1]: ▶ this video [2]: link [3]: link
> Note also that you're being unfair to Python. List comprehensions, array index notation, and numpy methods cover pretty much everything you've mentioned in apl. All of that to cover ~ten symbols. Is it unfair to Python to point out that this is a huge difference in complexity that someone needs to learn to be able to do those things from scratch? > Which brings me back to what I said before: if I want a powerful array manipulation dsl, I still have it, but I'm not limited by it. Which is fine. It's just that the few operations of array manipulation DSL go so much farther than I expected they would. I do know that APL is not going to be the language to implement WireShark or Halo vNext. The big catch in paragraph two is "if my objects support that"; yes you would have to do something more complex in APL. But not /much/ more complex. In Python you'd need to understand classes and magic methods and overloading before you could write that overloaded addition - and understand CPython internals, C and NumPy to add it to NumPy objects, I imagine. I doubt you can do that all in APL, but then again if I'm correctly reading what l2 norm addition is, Pythagorean square-root-of-sum-of-squares including complex numbers, it's not a lot of code to write that anyway: values ← 4J3 ¯2J8 10 20 abs ← |values squared ← abs * 2 sum ← +/squared sqrt ← squared * 0.5 or without the temporary variables which don't add much clarity: ( +/ (|values) * 2 ) * 0.5 ⍨ is a cool operator which lets you swap