Programming Erlang, Second Edition - Joe Armstrong

Programming Erlang, Second Edition

Joe Armstrong

出版时间

2013-10-16

ISBN

9781937785536

评分

★★★★★
书籍介绍
Using Erlang, you’ll be surprised at how easy it becomes to deal with parallel problems, and how much faster and more efficiently your programs run. That’s because Erlang uses sets of parallel processes—not a single sequential process, as found in most programming languages. Joe Armstrong, creator of Erlang, introduces this powerful language in small steps, giving you a complete overview of Erlang and how to use it in common scenarios. You’ll start with sequential programming, move to parallel programming and handling errors in parallel programs, and learn to work confidently with distributed programming and the standard Erlang/Open Telecom Platform (OTP) frameworks. You need no previous knowledge of functional or parallel programming. The chapters are packed with hands-on, real-world tutorial examples and insider tips and advice, and finish with exercises for both beginning and advanced users. The second edition has been extensively rewritten. New to this edition are seven chapters covering the latest Erlang features: maps, the type system and the Dialyzer, WebSockets, programming idioms, and a new stand-alone execution environment. You’ll write programs that dynamically detect and correct errors, and that can be upgraded without stopping the system. There’s also coverage of rebar (the de facto Erlang build system), and information on how to share and use Erlang projects on github, illustrated with examples from cowboy and bitcask. Erlang will change your view of the world, and of how you program.
AI导读
核心看点
  • Erlang之父亲授,从基础到分布式全景解析
  • 深入讲解消息传递并发模型与OTP框架实战
  • 无需函数式基础,循序渐进掌握并行编程思维
适合谁读
  • 希望系统学习Erlang并发与分布式开发的程序员
  • 对函数式编程及高可用系统架构感兴趣的开发者
  • 具备一定编程基础,想拓宽技术视野的工程师
读前提醒
  • 建议阅读英文原版,中文译本质量参差不齐
  • 书中部分附录内容较多,可结合实际需求选读
  • 作者对底层实现细节涉猎有限,需结合官方文档
读者共识
  • 作为创始人著作,权威性强,适合系统入门
  • 并发与分布式章节精彩,函数式部分略显枯燥
  • 构建工具较原始,现代项目多转向Elixir生态

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "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 is one of the creators of Erlang. He has a Ph.D. in computer science from the Royal Institute of Technology in Stockholm, Sweden and is an expert on the construction of fault-tolerant systems. He has worked in industry, as an entrepreneur, and as a researcher for more than 35 years.
用户评论
感觉没有一个像mix这样的工具,build, release,还是感觉比较原始。所以最终还是去写elixir了。。。
快速扫了遍
非常适合有点基础的我入门,erlang 的消息传递式并发怎么看都觉得自然。
这本就好很多,毕竟是 Erlang 设计者写的。函数式部分所有都差不多那样没啥意思,并发和分布式部分有些意思。
作者讲的很全面。读了learn your an Erlang for great good后,还需要再读下这本才靠谱。
收藏