I/O, Modules, Capabilities, and Explicit Effects

The pure executable profile keeps host effects outside ordinary evaluation and exposes only pinned output behavior in the reference runtime.

When this matters

This page sets the line between deterministic guest evaluation and host effects. Use the built-in output procedures for explicit text output; keep files, network, time, randomness, and external actions in the calling application.

See it run

LISPEX
(begin (display "answer=") (write 42) (newline) 0)

Observed result

OUTPUT
answer=42
0

Read the example

display writes string contents, write uses canonical guest notation for 42, and newline appends one line break. println is exactly display followed by that line break. The final 0 is the program result printed by the CLI, so it appears after the explicit output.

How to reason about it

  • display leaves strings unquoted and prints characters as glyphs; write uses round-readable quotes, escapes, and character notation.
  • All four procedures return zero values. Explicit output stays ordered with CLI auto-print, while receipts keep completed root values as a separate projection.
  • Output already written remains visible if a later expression fails.
  • CLI file/stdin selection and source labels are invocation concerns, not new language bindings.
  • External capabilities must be explicit and versioned rather than discovered by a host-global fallback.

Choose quickly

OperationAvailable inside Lispex?Alternative
canonical value outputyes: writeuse when round-readable notation matters
human-oriented text outputyes: display, newline, printlnorder is deterministic
file or network accessnoperform it in an explicit calling boundary
clock or randomnessnosupply a chosen value as input
external action from a decisionnoauthorize and execute it in consumer code

A common mistake

Ports, filesystem, networking, time, randomness, and unrestricted host evaluation are not in the current pure profile.

Current boundaries

  • The output buffer is bounded. There are no ambient ports, files, or network handles behind these procedures.
  • Target-language emission is not a Lispex execution mode.

Keep going

Choosing a Runtime shows which product surface fits the host boundary. Decision Rules shows how to return labelled data instead of performing an action.

Choosing a runtime · Decision rules