Offers an explanation of Erlang, a programming language ideal for any situation where concurrency, fault-tolerance, and fast response is essential. This book focuses on the language's syntax and semantics, and explains pattern matching, proper lists, recursion, debugging, networking, and concurrency.
This book is an in-depth introduction to Erlang, a programming language ideal for any situation where concurrency, fault tolerance, and fast response is essential. Erlang is gaining widespread adoption with the advent of multi-core processors and their new scalable approach to concurrency. With this guide you'll learn how to write complex concurrent programs in Erlang, regardless of your programming background or experience.nnWritten by leaders of the international Erlang community -- and based on their training material -- Erlang Programming focuses on the language's syntax and semantics, and explains pattern matching, proper lists, recursion, debugging, networking, and concurrency.nnThis book helps you:nnUnderstand the strengths of Erlang and why its designers included specific featuresnLearn the concepts behind concurrency and Erlang's way of handling itnWrite efficient Erlang programs while keeping code neat and readablenDiscover how Erlang fills the requirements for distributed systemsnAdd simple graphical user interfaces with little effortnLearn Erlang's tracing mechanisms for debugging concurrent and distributed systemsnUse the built-in Mnesia database and other table storage featuresnnErlang Programming provides exercises at the end of each chapter and simple examples throughout the book.
InhaltsverzeichnisnChapter 1 IntroductionnWhy Should I Use Erlang?nThe History of ErlangnErlang s CharacteristicsnErlang and MulticorenCase StudiesnHow Should I Use Erlang?nChapter 2 Basic ErlangnIntegersnThe Erlang ShellnFloatsnAtomsnBooleansnTuplesnListsnTerm ComparisonnVariablesnComplex Data StructuresnPattern MatchingnFunctionsnModulesnExercisesnChapter 3 Sequential ErlangnConditional EvaluationsnGuardsnBuilt-in FunctionsnRecursionnRuntime ErrorsnHandling ErrorsnLibrary ModulesnThe DebuggernExercisesnChapter 4 Concurrent ProgrammingnCreating ProcessesnMessage PassingnReceiving MessagesnRegistered ProcessesnTimeoutsnBenchmarkingnProcess SkeletonsnTail Recursion and Memory LeaksnA Case Study on Concurrency-Oriented ProgrammingnRace Conditions, Deadlocks, and Process StarvationnThe Process ManagernExercisesnChapter 5 Process Design PatternsnClient/Server ModelsnA Process Pattern ExamplenFinite State MachinesnEvent Managers and HandlersnExercisesnChapter 6 Process Error HandlingnProcess Links and Exit SignalsnRobust SystemsnExercisesnChapter 7 Records and MacrosnRecordsnMacrosnExercisesnChapter 8 Software UpgradenUpgrading ModulesnBehind the ScenesnUpgrading ProcessesnThe .erlang FilenExercisenChapter 9 More Data Types and High-LevelnConstructsnFunctional Programming for RealnFuns and Higher-Order FunctionsnList ComprehensionsnBinaries and SerializationnReferencesnExercisesnChapter 10 ETS and Dets TablesnETS TablesnDets TablesnA Mobile Subscriber Database ExamplenExercisesnChapter 11 Distributed Programming in ErlangnDistributed Systems in ErlangnDistributed Computing in Erlang: The BasicsnThe epmd ProcessnExercisesnChapter 12 OTP BehaviorsnIntroduction to OTP BehaviorsnGeneric ServersnSupervisorsnApplicationsnRelease HandlingnOther Behaviors and Further ReadingnExercisesnChapter 13 Introducing MnesianWhen to Use MnesianConfiguring MnesianTransactionsnPartitioned NetworksnFurther ReadingnExercisesnChapter 14 GUI Programming with wxErlangnwxWidgetsnwxErlang: An Erlang Binding for wxWidgetsnA First Example: MicroBlognThe MiniBlog ExamplenObtaining and Running wxErlangnExercisesnChapter 15 Socket ProgrammingnUser Datagram ProtocolnTransmission Control ProtocolnThe inet ModulenFurther ReadingnExercisesnChapter 16 Interfacing Erlang with Other Programming LanguagesnAn Overview of InterworkingnInterworking with JavanC NodesnErlang from the Unix Shell: erl_callnPort Programs Library Support for CommunicationnLinked-in Drivers and the FFInExercisesnChapter 17 Trace BIFs, the dbg Tracer, and Match SpecificationsnIntroductionnThe Trace BIFsnTracing Calls with the trace_pattern BIFnThe dbg TracernMatch Specifications: The fun SyntaxnMatch Specifications: The Nuts and BoltsnFurther ReadingnExercisesnChapter 18 Types and DocumentationnTypes in ErlangnTypEr: Success Types and Type InferencenDocumentation with EDocnExercisesnChapter 19 EUnit and Test-Driven DevelopmentnTest-Driven DevelopmentnEUnitnThe EUnit InfrastructurenTesting State-Based SystemsnTesting Concurrent Programs in ErlangnExercisesnChapter 20 Style and EfficiencynApplications and ModulesnProcesses and ConcurrencynStylistic ConventionsnCoding StrategiesnEfficiencynAnd Finally...nAppendix Using ErlangnGetting Started with ErlangnTools for ErlangnWhere to Learn MorenColophon
Francesco Cesarini is the founder and Chief Strategy Officer of Erlang Training andnConsulting. Having used Erlang on a daily basis since 1995, he started his career as an intern at Ericsson'sncomputer science lab, the birth place of Erlang. He spent four years atnEricsson working with flagship Erlang projects, including the R1 releasenof the OTP middleware. He has taught Erlang/OTP to all parties involvednin the software cycle, including developers, support engineers, testersnas well as project and technical managers. In 2003, he also startednteaching undergraduate students at the IT University of Gothenburg.nnSoon after Erlang was released as Open Source, he founded ErlangnTraining and Consulting. With offices in the UK, Sweden, Poland (andnsoon the US), they have become the world leaders in Erlang basednconsulting, contracting, support, training and systems development..nTheir client base is spread on five continents and ranges from smallnstart-ups to blue chip companies. In his role as CTO, is currentlynleading the research, development and consulting teams.nnHe is active in the Erlang community not only through regularly talks,nseminars and tutorials at conferences worldwide, but also through hisninvolvement in international research projects. He organises localnErlang user groups and with the help of his colleagues, runs thentrapexit.org Erlang community website.nnSimon Thompson is Professor of Logic and Computation in the Computing Laboratory of the University of Kent, where he has taught computing at undergraduate and postgraduate levels for the past twenty five years, and where he has been department head for the last six.nnnnHis research work has centered on functional programming: program verification, type systems, and most recently development of software tools for functional programming languages. His team has built the HaRe tool for refactoring Haskell programs, and is currently developing Wrangler to do the same for Erlang. His research has been funded by various agencies including EPSRC and the European Framework programme. His training is as a mathematician: he has an MA in Mathematics from Cambridge and a D.Phil. in mathematical logic from Oxford.nnnnHe has written three books in his field of interest; Type Theory and Functional Programming published in 1991; Miranda: The Craft of Functional Programming (1995) and Haskell: The Craft of Functional Programming (2nd ed. 1999). These are all published by Addison Wesley.
Über den Autor
Francesco Cesarini is the founder and CTO of Erlang Training and Consulting http://www.erlang-consulting.com/. Having used Erlang on a daily basis since 1995, he started his career as an intern at Ericsson's computer science lab, the birth place of Erlang. He spent four years at Ericsson working with flagship Erlang projects, including the R1 release of the OTP middleware. He has taught Erlang/OTP to all parties involved in the software cycle, including developers, support engineers, testers as well as project and technical managers. In 2003, he also started teaching undergraduate students at the IT University of Gothenburg.
Soon after Erlang was released as Open Source, he founded Erlang Training and Consulting. With offices in the UK, Sweden, Poland (and soon the US), they have become the world leaders an Erlang based consulting, contracting, support, training and systems development. Their client base is spread on five continents and ranges from small start-ups to blue chip companies. In his role as CTO, is currently leading the research, development and consulting teams.
He is active in the Erlang community not only through regularly talks, seminars and tutorials at conferences worldwide, but also through his involvement in international research projects. He organises local Erlang user groups and with the help of his colleagues, runs the trapexit.org http://www.trapexit.org/ Erlang community website.
Simon Thompson is Professor of Logic and Computation in the Computing Laboratory of the University of Kent, where he has taught computing at undergraduate and postgraduate levels for the past twenty five years, and where he has been department head for the last six.
His research work has centered on functional programming: program verification, type systems, and most recently development of software tools for functional programming languages. His team has built the HaRe tool for refactoring Haskell programs, and is currently developing Wrangler to do the same for Erlang. His research has been funded by various agencies including EPSRC and the European Framework programme. His training is as a mathematician: he has an MA in Mathematics from Cambridge and a D.Phil. in mathematical logic from Oxford.
He has written three books in his field of interest; Type Theory and Functional Programming published in 1991; Miranda: The Craft of Functional Programming (1995) and Haskell: The Craft of Functional Programming (2nd ed. 1999). These are all published by Addison Wesley.
Inhaltsverzeichnis
-
Foreword
-
Preface
-
Chapter 1: Introduction
-
Chapter 2: Basic Erlang
-
Chapter 3: Sequential Erlang
-
Chapter 4: Concurrent Programming
-
Chapter 5: Process Design Patterns
-
Chapter 6: Process Error Handling
-
Chapter 7: Records and Macros
-
Chapter 8: Software Upgrade
-
Chapter 9: More Data Types and High-Level Constructs
-
Chapter 10: ETS and Dets Tables
-
Chapter 11: Distributed Programming in Erlang
-
Chapter 12: OTP Behaviors
-
Chapter 13: Introducing Mnesia
-
Chapter 14: GUI Programming with wxErlang
-
Chapter 15: Socket Programming
-
Chapter 16: Interfacing Erlang with Other Programming Languages
-
Chapter 17: Trace BIFs, the dbg Tracer, and Match Specifications
-
Chapter 18: Types and Documentation
-
Chapter 19: EUnit and Test-Driven Development
-
Chapter 20: Style and Efficiency
-
Using Erlang
-
Colophon
Klappentext
This book is an in-depth introduction to Erlang, a programming language ideal for any situation where concurrency, fault tolerance, and fast response is essential. Erlang is gaining widespread adoption with the advent of multi-core processors and their new scalable approach to concurrency. With this guide you'll learn how to write complex concurrent programs in Erlang, regardless of your programming background or experience.
Written by leaders of the international Erlang community -- and based on their training material -- Erlang Programming focuses on the language's syntax and semantics, and explains pattern matching, proper lists, recursion, debugging, networking, and concurrency.
This book helps you:
* Understand the strengths of Erlang and why its designers included specific features
* Learn the concepts behind concurrency and Erlang's way of handling it
* Write efficient Erlang programs while keeping code neat and readable
* Discover how Erlang fills the requirements for distributed systems
* Add simple graphical user interfaces with little effort
* Learn Erlang's tracing mechanisms for debugging concurrent and distributed systems
* Use the built-in Mnesia database and other table storage features
Erlang Programming provides exercises at the end of each chapter and simple examples throughout the book.