HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Andy Keep - Writing a Nanopass Compiler

ClojureTV1 HN recommender · recommended in 1 month, 2016-2026
YouTube
29K views · 12 years ago · talk · evergreen

Andy Keep's Clojure/Conj talk on writing a nanopass compiler, built from many single-task passes with formally defined intermediate languages. It covers the framework's origins in a compiler teaching course at Indiana University.

Cited alongside compiler-construction resources as the go-to talk on the nanopass approach used in Chez Scheme.

Compilers, interpreters & program analysisFunctional programming#nanopass#compilers#intermediatelanguages#chezscheme#clojureconj

4 comments from Hacker News

@LiamPowell2026 · in “Want to Write a Compiler? Just Read These Two Papers (2008)”

See also, Andy Keep's dissertation [1] and his talk at Clojure/Conj 2013 [2]. I think that the nanopass architecture is especially well suited for compilers implemented by LLMs as they're excellent at performing small and well defined pieces of work. I'd love to see Anthropic try their C compiler experiment again but with a Nanopass framework to build on. I've recently been looking in to adding Nanopass support to Langkit, which would allow for writing a Nanopass compiler in Ada, Java, Python, or a few other languages [3]. [1]: link [2]: ▶ this video [3]: link

CitesView on HN
@undecidabot2018 · in “MLton Compiler Overview”

Compilers come in all shapes and sizes. Some are single pass like Turbo Pascal. They directly generate machine code while parsing (no AST!). Niklaus Wirth (Pascal/Modula/Oberon guy) wrote a book following this approach [1]. Some have multiple passes like Chez Scheme. They have many simple passes, which they call a "nanopass". Andrew Keep has a great talk on this approach [2]. In practice, most compilers today are multi-pass, though probably not as many Chez. If we look at Rust, they go from AST -> HIR -> MIR -> LLVM IR -> machine code [3]. There are probably more things going on from LLVM to machine code, but I'm not knowledgeable enough to comment on it. I think the trade-off here is clear: less passes -> shorter compile times, more passes -> faster code generated, more modular compiler. Martin Odersky (Scala guy) has a paper attempting to get the best of both [4]. [1] link [2] ▶ this video [3] link [4] link

RecommendsView on HN
@vengarioth2017 · in “Ask HN: Resources for building a programming language?”

Many suggest resources for compiler implementations, i personally would start prototyping the language itself, think about it's type system and its runtime properties. There are many possibilities in terms of type systems, from static to dynamic and everything in between, concepts like linear types, algebraic types, etc. Runtime properties are things like it's memory model (garbage collection, yes or no). All of this depends on the purpose of your language. The second part would be choosing a platform to run on (so you only have to write a compiler frontend). There are many great technologies to host a language, but i'd advocate two specific ones here: * link (shoutout to @love2code) * link ZetaVM is a great target for dynamicly typed and/or jit compiled languages like python or javascript. LLVM is used in many low level / near metal languages like C, C++, rust and so on. None of both must be your final targets, your compiler frontend can be moved to target another platform like the JVM later. As a last part, implement your compiler frontend. This involves lexing/parsing source code, type checking if needed and generating your target's intermediate representation. I personally prefer hand-written recursive descent parsers using a parser combinator framework (like link ) over parser generators. For further processing like type checking, there is the common monolith aproach and the nanopass framework/approach ▶ this video Also there's a great series on compiler frontends by Al

CitesView on HN
@616c2016 · in “An Incremental Approach to Compiler Construction (2006) [pdf]”

Is this preceding work to the tour de force that is the Chez Scheme incremental like 40+ Scheme compiler. I mean, Cisco bought it, probably to hide it from us all. It must be worth something. ▶ this video link link

CitesView on HN
ClojureScript for Skeptics - Derek Slager41:09

ClojureScript for Skeptics - Derek Slager

ClojureTV
72K views • 10 years ago
Clojure in a nutshell by James Trunk32:44

Clojure in a nutshell by James Trunk

Func Prog Sweden
104K views • 5 years ago
Saša Jurić - Parsing from first principles - WebCamp Zagreb 20191:10:16

Saša Jurić - Parsing from first principles - WebCamp Zagreb 2019

WebCamp Zagreb
6K views • 7 years ago
Stanford Seminar - Concatenative Programming: From Ivory to Metal1:04:45

Stanford Seminar - Concatenative Programming: From Ivory to Metal

Stanford Online
14K views • 8 years ago
Anthony Marcar - Clojure At Scale @WalmartLabs39:41

Anthony Marcar - Clojure At Scale @WalmartLabs

ClojureTV
24K views • 11 years ago
Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure53:56

Expert to Expert: Rich Hickey and Brian Beckman - Inside Clojure

jasonofthel33t
119K views • 13 years ago
Bruce Hauman - Developing ClojureScript With Figwheel45:31

Bruce Hauman - Developing ClojureScript With Figwheel

ClojureTV
56K views • 11 years ago
Understanding Specter: Clojure's missing piece40:31

Understanding Specter: Clojure's missing piece

Misophistful
12K views • 9 years ago
Solving Problems the Clojure Way - Rafal Dittwald1:02:26

Solving Problems the Clojure Way - Rafal Dittwald

Clojure/north
87K views • 7 years ago
Analyzing Programs with Z343:31

Analyzing Programs with Z3

Compose Conference
24K views • 10 years ago
Lecture 1B | MIT 6.001 Structure and Interpretation, 198658:22

Lecture 1B | MIT 6.001 Structure and Interpretation, 1986

MIT OpenCourseWare
116K views • 17 years ago
clojure.core/typing - Matt Adereth35:41

clojure.core/typing - Matt Adereth

ClojureTV
40K views • 10 years ago
Clojure for Lisp Programmers Part 1 - Rich Hickey1:28:59

Clojure for Lisp Programmers Part 1 - Rich Hickey

ClojureTV
25K views • 13 years ago
The Next Five Years of ClojureScript - David Nolen1:00:58

The Next Five Years of ClojureScript - David Nolen

Metosin
19K views • 10 years ago
Brian Goetz - Stewardship: the Sobering Parts1:03:31

Brian Goetz - Stewardship: the Sobering Parts

ClojureTV
39K views • 11 years ago
Invited Talk - Guy Steele1:07:22

Invited Talk - Guy Steele

ClojureTV
39K views • 9 years ago
Barliman: trying the halting problem backwards, blindfolded - William Byrd, Greg Rosenblatt36:14

Barliman: trying the halting problem backwards, blindfolded - William Byrd, Greg Rosenblatt

ClojureTV
8K views • 9 years ago
Debugging with the Scientific Method - Stuart Halloway49:09

Debugging with the Scientific Method - Stuart Halloway

ClojureTV
25K views • 10 years ago
Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic40:42

Lucas Cavalcanti & Edward Wible - Exploring four hidden superpowers of Datomic

ClojureTV
29K views • 11 years ago
Zach Oakes - Making Games at Runtime with Clojure37:34

Zach Oakes - Making Games at Runtime with Clojure

ClojureTV
31K views • 11 years ago