[荐]《对“A History of Erlang”的评论》
原文在这里。貌似“功夫网”并未“河蟹”——既然能访问,俺就不盗版了。
这篇文章是 Robert Zubek 对 Joe Armstrong 在 07 年某个会上 show 的 “A History of Erlang” PDF 的评论(更象是写了一个“注”)。基本上,相比著名的 “Joe Thesis 2003” (本站提供了中文翻译,感谢段先德同学)而言,这篇 PDF 中并没有太多的新内容,只能算是一个精编浓缩 remix 版而已。
但对 Joe Thesis 2003 这篇略嫌艰深的博士论文来说, Robert Zubek 的文章提供了很好的“补充视角”。也就是说,从 Joe Thesis 中我们能看到 Erlang 在“一系列问题”上做出了与众不同的选择。但如果没有一定的背景知识,我们或许没怎么觉得这“一系列问题”又有什么大不了的。而这一篇正好(部分地)补充了这些背景知识。
照例,对于这篇文章的干货,还是打捞一下。
But this paper really conveys the feel for what that means: huge collections of loosely coupled finite-state machines, all running in parallel, doing little bits of protocol validation here and there, but mostly staying dormant.
英文的描述,如果写得好了,会有一种准确精妙难以言表的感觉,通常很难原汁原味的译为相对应的中文。不过,这句太经典,我还是想翻来看看。
这篇文档所传达的要义(用 Erlang 构造系统的感觉)是:一大堆并行运行着的有限状态机,各处做一做协议验证,彼此松散耦合,通常大部分的有限状态机都处在休眠状态。
作者提到他对这篇 “A History of Erlang” 中“有感觉”的几点是:
First, there’s strong emphasis on easily tracking and manipulating the flow of control, rather than data. Second, I enjoyed the explanation of one particular detail of Erlang: in the message-passing implementation, individual processes don’t handle messages immediately. Third, Erlang is somewhat infamous for its distributed error handling mechanism.
这只是起头,精妙在于剖析。任何一个设计决策都是有 trade off 的,对这些设计决策正反两面的分析,或许能够部分解释“为什么 Erlang 会这么怪异”,相当值得一读。
顺便说一句,我“有感觉”的一点是 “Erlang 天生就是以消息驱动模型来架构的系统” 而 “消息驱动的编程模型” 如何应用于互联网编程环境,正是值得我们深思的问题。


Write a Comment