Erlang/OTP

repository·master·Indexed 11 days ago

https://github.com/erlang/otp

A programming language and runtime system designed for building highly available, massively scalable, soft real-time systems. OTP (Open Telecom Platform) provides the essential libraries and design principles that power the Erlang ecosystem, including the Erlang runtime system and ready-to-use components.

Tokens
147K
Snippets
563
Records
1.1K
Agent score
94%

What's inside Erlang/OTP

  1. What is Yielding C Fun (YCF)?

    master

    Yielding C Fun (YCF) is a source-to-source transformation tool that converts a subset of C functions into yieldable functions (coroutines). These functions can be suspended, paused, or trapped and then resumed at a later point.

    Unlike standard coroutine libraries, YCF performs a source-to-source transformation, allowing it to save call stack variables without relying on platform-specific code. It is primarily designed to simplify the implementation of yielding Erlang NIFs (Native Implemented Functions) and BIFs (Built-in Functions).

  2. What is Erlang and OTP

    master

    Erlang is a programming language and runtime system designed for building massively scalable, soft real-time systems with high availability requirements.

    OTP (Open Telecom Platform) is a set of Erlang libraries that includes the Erlang runtime system, ready-to-use components (primarily written in Erlang), and a set of design principles for Erlang programs.

  3. Overview of the SNMP Application

    master

    The snmp application in OTP provides a suite of services for working with the Simple Network Management Protocol (SNMP). It includes:

    • A multilingual extensible SNMP agent: For implementing SNMP agents that can support multiple languages and extensions.
    • A SNMP manager: For managing remote SNMP agents.
    • A MIB compiler: For compiling Management Information Base (MIB) files.
  4. Overview of EUnit unit testing framework

    master

    EUnit is a lightweight, powerful, and flexible unit testing framework for Erlang. It is designed with small syntactical overhead and uses techniques adapted for functional and concurrent programming.

    Key characteristics:

    • Non-intrusive: Uses preprocessor macros designed to avoid conflicts with existing code. Adding tests to a module typically doesn't require changing existing code.
    • Separation of concerns: Tests for exported functions can be placed in a completely separate module to avoid any conflicts with the implementation module.
    • Versatility: Supports testing various 'units' such as functions, modules, processes, or entire applications.
  5. Start and control linked Erlang nodes with the peer module

    master

    The peer module is used to start and manage 'peer' nodes—newly started Erlang nodes that are linked to an 'origin' node. A peer node automatically terminates if it loses its control connection to the origin.

    Control connections can be:

    • Erlang distribution connections.
    • Alternative connections like standard_io or TCP, which allow remote procedure calls (RPC) even if Erlang Distribution is unavailable. This is useful for testing the distribution itself.

    Key behaviors:

    • I/O Redirection: If using a standard_io connection, terminal input/output and console output are relayed through the origin. This allows for debugging node startup and boot scripts using -init_debug.
    • File I/O: Unlike m:slave, file I/O is not redirected.
    • Environment: When starting a peer on the same host, it inherits the current directory and environment variables from the origin.
    • Deployment: Peers can be started on the same host, via ssh on a different host, or within separate containers (e.g., Docker).
  6. Supported Architectures and Operating Systems for Erlang/OTP

    master

    Erlang/OTP is tested on a variety of hardware architectures and operating systems. While this list is not exhaustive, it represents the primary environments where the software is verified to work.

    Architectures:

    • x86, x86-64
    • Aarch32, Aarch64
    • powerpc, powerpc64le
    • Apple M1, M2, M2 Pro

    Operating Systems:

    • Fedora 31
    • FreeBSD
    • macOS 13 - 14
    • MontaVista 4
    • NetBSD
    • OpenBSD
    • SLES 10, 11, 12
    • SunOS 5.11
    • Ubuntu 10.04 - 22.04
    • Windows 11, Windows 10, Windows Server 2019
  7. Review ERTS Release Notes for bug fixes and improvements

    master
    The ERTS (Erlang Runtime System) release notes document fixes for critical issues such as emulator crashes during garbage collection, memory allocation failures, and BIF behavior corrections. They also track improvements to system flags, platform support (macOS, FreeBSD), and driver compilation settings.
  8. Understand the structure of Erlang/OTP documentation

    master

    Erlang/OTP documentation is categorized into four main sections:

    1. Erlang module reference documentation: Detailed documentation for specific Erlang modules.
    2. User's Guides and other reference manuals: Guides for configuration files, command line tools, etc.
    3. Release notes and project metadata: Information regarding deprecations, removals, and other project changes.
    4. Internal documentation: Technical details describing how various parts of Erlang/OTP work (not intended for end-users).

    User-facing documentation (sections 1-3) is rendered using ex_doc and follows specific Markdown flavors and style rules.

  9. Overview of Erlang's Ryu implementation

    master

    Erlang uses a specialized version of the Ryu algorithm for converting doubles to strings. The implementation is stripped down to the bare minimum to provide the shortest algorithm with the widest lookup table.

    Key implementation details for developers:

    • String Generation: The code that produces the final string is removed from the Ryu core; instead, Erlang uses a modified version of to_chars from the MS STL.
    • Buffer Management: Erlang generates a 256-byte buffer for the operation, though a maximum of 30 bytes is typically required. Warning: When refactoring, be aware that MS STL pointer checks are not present in this version.
    • Zero Case: The Zero case in common.h is modified to correspond to the Erlang fixed-point version.
    • Build System: This component is built using its own dedicated Makefile.
  10. NIF Library Reloading Deprecation

    master

    The NIF library reload feature is deprecated. You are only permitted to make one successful call to erlang:load_nif/2 for each module instance. Subsequent calls will return {error, {reload, _}}.

    To perform a runtime upgrade of a NIF library, use the standard Erlang module upgrade mechanics, allowing both the current and old module instances (and their corresponding NIF libraries) to exist simultaneously.