Programming Erlang, Second Edition

Total Page:16

File Type:pdf, Size:1020Kb

Programming Erlang, Second Edition www.it-ebooks.info www.it-ebooks.info Early Praise for Programming Erlang, Second Edition 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 program- mers 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. A gem; a sensible, practical introduction to functional programming. ➤ Gilad Bracha Coauthor of the Java language and Java Virtual Machine specifications, creator of the Newspeak language, member of the Dart language team Programming Erlang is an excellent resource for understanding how to program with Actors. It’s not just for Erlang developers, but for anyone who wants to understand why Actors matters and why they are such an important tool in building reactive, scalable, resilient, and event-driven systems. ➤ Jonas Bonér Creator of the Akka Project and the AspectWerkz Aspect-Oriented Programming (AOP) framework, co-founder and CTO of Typesafe www.it-ebooks.info Programming Erlang, Second Edition Software for a Concurrent World Joe Armstrong The Pragmatic Bookshelf Dallas, Texas • Raleigh, North Carolina www.it-ebooks.info Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf, PragProg and the linking g device are trade- marks of The Pragmatic Programmers, LLC. Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein. Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com. The team that produced this book includes: Susannah Davidson Pfalzer (editor) Potomac Indexing, LLC (indexer) Kim Wimpsett (copyeditor) David J Kelly (typesetter) Janet Furlow (producer) Juliet Benda (rights) Ellie Callahan (support) Copyright © 2013 Pragmatic Programmers, LLC. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior consent of the publisher. Printed in the United States of America. ISBN-13: 978-1-937785-53-6 Encoded using the finest acid-free high-entropy binary digits. Book version: P1.0—August 2013 www.it-ebooks.info Contents Introduction . xiii Part I — Why Erlang? 1. Introducing Concurrency . 3 1.1 Modeling Concurrency 3 1.2 Benefits of Concurrency 6 1.3 Concurrent Programs and Parallel Computers 8 1.4 Sequential vs. Concurrent Programming Languages 9 2. A Whirlwind Tour of Erlang . 11 2.1 The Shell 11 2.2 Processes, Modules, and Compilation 13 2.3 Hello, Concurrency 15 Part II — Sequential Programming 3. Basic Concepts . 25 3.1 Starting and Stopping the Erlang Shell 25 3.2 Simple Integer Arithmetic 27 3.3 Variables 28 3.4 Floating-Point Numbers 32 3.5 Atoms 33 3.6 Tuples 34 3.7 Lists 37 3.8 Strings 39 3.9 Pattern Matching Again 41 4. Modules and Functions . 43 4.1 Modules Are Where We Store Code 43 4.2 Back to Shopping 50 www.it-ebooks.info Contents • vi 4.3 Funs: The Basic Unit of Abstraction 52 4.4 Simple List Processing 57 4.5 List Comprehensions 59 4.6 BIFs 63 4.7 Guards 64 4.8 case and if Expressions 68 4.9 Building Lists in Natural Order 70 4.10 Accumulators 71 5. Records and Maps . 75 5.1 When to Use Maps or Records 75 5.2 Naming Tuple Items with Records 76 5.3 Maps: Associative Key-Value Stores 79 6. Error Handling in Sequential Programs . 87 6.1 Handling Errors in Sequential Code 88 6.2 Trapping an Exception with try…catch 89 6.3 Trapping an Exception with catch 92 6.4 Programming Style with Exceptions 93 6.5 Stack Traces 95 6.6 Fail Fast and Noisily, Fail Politely 96 7. Binaries and the Bit Syntax . 99 7.1 Binaries 99 7.2 The Bit Syntax 101 7.3 Bitstrings: Processing Bit-Level Data 110 8. The Rest of Sequential Erlang . 113 8.1 apply 115 8.2 Arithmetic Expressions 116 8.3 Arity 116 8.4 Attributes 117 8.5 Block Expressions 120 8.6 Booleans 120 8.7 Boolean Expressions 121 8.8 Character Set 122 8.9 Comments 122 8.10 Dynamic Code Loading 122 8.11 Erlang Preprocessor 126 8.12 Escape Sequences 126 8.13 Expressions and Expression Sequences 127 www.it-ebooks.info Contents • vii 8.14 Function References 128 8.15 Include Files 128 8.16 List Operations ++ and - - 129 8.17 Macros 129 8.18 Match Operator in Patterns 131 8.19 Numbers 132 8.20 Operator Precedence 133 8.21 The Process Dictionary 134 8.22 References 135 8.23 Short-Circuit Boolean Expressions 135 8.24 Term Comparisons 136 8.25 Tuple Modules 137 8.26 Underscore Variables 137 9. Types . 141 9.1 Specifying Data and Function Types 141 9.2 Erlang Type Notation 143 9.3 A Session with the Dialyzer 148 9.4 Type Inference and Success Typing 152 9.5 Limitations of the Type System 155 10. Compiling and Running Your Program . 159 10.1 Modifying the Development Environment 159 10.2 Different Ways to Run Your Program 161 10.3 Automating Compilation with Makefiles 166 10.4 When Things Go Wrong 169 10.5 Getting Help 172 10.6 Tweaking the Environment 173 Part III — Concurrent and Distributed Programs 11. Real-World Concurrency . 177 12. Concurrent Programming . 181 12.1 The Concurrency Primitives 182 12.2 Introducing Client-Server 184 12.3 Processes Are Cheap 189 12.4 Receive with a Timeout 191 12.5 Selective Receive 193 12.6 Registered Processes 194 www.it-ebooks.info Contents • viii 12.7 A Word About Tail Recursion 196 12.8 Spawning with MFAs or Funs 197 13. Errors in Concurrent Programs . 199 13.1 Error Handling Philosophy 199 13.2 Error Handling Semantics 202 13.3 Creating Links 203 13.4 Groups of Processes That All Die Together 204 13.5 Setting Up a Firewall 205 13.6 Monitors 205 13.7 Error Handling Primitives 206 13.8 Programming for Fault Tolerance 207 14. Distributed Programming . 211 14.1 Two Models for Distribution 212 14.2 Writing a Distributed Program 213 14.3 Building the Name Server 213 14.4 Libraries and BIFS for Distributed Programming 219 14.5 The Cookie Protection System 222 14.6 Socket-Based Distribution 224 Part IV — Programming Libraries and Frameworks 15. Interfacing Techniques . 231 15.1 How Erlang Communicates with External Programs 232 15.2 Interfacing an External C Program with a Port 234 15.3 Calling a Shell Script from Erlang 240 15.4 Advanced Interfacing Techniques 240 16. Programming with Files . 243 16.1 Modules for Manipulating Files 243 16.2 Ways to Read a File 244 16.3 Ways to Write a File 251 16.4 Directory and File Operations 255 16.5 Bits and Pieces 258 16.6 A Find Utility 258 17. Programming with Sockets . 263 17.1 Using TCP 263 17.2 Active and Passive Sockets 272 17.3 Error Handling with Sockets 275 www.it-ebooks.info Contents • ix 17.4 UDP 276 17.5 Broadcasting to Multiple Machines 280 17.6 A SHOUTcast Server 281 18. Browsing with Websockets and Erlang . 287 18.1 Creating a Digital Clock 288 18.2 Basic Interaction 291 18.3 An Erlang Shell in the Browser 292 18.4 Creating a Chat Widget 293 18.5 IRC Lite 295 18.6 Graphics in the Browser 299 18.7 The Browser Server Protocol 301 19. Storing Data with ETS and DETS . 305 19.1 Types of Table 306 19.2 ETS Table Efficiency Considerations 308 19.3 Creating an ETS Table 309 19.4 Example Programs with ETS 310 19.5 Storing Tuples on Disk 315 19.6 What Haven’t We Talked About? 318 20. Mnesia: The Erlang Database . 321 20.1 Creating the Initial Database 321 20.2 Database Queries 322 20.3 Adding and Removing Data in the Database 326 20.4 Mnesia Transactions 328 20.5 Storing Complex Data in Tables 332 20.6 Table Types and Location 333 20.7 The Table Viewer 336 20.8 Digging Deeper 337 21. Profiling, Debugging, and Tracing . 339 21.1 Tools for Profiling Erlang Code 340 21.2 Testing Code Coverage 341 21.3 Generating Cross-References 342 21.4 Compiler Diagnostics 343 21.5 Runtime Diagnostics 346 21.6 Debugging Techniques 347 21.7 The Erlang Debugger 350 21.8 Tracing Messages and Process Execution 352 21.9 Frameworks for Testing Erlang Code 355 www.it-ebooks.info Contents • x 22. Introducing OTP . 359 22.1 The Road to the Generic Server 360 22.2 Getting Started with gen_server 368 22.3 The gen_server Callback Structure 372 22.4 Filling in the gen_server Template 376 22.5 Digging Deeper 377 23. Making a System with OTP .
Recommended publications
  • Application-Level Virtual Memory for Object-Oriented Systems Mariano Martinez Peck
    Application-Level Virtual Memory for Object-Oriented Systems Mariano Martinez Peck To cite this version: Mariano Martinez Peck. Application-Level Virtual Memory for Object-Oriented Systems. Program- ming Languages [cs.PL]. Université des Sciences et Technologie de Lille - Lille I, 2012. English. tel-00764991 HAL Id: tel-00764991 https://tel.archives-ouvertes.fr/tel-00764991 Submitted on 26 Dec 2012 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. N° d’ordre : 40886 THESE présentée en vue d’obtenir le grade de DOCTEUR en Spécialité : informatique par Mariano MARTINEZ PECK DOCTORAT DELIVRE CONJOINTEMENT PAR MINES DOUAI ET L’UNIVERSITE DE LILLE 1 Titre de la thèse : Application-Level Virtual Memory for Object-Oriented Systems Soutenue le 29/10/2012 à 10h devant le jury d’examen : Président Jean-Bernard STEFANI (Directeur de recherche – INRIA Grenoble- Rhône-Alpes) Directeur de thèse Stéphane DUCASSE (Directeur de recherche – INRIA Lille) Rapporteur Robert HIRSCHFELD (Professeur – Hasso-Plattner-Institut, Universität Potsdam, Allemagne) Rapporteur Christophe DONY (Professeur – Université Montpellier 2) Examinateur Roel WUYTS (Professeur – IMEC & Katholieke Universiteit Leuven, Belgique) co-Encadrant Noury BOURAQADI (Maître-Assistant – Mines de Douai) co-Encadrant Marcus DENKER (Chargé de recherche – INRIA Lille) co-Encadrant Luc FABRESSE (Maître-Assistant – Mines de Douai) Laboratoire(s) d’accueil : Dépt.
    [Show full text]
  • MCP Q4`18 Release Notes Version Q4-18 Mirantis Cloud Platform Release Notes Version Q4`18
    MCP Q4`18 Release Notes version q4-18 Mirantis Cloud Platform Release Notes version Q4`18 Copyright notice 2021 Mirantis, Inc. All rights reserved. This product is protected by U.S. and international copyright and intellectual property laws. No part of this publication may be reproduced in any written, electronic, recording, or photocopying form without written permission of Mirantis, Inc. Mirantis, Inc. reserves the right to modify the content of this document at any time without prior notice. Functionality described in the document may not be available at the moment. The document contains the latest information at the time of publication. Mirantis, Inc. and the Mirantis Logo are trademarks of Mirantis, Inc. and/or its affiliates in the United States an other countries. Third party trademarks, service marks, and names mentioned in this document are the properties of their respective owners. ©2021, Mirantis Inc. Page 2 Mirantis Cloud Platform Release Notes version Q4`18 What’s new This section provides the details about the features and enhancements introduced with the latest MCP release version. Note The MCP integration of the community software projects, such as OpenStack, Kubernetes, OpenContrail, and Ceph, includes the integration of the features which the MCP consumers can benefit from. Refer to the MCP Q4`18 Deployment Guide for the software features that can be deployed and managed by MCP DriveTrain. MCP DriveTrain • Encryption of sensitive data in the Reclass model • Galera verification and restoration pipeline • Jenkins version upgrade • Partitioning table for the VCP images Encryption of sensitive data in the Reclass model SECURITY Implemented the GPG encryption to protect sensitive data in the Git repositories of the Reclass model as well as the key management mechanism for secrets encryption and decryption.
    [Show full text]
  • LIST of NOSQL DATABASES [Currently 150]
    Your Ultimate Guide to the Non - Relational Universe! [the best selected nosql link Archive in the web] ...never miss a conceptual article again... News Feed covering all changes here! NoSQL DEFINITION: Next Generation Databases mostly addressing some of the points: being non-relational, distributed, open-source and horizontally scalable. The original intention has been modern web-scale databases. The movement began early 2009 and is growing rapidly. Often more characteristics apply such as: schema-free, easy replication support, simple API, eventually consistent / BASE (not ACID), a huge amount of data and more. So the misleading term "nosql" (the community now translates it mostly with "not only sql") should be seen as an alias to something like the definition above. [based on 7 sources, 14 constructive feedback emails (thanks!) and 1 disliking comment . Agree / Disagree? Tell me so! By the way: this is a strong definition and it is out there here since 2009!] LIST OF NOSQL DATABASES [currently 150] Core NoSQL Systems: [Mostly originated out of a Web 2.0 need] Wide Column Store / Column Families Hadoop / HBase API: Java / any writer, Protocol: any write call, Query Method: MapReduce Java / any exec, Replication: HDFS Replication, Written in: Java, Concurrency: ?, Misc: Links: 3 Books [1, 2, 3] Cassandra massively scalable, partitioned row store, masterless architecture, linear scale performance, no single points of failure, read/write support across multiple data centers & cloud availability zones. API / Query Method: CQL and Thrift, replication: peer-to-peer, written in: Java, Concurrency: tunable consistency, Misc: built-in data compression, MapReduce support, primary/secondary indexes, security features.
    [Show full text]
  • CONFERENCE COMPANION ESUG 2008 - 16Th International Smalltalk Conference
    ESUG-2008 CONFERENCE COMPANION ESUG 2008 - 16th International Smalltalk Conference CONTENTS Platinum Sponsors.......................................................................................................... 3 Gold Sponsors................................................................................................................ 4 Conference Location....................................................................................................... 5 Program Overview........................................................................................................... 8 Saturday, August 23...................................................................................................... 10 Sunday, August 24......................................................................................................... 10 Monday, August 25....................................................................................................... 11 Tuesday, August 26....................................................................................................... 16 Wednesday, August 27.................................................................................................. 20 Thursday, August 28...................................................................................................... 23 Friday, August 29........................................................................................................... 27 Program Overview........................................................................................................
    [Show full text]
  • Nested Class Modularity in Squeak/Smalltalk
    Springer, Nested Class Modularity in Squeak/Smalltalk Nested Class Modularity in Squeak/Smalltalk Modularität mit geschachtelten Klassen in Squeak/Smalltalk by Matthias Springer A thesis submitted to the Hasso Plattner Institute at the University of Potsdam, Germany in partial fulfillment of the requirements for the degree of Master of Science in ITSystems Engineering Supervisor Prof. Dr. Robert Hirschfeld Software Architecture Group Hasso Plattner Institute University of Potsdam, Germany August 17, 2015 Abstract We present the concept, the implementation, and an evaluation of Matriona, a module system for and written in Squeak/Smalltalk. Matriona is inspired by Newspeak and based on class nesting: classes are members of other classes, similarly to class instance variables. Top-level classes (modules) are globals and nested classes can be accessed using message sends to the corresponding enclosing class. Class nesting effec- tively establishes a global and hierarchical namespace, and allows for modular decomposition, resulting in better understandability, if applied properly. Classes can be parameterized, allowing for external configuration of classes, a form of dependency management. Furthermore, parameterized classes go hand in hand with mixin modularity. Mixins are a form of inter-class code reuse and based on single inheritance. We show how Matriona can be used to solve the problem of duplicate classes in different modules, to provide a versioning and dependency management mech- anism, and to improve understandability through hierarchical decomposition. v Zusammenfassung Diese Arbeit beschreibt das Konzept, die Implementierung und die Evaluierung von Matriona, einem Modulsystem für und entwickelt in Squeak/Smalltalk. Ma- triona ist an Newspeak angelehnt und basiert auf geschachtelten Klassen: Klassen, die, wie zum Beispiel auch klassenseitige Instanzvariablen, zu anderen Klassen gehören.
    [Show full text]
  • Couchbase Server Manual 2.1.0 Couchbase Server Manual 2.1.0
    Couchbase Server Manual 2.1.0 Couchbase Server Manual 2.1.0 Abstract This manual documents the Couchbase Server 2.1.0 series, including installation, monitoring, and administration interface and associ- ated tools. For the corresponding Moxi product, please use the Moxi 1.8 series. See Moxi 1.8 Manual. External Community Resources. Download Couchbase Server 2.1 Couchbase Developer Guide 2.1 Client Libraries Couchbase Server Forum Last document update: 05 Sep 2013 23:46; Document built: 05 Sep 2013 23:46. Documentation Availability and Formats. This documentation is available online: HTML Online . For other documentation from Couchbase, see Couchbase Documentation Library Contact: [email protected] or couchbase.com Copyright © 2010-2013 Couchbase, Inc. Contact [email protected]. For documentation license information, see Section F.1, “Documentation License”. For all license information, see Appendix F, Licenses. Table of Contents Preface ................................................................................................................................................... xiii 1. Best Practice Guides ..................................................................................................................... xiii 1. Introduction to Couchbase Server .............................................................................................................. 1 1.1. Couchbase Server and NoSQL ........................................................................................................ 1 1.2. Architecture
    [Show full text]
  • THE NOTION of DESIGN EMERGENCE EVOLVING YOUR SOFTWARE Who Are We
    THE NOTION OF DESIGN EMERGENCE EVOLVING YOUR SOFTWARE Who Are we 陈永胜 [email protected] @yeongsheng yeongsheng-tan !2 EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE “THE BEST ARCHITECTURES, REQUIREMENTS, AND DESIGNS EMERGE FROM SELF-ORGANIZING TEAMS.” – PRINCIPLES BEHIND THE AGILE MANIFESTO AGENDA ‣ EMERGENT DESIGN ‣ CHOOSE YOUR POISON ‣ SWITCHING OUT AN ARCHITECTURAL LAYER ‣ WHEN RUBBER HITS THE ROAD ‣ SHOW ME THE CODE ‣ Q&A LISTEN, LEARN, UNDERSTAND, ADAPT EMERGENT DESIGN EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE KNOWLEDGE CREATION & PRESERVATION KNOWLEDGE CREATION KNOWLEDGE PRESERVATION EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE WHEN DO YOU HAVE BEST KNOWLEDGE? KNOWLEDGE VS TIME 100 75 50 Knowledge 25 0 AUG SEP OCT NOV DEC Time EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE HYPOTHETICAL KNOWLEDGE VS TIME 100 75 50 Knowledge 25 0 AUG SEP OCT NOV DEC Time EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE REALITY KNOWLEDGE VS TIME 100 75 50 Knowledge 25 0 AUG SEP OCT NOV DEC Time EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE WHAT WE SHOULD STRIVE FOR KNOWLEDGE VS TIME 100 75 50 Knowledge 25 0 AUG SEP OCT NOV DEC Time EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE TRADITIONAL VS EMERGENT Design Implement the initial design (try to make all decisions) TRADITIONAL EMERGENT Design Reflect and (decide an Design/Code Decide Design/Code initial Direction direction) Reflect and Design/Code Decide Direction EVOLVING YOUR SOFTWARE - THE NOTION OF DESIGN EMERGENCE MAKE IT WORK
    [Show full text]
  • Cormac Flanagan Fritz Henglein Nate Nystrom Gavin Bierman Jan Vitek Gilad Bracha Philip Wadler Jeff Foster Tobias Wrigstad Peter Thiemann Sam Tobin-Hochstadt
    PC: Amal Ahmed SC: Matthias Felleisen Robby Findler (chair) Cormac Flanagan Fritz Henglein Nate Nystrom Gavin Bierman Jan Vitek Gilad Bracha Philip Wadler Jeff Foster Tobias Wrigstad Peter Thiemann Sam Tobin-Hochstadt Organizers: Tobias Wrigstad and Jan Vitek Schedule Schedule . 3 8:30 am – 10:30 am: Invited Talk: Scripting in a Concurrent World . 5 Language with a Pluggable Type System and Optional Runtime Monitoring of Type Errors . 7 Position Paper: Dynamically Inferred Types for Dynamic Languages . 19 10:30 am – 11:00 am: Coffee break 11:00 am – 12:30 pm: Gradual Information Flow Typing . 21 Type Inference with Run-time Logs . 33 The Ciao Approach to the Dynamic vs. Static Language Dilemma . 47 12:30 am – 2:00 pm: Lunch Invited Talk: Scripting in a Concurrent World John Field IBM Research As scripting languages are used to build increasingly complex systems, they must even- tually confront concurrency. Concurrency typically arises from two distinct needs: han- dling “naturally” concurrent external (human- or software-generated) events, and en- hancing application performance. Concurrent applications are difficult to program in general; these difficulties are multiplied in a distributed setting, where partial failures are common and where resources cannot be centrally managed. The distributed sys- tems community has made enormous progress over the past few decades designing specialized systems that scale to handle millions of users and petabytes of data. How- ever, combining individual systems into composite applications that are scalable—not to mention reliable, secure, and easy to develop maintain—remains an enormous chal- lenge. This is where programming languages should be able to help: good languages are designed to facilitate composing large applications from smaller components and for reasoning about the behavior of applications modularly.
    [Show full text]
  • Top Functional Programming Languages Based on Sentiment Analysis 2021 11
    POWERED BY: TOP FUNCTIONAL PROGRAMMING LANGUAGES BASED ON SENTIMENT ANALYSIS 2021 Functional Programming helps companies build software that is scalable, and less prone to bugs, which means that software is more reliable and future-proof. It gives developers the opportunity to write code that is clean, elegant, and powerful. Functional Programming is used in demanding industries like eCommerce or streaming services in companies such as Zalando, Netflix, or Airbnb. Developers that work with Functional Programming languages are among the highest paid in the business. I personally fell in love with Functional Programming in Scala, and that’s why Scalac was born. I wanted to encourage both companies, and developers to expect more from their applications, and Scala was the perfect answer, especially for Big Data, Blockchain, and FinTech solutions. I’m glad that my marketing and tech team picked this topic, to prepare the report that is focused on sentiment - because that is what really drives people. All of us want to build effective applications that will help businesses succeed - but still... We want to have some fun along the way, and I believe that the Functional Programming paradigm gives developers exactly that - fun, and a chance to clearly express themselves solving complex challenges in an elegant code. LUKASZ KUCZERA, CEO AT SCALAC 01 Table of contents Introduction 03 What Is Functional Programming? 04 Big Data and the WHY behind the idea of functional programming. 04 Functional Programming Languages Ranking 05 Methodology 06 Brand24
    [Show full text]
  • Designing a Modern XMPP Service with Ejabberd
    ejabberd architecture and challenges in designing a modern messaging service 17th November 2015 Mickaël Rémond <[email protected]> Introduction ejabberd is scalable and versatile enough to adapt to most of the realtime messaging jobs you will want to handle. For many tasks, like corporate messaging, you can consider ejabberd as a standard package. However, to reach high level of scalability and flexibility, you need to consider ejabberd as an XMPP framework. As such, to build your modern messaging system, you need to: Be familiar with XMPP - Prerequisite. Learn ejabberd architecture Learn ejabberd API Work on solution design. Take control of your messaging platform and design it ! ejabberd: Routing messages in a statefull world ejabberd is a message router. Its role is to support real time messaging feature by moving messages from clients to other clients. In that sense it is stateless. However, to integrate in a statefull world, ejabberd has to support statefull features: Stateless: ejabberd is an XMPP server: Its goal is to route XMPP packets between JID. Statefull: In most case ejabberd depends on data (user base, contact list, …) or produce data (message archive, ...) Goal: deploy an ejabberd that is as stateless as possible, by leveraging backends. What are ejabberd backends ? Backends are pluggable modules you can configure to define where you would like to store part or all of your data. Backends provide the data to the feature modules of ejabberd. They can be read-write or read-only if you do not need some of the ejabberd associated features: For example, if you handle user management elsewhere in your infrastructure, you can use a user back-end that can only authenticate users but not create them.
    [Show full text]
  • Making Reliable Distributed Systems in the Presence of Sodware Errors Final Version (With Corrections) — Last Update 20 November 2003
    Making reliable distributed systems in the presence of sodware errors Final version (with corrections) — last update 20 November 2003 Joe Armstrong A Dissertation submitted to the Royal Institute of Technology in partial fulfilment of the requirements for the degree of Doctor of Technology The Royal Institute of Technology Stockholm, Sweden December 2003 Department of Microelectronics and Information Technology ii TRITA–IMIT–LECS AVH 03:09 ISSN 1651–4076 ISRN KTH/IMIT/LECS/AVH-03/09–SE and SICS Dissertation Series 34 ISSN 1101–1335 ISRN SICS–D–34–SE c Joe Armstrong, 2003 Printed by Universitetsservice US-AB 2003 iii To Helen, Thomas and Claire iv Abstract he work described in this thesis is the result of a research program T started in 1981 to find better ways of programming Telecom applica- tions. These applications are large programs which despite careful testing will probably contain many errors when the program is put into service. We assume that such programs do contain errors, and investigate methods for building reliable systems despite such errors. The research has resulted in the development of a new programming language (called Erlang), together with a design methodology, and set of libraries for building robust systems (called OTP). At the time of writing the technology described here is used in a number of major Ericsson, and Nortel products. A number of small companies have also been formed which exploit the technology. The central problem addressed by this thesis is the problem of con- structing reliable systems from programs which may themselves contain errors. Constructing such systems imposes a number of requirements on any programming language that is to be used for the construction.
    [Show full text]
  • CONFERENCE COMPANION ESUG 2008 - 16Th International Smalltalk Conference
    ESUG-2008 CONFERENCE COMPANION ESUG 2008 - 16th International Smalltalk Conference CONTENTS Platinum Sponsors.......................................................................................................... 3 Gold Sponsors................................................................................................................ 4 Conference Location....................................................................................................... 5 Conference Location..................................................................................................... 10 Saturday, August 23...................................................................................................... 10 Sunday, August 24......................................................................................................... 10 Monday, August 25....................................................................................................... 11 Tuesday, August 26....................................................................................................... 16 Wednesday, August 27.................................................................................................. 20 Thursday, August 28...................................................................................................... 23 Friday, August 29........................................................................................................... 27 CWI Page 2 ESUG 2008 -16th International Smalltalk Conference Platinum Sponsors cosmocows Page
    [Show full text]