Golfing APL/K in 90 Lines of Python

https://news.ycombinator.com/rss Hits: 9
Summary

Egyptian hieroglyphs, an early visual notationIn my previous post on Homoiconic Python, I explored McCarthy’s Lisp, a language where code and data are the same thing. But there’s another path to expressive power, one that emerged in parallel.At the 1956 Dartmouth conference, John McCarthy encountered Newell and Simon’s list-processing language IPL. He liked the idea of lists but hated the language itself, so he spent the next two years building Lisp at MIT. That same year, Kenneth Iverson was teaching mathematics at Harvard and growing frustrated with the inadequacy of conventional notation for expressing algorithms. He began inventing his own, publishing it in 1962 as A Programming Language, the book that gave APL its name.APL looked like nothing else. Iverson designed a new alphabet, like Egyptian hieroglyphics, each symbol a complete idea:APL is very expressive. Here is the complete implementation of Conway's Game of Life in APL: life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵}And just like Lisp, APL had one data structure: the array. Lisp had the list.This shared minimalism is the first hint of a deeper, ancestral bond.Lisp was born at MIT; APL at Harvard. Lisp processes lists; APL processes matrices. Lisp inherits from Church’s lambda calculus; APL from Curry’s combinators. Lisp was designed for machines to do symbolic reasoning; APL was designed for humans to communicate mathematical ideas. One prioritizes semantic elegance, the other syntactic density.APL and LISP are very similar languages—both manipulate a complex data structure and the functional structure of the languages has been ideally chosen for convenient manipulation of these structures. Proposals have been made to combine them by embedding one within the other.In 1979, Alan Perlis (the first recipient of the Turing Award) chaired a panel asking: ”APL and LISP—should they be combined, and if so how?” The panel debated embedding one within the other, or generalizing both into something superior....

First seen: 2026-01-21 23:41

Last seen: 2026-01-22 07:42