Beamtalk API Reference

The standard library for Beamtalk, where everything is a message send.

See each class page for full API documentation and usage examples.

Choosing a Base Class

When defining a new class, pick one of these three base classes:

Base classWhen to use
ObjectGeneral-purpose reference types — containers, handles, exceptions, and anything with mutable or I/O-bearing state.
ValueImmutable scalar value types — Boolean, Number, DateTime, Regex, CompiledMethod, StackFrame. Equality is structural; instances are interchangeable.
ActorStateful concurrent objects backed by a gen_server process. Use when an object must own private state and handle concurrent messages safely.

Choosing a Sequence

Three core sequence types, each tuned for a different access pattern:

TypeUse forindexed at:grows?
Listsequential / streaming / stack-like — the defaultO(n)yes (O(1) prepend)
Arrayrandom access by position; size known up frontO(log n), persistent at:put:no (fixed size)
TupleErlang/OTP FFI interop only — not a general-purpose collection

Reach for List by default; switch to Array when you index or update by position (build one from a list with aList asArray). Array is canonical (content-based =:=/hash), so it works as a Dictionary/Set key.

Class Hierarchy

  • ProtoObject Root of the Beamtalk class hierarchy.
    • Erlang Gateway to the BEAM ecosystem.
    • ErlangModule Proxy for calling functions on a specific Erlang module.
    • Object Base class for all Beamtalk objects.
      • Actor Base class for process-based objects.
        • ClassBuilder Fluent builder for creating and registering Beamtalk classes.
        • ReactiveSubprocess Actor for push-mode subprocess delivery.
        • Server Abstract Actor subclass for BEAM-level OTP interop.
        • Subprocess Actor for interactive bidirectional communication with OS processes.
        • TimeoutProxy Transparent forwarding proxy with configurable timeout.
        • TranscriptStream Per-workspace shared log with pub/sub semantics.
      • AnnouncementNavigation live subscription-graph introspection queries
      • Announcer a typed pub/sub dispatcher handle (ADR 0093 Layer 2).
      • AtomicCounter named integer counter backed by ETS for lock-free increments.
      • BeamtalkInterface Workspace-level reflection and class registry.
      • Behaviour Abstract superclass of all class-describing objects.
        • Class A concrete class in the Beamtalk system.
          • Metaclass The class of all metaclass objects in the Beamtalk system.
      • BindingsView a live, Dictionary-protocol view over session or workspace
      • Block First-class closures (anonymous functions).
      • Console the running process's standard I/O (ADR 0099 §1).
      • DynamicSupervisor Abstract base class for dynamic OTP supervision trees.
      • Ets shared in-memory table for actor state sharing.
      • Exception Base class for all exceptions.
      • File File system operations.
      • FileHandle a handle to an open file.
      • Inspector a live, immutable cursor for navigating into a single object
      • Json JSON encoding and decoding.
      • Logger structured logging via Erlang's logger.
      • OS shell command execution.
      • Pid BEAM process identifier.
      • Port BEAM port identifier.
      • Program the running program/invocation (ADR 0099 §2).
      • Protocol Runtime protocol registry queries (ADR 0068 Phase 2c).
      • Reference BEAM unique reference.
      • Session a first-class handle to a REPL session (ADR 0081).
      • Stream Lazy, closure-based sequences.
      • Subscription the unsubscribe token returned by `when:do:` et al (ADR 0093).
      • Supervisor Abstract base class for static OTP supervision trees.
      • Symbol Atomic identifiers.
      • System OS environment, platform detection, and process info.
      • SystemNavigation Class-registry navigation queries ("who implements X",
      • TestResult Structured result from running a test suite.
      • TestRunner Programmatic test execution returning structured results.
      • Time current time accessors.
      • Timer schedule delayed and repeating work via Erlang timer primitives.
      • Tracing Actor observability, trace context, and performance telemetry.
      • UndefinedObject The absence of a value.
      • Value Base class for immutable value types.
        • Announcement base event type for the typed Observer substrate (ADR 0093).
          • ActorSpawned system event announced when a Beamtalk actor starts (ADR 0093).
          • ActorStopped system event announced when a Beamtalk actor terminates (ADR 0093).
          • BindingChanged system event announced when a workspace binding changes (ADR 0093).
          • ClassLoaded system event announced when a class is loaded or redefined (ADR 0093).
          • ClassRemoved system event announced when a class is removed (ADR 0093).
          • FlushCompleted system event announced when `Workspace flush` finishes (ADR 0093).
          • ObjectStateChanged system event announced when a *watched* actor commits a
          • SupervisionChildAdded system event announced when a supervisor starts a
          • SupervisionChildCrashed system event announced when a supervised child
        • Boolean Abstract superclass for True and False.
          • False The false boolean value.
          • True The true boolean value.
        • ChangeEntry One recorded in-memory method mutation (ADR 0082 Phase 1).
        • ChangeLog Navigable view of the workspace's pending in-memory changes
        • Collection Abstract superclass for all collections.
          • Array Fixed-size indexed collection with O(log n) random access.
          • Bag Immutable multiset (unordered collection allowing duplicate elements).
          • Binary byte-level data and serialization.
            • String UTF-8 text operations.
          • Dictionary Immutable key-value collection.
          • Interval An arithmetic sequence of integers.
          • List Ordered collection of elements.
          • Set Unordered collection of unique elements.
          • Tuple Erlang interop type for fixed-size heterogeneous collections.
        • CompiledMethod Method introspection object.
        • DateTime UTC date and time via Erlang calendar/os modules.
        • InspectorField an immutable record for one drillable field of an inspected
        • Number Abstract superclass for numeric types.
          • Float Floating-point arithmetic and operations.
          • Integer Whole number arithmetic and operations.
            • Character Unicode character (codepoint) wrapper.
        • Package First-class package reflection for the Beamtalk system.
        • ProcessNavigation live supervision-tree introspection queries (ADR 0092).
        • Queue O(1) amortised FIFO queue backed by Erlang's `:queue` module.
        • Random Random number generation.
        • Regex Compiled regular expressions via Erlang re module (PCRE2).
        • Result Value type for expected success/failure outcomes (ADR 0060).
        • StackFrame A single frame in an exception stack trace.
        • SubscriptionNode an immutable snapshot record for one live subscription on
        • SupervisionNode an immutable snapshot record for one process in the live
        • SupervisionSpec Value type describing how to start an actor as a supervised child.
        • SupervisionTree a navigable snapshot of the live supervision tree (ADR 0092).
        • TestCase Base class for BUnit test cases.
      • WorkspaceInterface Per-workspace actor introspection and binding container.

All Classes