William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC]
PapersWeLove11 HN recommenders · recommended in 12 months, 2017–2026
talk · intermediate · evergreen · 2017–2026 on HN
William Byrd presents at Papers We Love NYC on what he calls the most beautiful program ever written, a Lisp interpreter written in Lisp. He walks through the metacircular interpreter and related ideas, and demos relational programming and program synthesis n…
HN repeatedly recommends it as an amazing talk that derives the essence of Lisp and shows miniKanren-style program synthesis.
Up next
7 mo on HNDomain Modeling Made Functional - Scott Wlaschin
NDC Conferences
6 HN recommender · 2018–2024
3 mo on HNJames Baldwin vs William F Buckley: A legendary debate from 1965
Aeon Video
3 HN recommender · 2020–2023
6 mo on HNJancovici : Can we save energy, jobs and growth at the same time ? 08/01/2018
Jean-Marc Jancovici
6 HN recommender · 2019–2023
8 mo on HNVáclav Smil at Driva Climate Investment Meeting 2019
Nysnø Klimainvesteringer
3 HN recommender · 2019–2024
11 mo on HNTreating the Farm as an Ecosystem with Gabe Brown Part 1, The 5 Tenets of Soil Health
Living Web Farms
12 HN recommender · 2019–2025
3 mo on HNShould Google Go Nuclear? Clean, cheap, nuclear power (no, really)
GoogleTalksArchive
2 HN recommender · 2012–2019
1 mo on HNExponential growth and epidemics
3Blue1Brown
10 HN recommender · 2020–2020
7 mo on HNThe Future of Mathematics?
Microsoft Research
9 HN recommender · 2019–2025
18 mo on HNRuby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich
Confreaks
17 HN recommender · 2013–2026
14 mo on HNThe Soul of Erlang and Elixir • Sasa Juric • GOTO 2019
GOTO Conferences
16 HN recommender · 2019–2024
14 mo on HN"Simple Made Easy" - Rich Hickey (2011)
Strange Loop Conference
14 HN recommender · 2022–2026
13 mo on HN"Making Impossible States Impossible" by Richard Feldman
elm-conf
9 HN recommender · 2017–2026
12 comments from Hacker News
I can't recommend the talk Dr Byrd did on this enough: ▶ this video It's one of my favorite programs to play around with. I wrote about an Erlang implementation of this a short while back: link
One of my all time favorite YouTube videos is a lecture by William Byrd. I find myself still coming back to this video, it was so fascinating to me as an undergrad. ▶ this video
If you haven't watched it - check out William Byrd on "The Most Beautiful Program Ever Written" ▶ this video It's the above and deriving it. It is fascinating to think of it as the essence of a language in 13 lines.
(define eval-expr (lambda (expr env) (pmatch expr [`,x (guard (symbol? x)) (env x)] [`(lambda (,x) ,body) (lambda (arg) (eval-expr body (lambda (y) (if (eq? x y) arg (env y)))))] [`(,rator ,rand) ((eval-expr rator env) (eval-expr rand env))]))) There's an amazing talk about it: ▶ this video
It's easy to miss since it's a small link near the top of the post, but something that will help a lot in understanding this post is this video: The most beautiful program: ▶ this video It essentially gives you a quick 5-min overview of the lisp language, then shows you how to implement lisp in lisp with only a few lines of code. IMO, understanding lambda calculus is much easier for the uninitiated after watching that video.
Watch this (skip to 1:17:28 to see a quick demo, the rest of the video is the explanation): ▶ this video It’s exploiting logic programming to query for a program that satisfies some condition.
Equational reasoning makes TDD and property based testing trivial (encode rules by examples, base cases and corner cases, which is the most natural way for humans to think); rule-based system are easier to extend and correct by design (bounded set of possible states); provides more powerful and elegant query languages (E.g. Datalog). See ▶ this video (skip to 1h mark to see some examples)
As for what miniKanren is, there are a couple of books (one being Byrd's dissertation) and a lot of papers. I think maybe the best summary I've read is actually the interview transcript at link . But also, there's a summary on link , with links to the papers and talks, and an older summary on link . Most of these are a bit hard to understand the significance of if you aren't already familiar with logic programming. The talk on ▶ this video is a popular description of one of the most astonishing results; I haven't watched it but people tell me it's good. As for understanding academia, yeah, I don't know.
I watched a fascinating presentation and when I saw the speaker typing (lambda ...) and having it change to (λ ...) and not having to deal with parens.. I was jealous. Does emacs do this? EDIT: the presentation: William Byrd on "The Most Beautiful Program Ever Written" ▶ this video
If you're interested in the work that led to this, definitely check out Kenichi Asai's reflective languages. The code for his Black language with reflective semantics is reproduced here: [0] More tangential but also cool: this talk[1] by William Byrd mentions reflective towers, but jumps into a discussion of what he terms "relational programming". It's a demo of his Barliman Smart editor system: [2] [0] link [1] ▶ this video [2] link
Well, I think lisper nailed it in the article: It's not just that the code is represented as data structured in linked-lists, it's that that data exposes the semantic structure of the code in ways that are more pragmatically useful (among other nice properties) than char strings. When you get into the LISP interpreter itself, which is just a linked-list structure describing how to process linked-list structures (like itself) as code, well... Here's William Byrd on "The Most Beautiful Program Ever Written" (ye LISP interpreter) ▶ this video
William Byrd's work in program synthesis is an interesting take on this, where an IDE can, guided by test cases written for a function, actually auto-complete code itself whilst writing the function, or tell the programmer when they have something wrong by violating a test case. Of course it is impractical right now, but a good step nonetheless.. It (Barliman) is demoed near the end of this video: ▶ this video