Lecture 7A: Metacircular Evaluator, Part 1
Channel:MIT OpenCourseWare · Length:1:24:37 · Published:2019-08-22 · Views:31670
Summary
Lecture 7A from MIT 6.001 (SICP) by Abelson and Sussman introduces the metacircular evaluator, a Scheme interpreter written in Scheme. It shows how evaluating a program is itself a program.
Why HN recommends it
HN holds the SICP lectures up as joyful classics, and this lecture as the moment the evaluator is revealed.
But mostly it just makes me happy - it's infectious and weird. — HN, 2020
Functional programming · Compilers, interpreters & program analysis · University lectures & courses
Subtitles (excerpt)
PROFESSOR: Well today we're going to learn about something quite amazing. We're going to understand what we mean by a program a little bit more profoundly than we have up till now. Up till now, we've been thinking of programs as describing machines. So for example, looking at this still store, we see here is a program for factorial. And what it is, is a character string description, if you will, of the wiring diagram of a potentially infinite machine. And we can look at that a little bit and just see the idea. That this is a sort of compact notation which says, if n is 0, the result is one. Well here comes n coming into this machine, and if it's 0, then I control this switch in such a way that the switch allows the output to be one. Otherwise, it's n times factorial of n minus one. Well, I'm computing factorial of n minus one and multiplying that by n, and, in the case that it's not 0, this switch makes the output come from there. Of course, this is a machine with a potentially infinite number of parts, because factorial occurs within factorial, so we don't know how deep it has to be. But that's basically what our notation for programs really means to us at this point. It's a character string description, if you will, of a
On Hacker News
I re-watch this course every bunch of years, and every time I get something different from it. But mostly it just makes me happy - it's infectious and weird. Especially the "revelation" (spoiler!) [VIDEO] — mrspeaker, 2020-06
"We're getting really close to the spirit of the computer at this point, so I have to show a certain amount of reverence and respect" [VIDEO] — ufo, 2023-09
I learned best in Scheme because you don't need to parse your input and can just evaluate a tree[0] (Parsing is, in my opinion, the most boring part about writing an interpreter!) Chapter 7 of Crafting Interpreters lays out how an evaluator works in a pretty clean way [1]. I've also blogged about evaluating ASTs in JavaScript [2] Lastly, Gary Bernhardt took it a step further and instead of "evalu… — prezjordan, 2021-07
Related videos
- 8-bit computer update · Ben Eater · 6:53
- Javascript in 2015 · Glen Maddern · 10:32
- Jonathan Blow - Preventing the Collapse of Civilization (English only) · bus · 1:04:40
- Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich · Confreaks · 53:21
- How to Speak · MIT OpenCourseWare · 1:03:42
- 1. Introduction to Human Behavioral Biology · Stanford · 57:14
- The Soul of Erlang and Elixir • Sasa Juric • GOTO 2019 · GOTO Conferences · 42:02
- "Simple Made Easy" - Rich Hickey (2011) · Strange Loop Conference · 1:01:38
- LEADERSHIP LAB: The Craft of Writing Effectively · UChicago Social Sciences · 1:21:51
- Rich Harris - Rethinking reactivity · You Gotta Love Frontend · 36:45
- "Making Impossible States Impossible" by Richard Feldman · elm-conf · 25:06
- MIT's Pathway to Fusion Energy (IAP 2017) - Zach Hartwig · MIT Plasma Science and Fusion Center · 1:11:39
- Stanford's Sapolsky On Depression in U.S. (Full Lecture) · Stanford · 52:28
- Justice: What's The Right Thing To Do? Episode 01 "THE MORAL SIDE OF MURDER" · Harvard University · 54:56
- Lexical Scanning in Go - Rob Pike · GoogleFOSSSydney · 51:17
- William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC] · PapersWeLove · 1:31:05