Programming Erlang: Software for a Concurrent World (Pragmatic Programmers) (英語) ペーパーバック – 2013/10/3
Kindle 端末は必要ありません。無料 Kindle アプリのいずれかをダウンロードすると、スマートフォン、タブレットPCで Kindle 本をお読みいただけます。
A multi-user game, web site, cloud application, or networked database can have thousands of users all interacting at the same time. You need a powerful, industrial-strength tool to handle the really hard problems inherent in parallel, concurrent environments. You need Erlang. In this second edition of the bestselling Programming Erlang, you'll learn how to write parallel programs that scale effortlessly on multicore systems.
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.
What You Need
The Erlang/OTP system. Download it from erlang.org.
""This second edition of Joe's seminal Programming Erlang is a welcome update, covering not only the core language and framework fundamentals but also key community projects such as rebar and cowboy. Even experienced Erlang programmers will find helpful tips and new insights throughout the book, and beginners to the language will appreciate the clear and methodical way Joe introduces and explains key language concepts.""--Alexander Gounares, Former AOL CTO, advisor to Bill Gates, and founder/CEO of Concurix Corp.商品の説明をすべて表示する
The book starts at first principles and gives you a lot of the motivation behind design decisions and rationale. It makes it easier to keep in your head and fully understand what Erlang tries to solve and why. I already know other functional languages so I can't speak to how well it would read as a person first introduced to these concepts.
That said, I'm more excited about using Elixir than Erlang directly. However, I learned Erlang first because I wanted to know the underlying language and VM that Elixir was built upon. You can learn Elixir without learning Erlang, but I think that's a mistake. Erlang is much older and it's helpful to understand the design decisions and tradeoffs that went into Elixir.
After an introduction to how to do things sequentially we're then ushered into how the primitives for concurrency work and what they enable, but also what they mean in terms of error handling and how you will need to structure your networks of processes in order to make your system robust.
When we're comfortable with the concurrency primitives and how to handle them comes a part about how to interface with external resources and how this is typically (ideally) done in Erlang. A SHOUTcast server is demonstrated before moving on how to interface with websockets; a very powerful chapter demonstrating the simplicity of how Erlang can communicate with an external process.
When we're done with the multitude of ways you can use websockets we jump straight into data handling; ETS- and DETS-tables. This flows into a chapter about the Mnesia database.
After a chapter about debugging and tracing (which is quite unique in Erlang) we are introduced to OTP, the Open Telecom Platform ("The name is actually misleading, because OTP is far more general tan you might think", indeed). After a good introduction to how the generic server module is structured and created (introducing callbacks and how they work) we're then introduced to how to make a system using OTP.
At this point, one might be inclined to put the book down and that would be fine, but to close the book out there are several chapters on useful idioms, what to aim for in terms of how to interface with external processes, using external dependencies and perhaps most importantly what to think about when you're trying to use multiple cores effectively.
Buy it. You won't regret it.