按年被提到
20142014 · 7 次2026
开源书›语言实现与理论·No.39

Build Your Own Lisp

自己动手写 Lisp
Daniel Holden

用 C 语言一步步实现 Lisp 解释器,边做边学 C

免费阅读 ↗
被推荐 · 54 人首次 2014-04-04 · 最近 2026-05-29官方免费在线(版权保留,作者或出版社免费放出)
54不同的人
43活跃月份
24有推荐的月份
49讨论串

Daniel Holden 带读者用 C 语言从零写出一个 Lisp 方言的解释器,同时顺带学习 C 的指针、内存管理和错误处理。全书按章节循序渐进,每章在上一章的代码上增加功能,从解析器一路做到错误处理、宏和标准库,并有配套代码可对照。和只讲理论的语言实现教材相比,它更偏动手,适合同时补 C 和解释器两门课。

HN 为什么推荐它

HN 上的人常把它推荐给想学 C、或想入门语言实现的初学者,认为它是边做项目边学 C 的好路径,也比多数 Lisp 教程走得更远;评论里还夸排版漂亮。

难度 3 / 5约 25 小时
适合谁

想通过做项目学 C 和解释器的初学者

读之前最好知道
1基本的编程概念
2命令行与编译器使用

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1从第一章起按顺序做,每章都自己敲代码并跑通
  2. 2遇到指针和内存管理的部分慢一点,别直接抄代码
  3. 3做完后可以自己加功能,比如新的内置函数
  4. 4想看更理论的解释器实现,再配合 SICP 读

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
强烈推荐server_bot · 2018-01

“The best guided project/intro I've seen for complete beginners is Daniel Holden's "Build Your Own Lisp".”

称它是对完全初学者最好的引导项目,用 C 写 Lisp 解释器
Brushing up on operating systems and C programming原评论 ↗
强烈推荐iafisher · 2018-09

“I really can't recommend the book enough.”

极力推荐它,作为用 C 实现动态语言的起点
Ask HN: What's a starting point for learning how to write programming languages?原评论 ↗
推荐eshyong · 2014-04

“Tutorial on building a Lisp in C, from two days ago: Build Your Own Lisp”

分享这篇用 C 构建 Lisp 的教程
Low-level is easy原评论 ↗
推荐glenjamin · 2014-09

“It's doing a great job of teaching me C, while also reminding me how great high level languages actually are!”

说它把 C 教得很好,也让人重新体会高级语言的好处
Ask HN: How do I learn C and C++ when I love high-level languages?原评论 ↗
推荐munificent · 2014-11

“Your book looks beautiful!”

夸这本书排版很漂亮
Show HN: How I made the print and eBook versions of my web book原评论 ↗
推荐mrfabbri · 2014-11

“Another interesting book on implementing Lisp (from a C perspective) is Build Your Own Lisp.”

推荐它作为从 C 角度实现 Lisp 的另一本有趣的书
Lisp in Small Pieces: Table of Contents and Code原评论 ↗
看全部 20 条 →
推荐0xCMP · 2015-11

“Pretty nice and simple. I'm on Chapter 8 of 16.”

说它不错而且简单,自己读到第 8 章(共 16 章)
A Parser Combinator library for C原评论 ↗
推荐sndean · 2016-05

“This reminded me of something that helped me learn C a while ago:”

说它曾帮自己学会 C
Make Your Own Programming Language (2015)原评论 ↗
推荐eggy · 2016-07

“it is a great, short book to work through, and should help with grokking Carp.”

称它是值得做完的好短书,有助于理解 Carp
Carp: a statically typed lisp, without a GC, for high performance applications原评论 ↗
推荐krat0sprakhar · 2016-11

“From my experience, the best way for learning C has been [0] Build Your Own Lisp and Zed Shaw's [1] Learn C The Hard Way.”

称它与 Learn C The Hard Way 是自己学 C 最好的途径
C for Python programmers (2011)原评论 ↗
推荐vs4vijay · 2017-01

“Some good resources:”

把它列为学习 Lisp 的好资源
Ask HN: Learning Lisp?原评论 ↗
推荐scriptkiddy · 2017-04

“If you're into PL implementation, you can't go wrong with: Build Your Own Lisp or (链接) or (链接)”

把它列入编程语言实现的学习资源,认为选它不会错
Ask HN: Learn in weekend, what resources you suggest?原评论 ↗
推荐jaseemabid · 2017-07

“There are several beginner friendly online resources now including”

把它列为适合初学者入门编译器编写的在线资源
Lessons learned building a toy compiler原评论 ↗
推荐christophilus · 2017-08

“If you're interested in getting started, these are good intros to the basics:”

把它列为构建解释器基础知识的好入门
D as a Better C原评论 ↗
推荐bjconlan · 2018-09

“for lisp I really liked Build Your Own Lisp which uses modern C libraries so it polishes your C knowledge too.”

喜欢它,既学 Lisp 又因用现代 C 库而精进 C
Ask HN: What's a starting point for learning how to write programming languages?原评论 ↗
推荐garren · 2019-07

“[0], [1], [2] are easy to get started with and great to work through.”

把它列为容易上手、值得做完的解释器入门资料
My First Fifteen Compilers原评论 ↗
推荐IMAYousaf · 2019-08

“I am a huge fan of Build Your Own Lisp in C.”

表示自己是 Build Your Own Lisp 的忠实粉丝
Ask HN: Your favourite tutorial for total beginners?原评论 ↗
推荐ballpark · 2020-02

“Build Your Own Lisp - Build Your Own Lisp - Learn C by creating a lisp in C”

推荐它,用 C 写一个 Lisp 来学 C
Ask HN: What are some books where the reader learns by building projects?原评论 ↗
推荐olkyt · 2020-04

“not app, but fun”

推荐它作为学 C 的有趣方式,虽不是应用
Ask HN: C for Application Development原评论 ↗
推荐shakna · 2020-12

“This is one of my favourites [0] that goes a lot further than most, but fits the timeframe. Error handling, macros, standard library all included.”

推荐它,比多数 Lisp 教程走得更深,几个周末能做完
Wisp: A light Lisp written in C++原评论 ↗