"The world is parallel. If we want to write programs that behave as other objects behave in the real world, then these programs will have a concurrent structure. Use a language that was designed for writing concurrent applications, and development becomes a lot easier. Erlang programs model how we th"
"Functional programming forbids code with side effects. Side effects and concurrency don’t mix. You can have sequential code with side effects, or you can have code and concurrency that is free from side effects.You have to choose. There is no middle way."
"Erlang is a language where concurrency belongs to the programming language and not the operating system."
"A guard sequence is either a single guard or a series of guards, separated by semicolons (;). The guard sequence G1; G2; ...; Gn is true if at least one of the guards—G1, G2, ...—evaluates to true. A guard is a series of guard expressions, separated by commas (,). The guard GuardExpr1, GuardExpr2, ."
"1. When we enter a receive statement, we start a timer (but only if an after section is present in the expression). 2. Take the first message in the mailbox and try to match it against Pattern1, Pattern2, and so on. If the match succeeds, the message is removed from the mailbox, and the expressions "
"Download edemo2.erl 1> edemo2:start(false, abc). Process c received {'EXIT',<0.81.0>,abc} Process a received {'EXIT',<0.81.0>,abc} process b (<0.81.0>) is dead process c (<0.82.0>) is alive ok 2> edemo2:start(false, normal). process b (<0.85.0>) is alive process c (<0.86.0>) is alive ok 3> edemo2:st"
"Note: When you read this code, you’ll see we just used a variable Pid everywhere. This is the process identifier of the linked process. We can’t use a variable name like LinkedPid to say this, because before we have evaluated link(Pid), it’s not a linked process. When you see a message like {’EXIT’,"
"Step 1: Start an Erlang node on doris: doris $ erl -name gandalf -setcookie abc (gandalf@doris.myerl.example.com) 1> kvs:start(). true Step 2: Start an Erlang node on george, and send some commands to gandalf: george $ erl -name bilbo -setcookie abc (bilbo@george.myerl.example.com) 1> rpc:call(ganda"
作者简介
作者简介:
Joe Armstrong
Erlang最初的设计者和实现者,也是Erlang OTP系统项目的首席架构师。他拥有瑞典皇家理工学院博士学位,是容错系统开发领域的世界级专家。现就职于爱立信公司。
译者简介:
牛化成
2004年毕业于浙江工商大学广告学专业,文学学士。2000年开始制作网站,对各种Web前后端技术多有深入了解。习惯思考,热爱新知,出于个人兴趣一直关注互联网各种前沿领域,并长期追踪传播学、心理学、神经科学和视觉设计等方面的最新成果。自由职业者,目前正在设计开发一个面向未来的新型网站。