Skip to content
0:00 / 0:00

#apl#depth-firstsearch#dyalogapl

Depth-first search in APL

Dyalog

1.4K subscribers • 3 videos on Hallway

YouTube
  • Recommended by 2 people: 2 on Hacker News.
  • Presented by John Scholes, Dyalog developer
  • Made by the vendor. The company whose product it covers made or sponsored it.

Advanced. Deep dive for people who know the field.

10K views12 years ago2 recommendations

Programming languagesComputer scienceAlgorithmsFunctional programming

John Scholes builds a depth-first tree-search operator step by step in Dyalog APL and applies it to the N-Queens problem.

Step-by-step development of a depth-first tree-search operator in an APL session. NB: The concepts in this little video are fairly concentrated; it may help to pause by hitting the SPACE BAR now and again. -------------------- GET STARTED Download the latest version of Dyalog: dyalog.com/downloads TAKE PART IN OUR APL COMPETITIONS THE APL CHALLENGE Learn APL and compete for one of three $100 prizes. Open to all experience levels. challenge.dyalog.com THE APL FORGE Got a problem to solve or a library to share? Use Dyalog APL to build something great — and win £2,500 + an expenses-paid trip to present at a Dyalog user meeting. forge.dyalog.com --------------------

Why it's here

2 people recommend this

What people say. Recommended as an elegant demonstration of using higher-order functions and array programming to implement tree search.

geocaron Hacker News • Recommends

On “Non-English-based programming languages”

APL is great. If you haven't seen them, the late John Scholes did a number of absolutely beautiful demonstrations programming in APL1, 2, 3. 1: link to this video 2: link 3: link

paliilapon Hacker News • Recommends

On “J can look like APL or English”

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) link to this video (2) link

geocaron Hacker News • Recommends

On “Show HN: KatLang – Language for Calculations”

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 link to this video and if you haven't seen it, you should!

jodrellblankon Hacker News • Mentions

On “A final proposal for Rust await syntax”

> 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…

geocaron Hacker News • Mentions

On “Bryan Cantrill interviews Arthur Whitney (2009)”

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 does1, and the latter has plenty of common SQL examples. 1: link to 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