Happen to find this nice presentation on quickly developing static DSL in OCaml. Here, 'static' means the DSL is processed by a formal compiler as opposed to dynamic DSL such as the fancy metaprogramming in Ruby in runtime. I've been learning OCaml for a while and find it amazing for the elegance, speed and easiness to play with. It's also very good at writing compilers, which I've been long planning to learn thoroughly.
评论
cookoo 2006-11-29   回复
另外发现一个教程:Write Yourself a Scheme in 48 Hours
http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html

主要讲Haskell的parsec combinator
cookoo 2006-10-30   回复
我想这可能是因为ML设计的初衷是用来分析和证明程序,所以语法颇像lex和yacc的定义。我个人学习Ocaml不是为了研究compiler,不过PO的作者提到编译工具在复杂文本挖掘中的作用倒是个很有吸引力的观点。

我现在只看到第4章,翻了翻后面的,PO的第16章是讲Ocamllex和Ocamlyacc的。20页不到,O'reilly的那本对应章节也是这个页数。后者用的是传统的计算器的例子,而PO不想集中讲一个复杂的计算器,所以还说了些各种用处的小例子,基本差别不大。

我想主要差别是PO的第17章,这章是个基于16章的知识解析复杂log文件的大例子。另外29章讲怎么用Camlp4在Ocaml的基础上定制DSL,这个O'reilly那本没有涉及。不过作者说Camlp4是Ocaml最深奥的部分,所以也只能讲点皮毛:(

tiger book ML版amazon上也脱销了,而且很奇怪评价极低。我不清楚还有什么别的这方面的书。
potian 2006-10-30   回复
听说用ML写编译器非常自然,可惜很少看到这方面的专著,连tiger book的ML版都无法在国内找到

不知道practical 这本书里面有没有相关的章节
发表评论

您还没有登录,请登录后发表评论

cookoo
搜索本博客
我的相册
1e04c0dc-42a1-45a4-b392-aa82faafa7ea-thumb
20059805856241
共 10 张
存档
最新评论
评论排行榜