Skip to content

REPL: line editing, history, and observer-native display (port the EigenOS editor) #392

Description

@InauguralPhysicist

Why. The CLI REPL is a bare fgets loop (src/main.c, eigenscript_repl) — pressing up-arrow prints ^[[A. It is the single worst first-five-minutes signal for anyone arriving from Python/Node, and the REPL is the natural teaching surface for the observer niche (prev of x / why of x / stable of x on live session bindings). The fix already exists in-tree at EigenOS, whose REPL has history + cursor editing — this is the downstream-gap-surfaces-upstream rule applied to our own port.

What.

  • Extract the loop into src/repl.c; add a zero-dependency raw-termios line editor (linenoise-style, ~300 lines in-tree — do NOT link readline/libedit; the zero-dep invariant is load-bearing for embedding).
  • History (in-memory + history file), arrow keys, cursor editing; tab completion over builtins + current top-level bindings.
  • Observer-native touches: temporal interrogatives work on session bindings; optionally print a trajectory glyph next to values.
  • Non-tty stdin path byte-identical to today (the suite pipes scripts through the binary).

Acceptance. Interactive session supports history/arrows/editing; suite-gated REPL transcript test (tests/test_repl.sh); make output has zero new link dependencies; piped/non-tty behavior unchanged.

Effort: days. Source: 2026-07-04 language-strategy survey (tooling + learnability dimensions; ranked top impact/effort in the whole study).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions