“for everyone who wants to get into functional programming, very quick (and very hard) simply has to read this Wikibook.”
Write Yourself a Scheme in 48 Hours
用 Haskell 一步步写出 Scheme 解释器,同时学函数式编程
Jonathan Tang 带读者用 Haskell 从零实现一个 Scheme 解释器,从解析器(用 Parsec)、求值器一路写到错误处理和标准库。它是项目驱动的教程:边做边学 Haskell 的类型、monad 等概念,也顺带理解解释器如何工作。和只讲语言语法的教程相比,它更像一次完整的动手实践,难度也更高。
HN 上的人大多把它推荐给想学 Haskell 或想学语言实现的人,说它比一般教程更深入、更接近真实项目,还有人说靠它同时学会了 Haskell 和 Scheme;也有人提醒用 Haskell 实现可能构成门槛。
想通过实作学 Haskell 与解释器实现的读者
怎么读
由 Claude 根据这本书和 HN 上的说法整理,可能有错- 1先把 Haskell 基础语法过一遍,再开始跟着写代码
- 2动手敲每一步代码,不要只看;前几章就能感受到解析的威力
- 3遇到 monad 和 Parsec 的地方放慢,必要时配合 Haskell 入门书
- 4写完后自己加功能,例如更多内置函数,巩固理解
HN 书评
推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算“I would also suggest Write Yourself a Scheme in 48 Hours as it not only teaches Haskell, but also Scheme”
“I am quite fond of "Write Yourself a Scheme in 48 Hours".”
“If you like this sort of thing and want to learn Haskell, consider looking at "Write Yourself a Scheme in 48 Hours"[1].”
“was very helpful for seeing a compile interpreter at a high level”
“I went through it and can tell that it is really a nice introduction to basic and some of the more advanced Haskell concepts.”
看全部 20 条 →
“Two more I know of are Scheme from Scratch (链接) Write Yourself a Scheme in 48 Hours Write Yourself a Scheme in 48 Hours”
“you might also enjoy "Write yourself a Scheme in 48 hours." It uses Haskell rather than C as the implementation language.”
“Both are helping my limited experience of Haskell greatly.”
“One of my favorite programming tutorials is "Write Yourself A Scheme."”
“which is also worth reading (this is actually how I learned both Haskell and Scheme..!)”
“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]”
“Write Yourself a Scheme in 48Hrs [1] is a more practical intro.”
“Recently I wrote an interpreter for Scheme using Haskell using the guide "Write Yourself a Scheme" [1]. It was great fun”
“Write Yourself a Scheme in 48 Hours [1] is more in-depth and real-world than most tutorials”
“is a very nice way to get into functional programming.”
“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.”
“is a good exercise in working with Parsec. It's written for Haskell beginners, but it wasn't tedious in that regard.”
“this is a very digestible overview on PL implementation by HN's very own nostrademons.”
“got into using Haskell for it with Write Yourself a Scheme[1].”