Erlang is the language of choice for programmers who want to write robust, concurrent applications, but its strange syntax and functional design can intimidate the uninitiated. Luckily, there's a new weapon in the battle against Erlang-phobia: Learn You Some Erlang for Great Good!
Erlang maestro Fred Hebert starts slow and eases you into the basics: You'll learn about Erlang's unorthodox syntax, its data structures, its type system (or lack thereof!), and basic functional programming techniques. Once you've wrapped your head around the simple stuff, you'll tackle the real meat-and-potatoes of the language: concurrency, distributed computing, hot code loading, and all the other dark magic that makes Erlang such a hot topic among today's savvy developers.
As you dive into Erlang's functional fantasy world, you'll learn about:
- Testing your applications with EUnit and Common Test
- Building and releasing your applications with the OTP framework
- Passing messages, raising errors, and starting/stopping processes over many nodes
- Storing and retrieving data using Mnesia and ETS
- Network programming with TCP, UDP, and the inet module
- The simple joys and potential pitfalls of writing distributed, concurrent applications
Packed with lighthearted illustrations and just the right mix of offbeat and practical example programs, Learn You Some Erlang for Great Good! is the perfect entry point into the sometimes-crazy, always-thrilling world of Erlang.
Table of contents
- Learn You Some Erlang For Great Good!
- 1. Starting Out
- 2. Modules
- 3. Syntax in Functions
- 4. Types (or Lack Thereof)
- 5. Hello Recursion!
- 6. Higher-Order Functions
7. Errors and Exceptions
- A Compilation of Errors
- Raising Exceptions
- Dealing with Exceptions
- Try a try in a Tree
- 8. Functionally Solving Problems
- 9. A Short Visit to Common Data Structures
- 10. The Hitchhiker’s Guide to Concurrency
- 11. More on Multiprocessing
- 12. Errors and Processes
- 13. Designing a Concurrent Application
14. An Introduction to OTP
- The Common Process, Abstracted
- The Basic Server
- Specific vs. Generic
- Callback to the Future
- .BEAM Me Up, Scotty!
15. Rage Against the Finite-State Machines
- What Is a Finite-State Machine?
- Generic Finite-State Machines
- A Trading System Specification
- Game Trading Between Two Players
- That Was Really Something
- Fit for the Real World?
- 16. Event Handlers
17. Who Supervises the Supervisors?
- Supervisor Concepts
- Using Supervisors
- Band Practice
- Dynamic Supervision
- 18. Building an Application
- 19. Building Applications the OTP Way
- 20. The Count of Applications
21. Release Is the Word
- Fixing the Leaky Pipes
- Releases with systools
- Releases with Reltool
- Reltool Recipes
- Released from Releases
- 22. Leveling Up in the Process Quest
- 23. Buckets of Sockets
- 24. EUnited Nations Council
- 25. Bears, ETS, Beets: In-Memory NoSQL for Free!
- This Is My Boomstick
- Fallacies of Distributed Computing
- Dead or Dead-Alive
- My Other Cap Is a Theorem
- Setting Up an Erlang Cluster
- Remote Shells
- Hidden Nodes
- The Walls Are Made of Fire, and the Goggles Do Nothing
- The Calls from Beyond
- Burying the Distribunomicon
- 27. Distributed OTP Applications
28. Common Test for Uncommon Tests
- What Is Common Test?
- Common Test Structure
- Creating a Simple Test Suite
- Testing with State
- Test Groups
- Test Suites Redux
- Test Specifications
- Large-Scale Testing
- Integrating EUnit Within Common Test
- Is There More?
29. Mnesia and the Art of Remembering
- What’s Mnesia?
- What Should the Store Store?
- From Record to Table
- Of Mnesia Schemas and Tables
- Creating Tables
- Access and Context
- Reads, Writes, and More
- Implementing the First Requests
- Meet the Boss
- Deleting Stuff, Demonstrated
- Query List Comprehensions
- Remember Mnesia
30. Type Specifications and Dialyzer
- PLTs Are the Best Sandwiches
- Success Typing
- Type Inference and Discrepancies
- Typing About Types of Types
- Typing Functions
- Typing Practice
- Exporting Types
- Typed Behaviors
- Polymorphic Types
- You’re My Type
- That’s All, Folks
- A. Afterword
- B. On Erlang’s Syntax
- About the Author
- C. Updates
- Title: Learn You Some Erlang for Great Good!
- Release date: January 2013
- Publisher(s): No Starch Press
- ISBN: 9781593274351
You might also like
If you’re new to Erlang, its functional style can seem difficult, but with help from this …
This book is an in-depth introduction to Erlang, a programming language ideal for any situation where …
Erlang by Example with Cesarini and Thompson
Get to know Erlang, the increasingly popular programming language widely known for its role in concurrency. …
Building Web Applications with Erlang
Why choose Erlang for web applications? Discover the answer hands-on by building a simple web service …