Erlang System Documentation
v27.0
Pages
Erlang/OTP System Documentation
Installation Guide
Introduction
Building and Installing Erlang/OTP
Introduction
Required Utilities
Optional Utilities
How to Build and Install Erlang/OTP
Advanced configuration and build of Erlang/OTP
Erlang/OTP test architectures
Cross Compiling Erlang/OTP
Introduction
Build and Install Procedure
Building and Installing the Documentation
Testing the cross compiled system
Currently Used Configuration Variables
Building Erlang/OTP on Windows
Introduction
Short Version
Tools you Need and Their Environment
The Shell Environment
Building and Installing
Development
Frequently Asked Questions
Patching OTP Applications
Introduction
Prerequisites
Using otp_patch_apply
Sanity check
Getting Started With Erlang
Introduction
Prerequisites
Omitted Topics
Sequential Programming
The Erlang Shell
Modules and Functions
Atoms
Tuples
Lists
Maps
Standard Modules and Manual Pages
Writing Output to a Terminal
A Larger Example
Matching, Guards, and Scope of Variables
More About Lists
If and Case
Built-In Functions (BIFs)
Higher-Order Functions (Funs)
Concurrent Programming
Processes
Message Passing
Registered Process Names
Distributed Programming
A Larger Example
Robustness
Time-outs
Error Handling
The Larger Example with Robustness Added
Records and Macros
The Larger Example Divided into Several Files
Header Files
Records
Macros
System Principles
System Principles
Starting the System
Restarting and Stopping the System
Boot Scripts
Code Loading Strategy
File Types
Error Logging
Error Information From the Runtime System
Log events from OTP behaviours
Creating and Upgrading a Target System
Creating a Target System
Installing a Target System
Starting a Target System
System Configuration Parameters
Differences From the Install Script
Creating the Next Version
Upgrading the Target System
Listing of target_system.erl
Upgrade when Erlang/OTP has Changed
Introduction
Upgrade of Core Applications
Applications that Still do Not Allow Code Upgrade
Versions
OTP Version
Application Version
Version Scheme
Releases and Patches
OTP Versions Tree
OTP 17.0 Application Versions
Support, Compatibility, Deprecations, and Removal
Introduction
Supported Releases
Compatibility
Deprecation
Removal
OTP Design Principles
Overview
Supervision Trees
Behaviours
Applications
Releases
Release Handling
gen_server Behaviour
Client-Server Principles
Example
Starting a Gen_Server
Synchronous Requests - Call
Asynchronous Requests - Cast
Stopping
Handling Other Messages
gen_statem Behaviour
Event-Driven State Machines
When to use gen_statem
Callback Module
Callback Modes
State Callback
Transition Actions
Event Types and Event Content
State Enter Calls
Time-Outs
Example
Starting gen_statem
Handling Events
State Time-Outs
All State Events
One State Callback
Stopping
Event Time-Outs
Generic Time-Outs
Erlang Timers
Postponing Events
State Enter Actions
Inserted Events
Example Revisited
Filter the State
Complex State
Hibernation
gen_event Behaviour
Event Handling Principles
Example
Starting an Event Manager
Adding an Event Handler
Notifying about Events
Deleting an Event Handler
Stopping
Handling Other Messages
Supervisor Behaviour
Supervision Principles
Example
Supervisor Flags
Restart Strategy
Maximum Restart Intensity
Automatic Shutdown
Child Specification
Starting a Supervisor
Adding a Child Process
Stopping a Child Process
Simplified one_for_one Supervisors
Stopping
sys and proc_lib
Simple Debugging
Special Processes
User-Defined Behaviours
Applications
Application Concept
Application Callback Module
Application Resource File
Directory Structure
Application Controller
Loading and Unloading Applications
Starting and Stopping Applications
Configuring an Application
Application Start Types
Included Applications
Introduction
Specifying Included Applications
Synchronizing Processes during Startup
Distributed Applications
Introduction
Specifying Distributed Applications
Starting and Stopping Distributed Applications
Failover
Takeover
Releases
Release Concept
Release Resource File
Generating Boot Scripts
Creating a Release Package
Directory Structure
Release Handling
Release Handling Principles
Requirements
Distributed Systems
Release Handling Instructions
Application Upgrade File
Release Upgrade File
Installing a Release
Updating Application Specifications
Appup Cookbook
Changing a Functional Module
Changing a Residence Module
Changing a Callback Module
Changing Internal State
Module Dependencies
Changing Code for a Special Process
Changing a Supervisor
Adding or Deleting a Module
Starting or Terminating a Process
Adding or Removing an Application
Restarting an Application
Changing an Application Specification
Changing Application Configuration
Changing Included Applications
Changing Non-Erlang Code
Runtime System Restart and Upgrade
Programming Examples
Introduction
Records
Records and Tuples
Defining a Record
Creating a Record
Accessing a Record Field
Updating a Record
Type Testing
Pattern Matching
Nested Records
A Longer Example
Funs
map
foreach
Syntax of Funs
Variable Bindings Within a Fun
Funs and Module Lists
Funs Returning Funs
List Comprehensions
Simple Examples
Quick Sort
Permutations
Pythagorean Triplets
Simplifications With List Comprehensions
Variable Bindings in List Comprehensions
Bit Syntax
Introduction
Lexical Note
Segments
Defaults
Constructing Binaries and Bitstrings
Matching Binaries
Appending to a Binary
Erlang Reference Manual
Introduction
Purpose
Prerequisites
Document Conventions
Complete List of BIFs
Reserved Words
Character Set and Source File Encoding
Character Set
Source File Encoding
Data Types
Terms
Number
Atom
Bit Strings and Binaries
Reference
Fun
Port Identifier
Pid
Tuple
Map
List
String
Sigil
Record
Boolean
Escape Sequences
Type Conversions
Pattern Matching
Pattern Matching
Modules
Module Syntax
Module Attributes
The feature directive
Comments
module_info/0 and module_info/1 functions
Documentation
Documentation metadata
External documentation files
Documenting a module
Documenting functions, user-defined types, and callbacks
Links in Markdown
What is visible versus hidden?
Compiling and getting documentation
Using ExDoc to generate HTML/ePub documentation
Functions
Function Declaration Syntax
Function Evaluation
Tail recursion
Built-In Functions (BIFs)
Types and Function Specifications
The Erlang Type Language
Types and their Syntax
Type Declarations of User-Defined Types
Type Information in Record Declarations
Specifications for Functions
Opaques
Opaque Type Aliases
Expressions
Expression Evaluation
Terms
Variables
Patterns
The Match Operator
The Match Operator and the Compound Pattern Operator
Function Calls
If
Case
Maybe
Send
Receive
Term Comparisons
Arithmetic Expressions
Boolean Expressions
Short-Circuit Expressions
List Operations
Map Expressions
Bit Syntax Expressions
Fun Expressions
Catch and Throw
Try
Parenthesized Expressions
Block Expressions
Comprehensions
Guard Sequences
Guard Expressions
Operator Precedence
Preprocessor
File Inclusion
Defining and Using Macros
Predefined Macros
Macros Overloading
Removing a macro definition
Conditional Compilation
The -feature() directive
-error() and -warning() directives
Stringifying Macro Arguments
Records
Defining Records
Creating Records
Accessing Record Fields
Updating Records
Records in Guards
Records in Patterns
Nested Records
Internal Representation of Records
Errors and Error Handling
Terminology
Exceptions
Handling of Run-time Errors in Erlang
Exit Reasons
Features
Life cycle of features
Enabling and Disabling Features
Preprocessor Additions
Information about Existing Features
Existing Features
Processes
Processes
Process Creation
Registered Processes
Process Aliases
Process Termination
Signals
Links
Error Handling
Monitors
Process Dictionary
Distributed Erlang
Distributed Erlang System
Nodes
Node Connections
epmd
Hidden Nodes
Dynamic Node Name
C Nodes
Security
Distribution BIFs
Distribution Command-Line Flags
Distribution Modules
Compilation and Code Loading
Compilation
Code Loading
Code Replacement
Running a Function When a Module is Loaded
Ports and Port Drivers
Ports
Port Drivers
Port BIFs
Efficiency Guide
Introduction
Purpose
Prerequisites
Common Caveats
Operator ++
Timer Module
Accidental Copying and Loss of Sharing
list_to_atom/1
length/1
setelement/3
size/1
Using NIFs
Constructing and Matching Binaries
How Binaries are Implemented
Constructing Binaries
Matching Binaries
Maps
Maps or Records?
Using Maps as an Alternative to Records
Using Maps as Dictionaries
Using Maps as Sets
How Maps are Implemented
Using the Map Syntax
Using the Functions in the maps Module
List Handling
Creating a List
List Comprehensions
Deep and Flat Lists
Recursive List Functions
Functions
Pattern Matching
Function Calls
Tables and Databases
Ets, Dets, and Mnesia
ETS
Mnesia
Processes
Creating an Erlang Process
Sending Messages
Receiving messages
Literal Pool
Loss of Sharing
SMP Run-Time System
Drivers
Drivers and Concurrency
Avoiding Copying Binaries When Calling a Driver
Returning Small Binaries from a Driver
Returning Large Binaries without Copying from a Driver
Memory Usage
System Limits
Profiling
Never Guess About Performance Bottlenecks
Memory profiling
Large Systems
What to Look For
Tools
Benchmarking
Using erlperf
Benchmarking using Erlang/OTP functionality
Interoperability Tutorial
Introduction
Purpose
Prerequisites
Overview
Built-In Mechanisms
C and Java Libraries
Standard Protocols
IC and CORBA
Problem Example
Description
Ports
Erlang Program
C Program
Running the Example
Erl_Interface
Erlang Program
C Program
Running the Example
Port Drivers
Erlang Program
C Driver
Running the Example
C Nodes
NIFs
Erlang Program
NIF Library Code
Running the Example
Debugging NIFs and Port Drivers
With great power comes great responsibilty
Debug emulator
Address Sanitizer
Valgrind
rr - Record and Replay
OAM Principles
Introduction
Terminology
Model
SNMP-Based OAM
Embedded Systems User's Guide
Introduction
Installing an Embedded System
Starting Erlang
Programs
Search documentation of Erlang System Documentation
Settings
View Source
C Nodes
The reader is referred to
the erl_interface users guide
for information about how to create C nodes.
← Previous Page
Port Drivers
Next Page →
NIFs
×