按年被提到
20082013 · 7 次2026
开源书›语言实现与理论·No.34·简称 WYAS

Write Yourself a Scheme in 48 Hours

48 小时自制 Scheme 解释器
Jonathan Tang, Wikibooks contributors

用 Haskell 一步步写出 Scheme 解释器,同时学函数式编程

免费阅读 ↗
被推荐 · 37 人首次 2008-05-12 · 最近 2026-03-01许可证 CC BY-SA 4.0
37不同的人
41活跃月份
26有推荐的月份
48讨论串

Jonathan Tang 带读者用 Haskell 从零实现一个 Scheme 解释器,从解析器(用 Parsec)、求值器一路写到错误处理和标准库。它是项目驱动的教程:边做边学 Haskell 的类型、monad 等概念,也顺带理解解释器如何工作。和只讲语言语法的教程相比,它更像一次完整的动手实践,难度也更高。

HN 为什么推荐它

HN 上的人大多把它推荐给想学 Haskell 或想学语言实现的人,说它比一般教程更深入、更接近真实项目,还有人说靠它同时学会了 Haskell 和 Scheme;也有人提醒用 Haskell 实现可能构成门槛。

难度 3 / 5约 15 小时开放许可
适合谁

想通过实作学 Haskell 与解释器实现的读者

读之前最好知道
1基本编程经验
2Haskell 基础语法
3递归(recursion)

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1先把 Haskell 基础语法过一遍,再开始跟着写代码
  2. 2动手敲每一步代码,不要只看;前几章就能感受到解析的威力
  3. 3遇到 monad 和 Parsec 的地方放慢,必要时配合 Haskell 入门书
  4. 4写完后自己加功能,例如更多内置函数,巩固理解

HN 书评

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

“for everyone who wants to get into functional programming, very quick (and very hard) simply has to read this Wikibook.”

强烈推荐想学函数式编程的人读它,又快又难
Lisp as the Maxwell’s equations of software原评论 ↗
推荐johngunderman · 2009-07

“I would also suggest Write Yourself a Scheme in 48 Hours as it not only teaches Haskell, but also Scheme”

推荐它,既教 Haskell 也教 Scheme
Ask HN: which functional language to learn?原评论 ↗
推荐eru · 2010-03

“I am quite fond of "Write Yourself a Scheme in 48 Hours".”

表示很喜欢它,可同时学 Haskell 和 Scheme
Learn to program in 21 days (comic)原评论 ↗
推荐tikhonj · 2011-10

“If you like this sort of thing and want to learn Haskell, consider looking at "Write Yourself a Scheme in 48 Hours"[1].”

向想学 Haskell 的人推荐,写 Scheme 解释器来学
(An ((Even Better) Lisp) Interpreter (in Python))原评论 ↗
推荐texodus · 2012-11

“was very helpful for seeing a compile interpreter at a high level”

称它帮自己从高层看清 Haskell 写的解释器
Show HN: My "weekend" project, an ML dialect and compiler原评论 ↗
推荐ivanjovanovic · 2013-04

“I went through it and can tell that it is really a nice introduction to basic and some of the more advanced Haskell concepts.”

读完称它是 Haskell 基础和部分进阶概念的好入门
Running a software team at Google原评论 ↗
看全部 20 条 →
推荐dmunoz · 2013-11

“Two more I know of are Scheme from Scratch (链接) Write Yourself a Scheme in 48 Hours Write Yourself a Scheme in 48 Hours”

列为实现解释型语言的两份教程之一
Introduction to the Python Interpreter, Part 1: Function Objects原评论 ↗
推荐gmfawcett · 2014-04

“you might also enjoy "Write yourself a Scheme in 48 hours." It uses Haskell rather than C as the implementation language.”

推荐它,用 Haskell 而非 C 实现解释器
Learn C and build your own Lisp原评论 ↗
推荐rasur · 2014-04

“Both are helping my limited experience of Haskell greatly.”

说它和另一份资料对自己有限的 Haskell 经验帮助很大
GHC 7.8.1 released原评论 ↗
推荐SAI_Peregrinus · 2014-04

“One of my favorite programming tutorials is "Write Yourself A Scheme."”

称它是自己最喜欢的编程教程之一
On why learning to program is hard原评论 ↗
推荐throwaway13qf85 · 2014-05

“which is also worth reading (this is actually how I learned both Haskell and Scheme..!)”

说自己就是靠它同时学会 Haskell 和 Scheme
Simple steps to implementing a programming language原评论 ↗
推荐mcguire · 2014-05

“In addition to the article here and "Write Yourself a Scheme in 48 Hours" (the implementation language is Haskell, which may be a barrier)[1]”

列为实现解释器的资源,提醒 Haskell 可能是门槛
Simple steps to implementing a programming language原评论 ↗
推荐kasbah · 2014-08

“Write Yourself a Scheme in 48Hrs [1] is a more practical intro.”

称它是更实用的入门,以 Haskell 实现
Getting It Done with Haskell原评论 ↗
推荐anindyabd · 2015-01

“Recently I wrote an interpreter for Scheme using Haskell using the guide "Write Yourself a Scheme" [1]. It was great fun”

说自己照它用 Haskell 写了个 Scheme 解释器,很好玩
Make Your Own Programming Language原评论 ↗
推荐dragonwriter · 2015-04

“Write Yourself a Scheme in 48 Hours [1] is more in-depth and real-world than most tutorials”

称它比多数教程更深入、更贴近真实
Becoming Productive in Haskell原评论 ↗
推荐uniclaude · 2015-10

“is a very nice way to get into functional programming.”

称它是进入函数式编程的好方式
Learn C and build your own Lisp原评论 ↗
推荐jerf · 2015-12

“work through Write Yourself a Scheme in 48 Hours and you'll see what I mean, even if you just do the first couple of chapters.”

让人读前几章,看 ML 系语言处理解析和 AST 有多顺手
Metabase: Why we picked Clojure原评论 ↗
推荐albertus · 2016-07

“is a good exercise in working with Parsec. It's written for Haskell beginners, but it wasn't tedious in that regard.”

推荐它作为练习 Parsec 的好材料,面向 Haskell 初学者但不乏味
Haskell Data Analysis and Machine Learning Cookbook原评论 ↗
推荐kornish · 2016-08

“this is a very digestible overview on PL implementation by HN's very own nostrademons.”

推荐它作为编程语言实现的易懂概览,作者是 HN 的 nostrademons
The Fastest FizzBuzz in the West原评论 ↗
推荐evincarofautumn · 2017-01

“got into using Haskell for it with Write Yourself a Scheme[1].”

说自己靠它入门,开始用 Haskell 写编译器
Kitten – A statically typed, stack-based functional programming language原评论 ↗