deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (hnrss.org)

e is a self-aware Emacs-like editor built from R6RS libraries in Chez Scheme

A console editor called e implements Emacs-style buffers, windows and search as Chez Scheme R6RS libraries, with a hot-reloading module system and a live Scheme top level exposed through M-x.

e is a self-aware Emacs-like editor built from R6RS libraries in Chez Scheme

A small editor written in Chez Scheme

A project called e, published on GitHub by its author paveluv and featured on the Hacker News front page, is a compact console text editor written entirely in Chez Scheme. According to the project's README, it is Emacs-like in spirit but explicitly not an Emacs clone: it takes the ideas that stay small — buffers, split windows, a kill ring, incremental search, a live Scheme top level — and stops there.

The editor is a set of R6RS libraries

The architectural choice is what makes e unusual. The README describes the whole editor as a Scheme system in which everything is an R6RS library: a minimal core that publishes an immutable API, and extension modules for syntax modes, bracket matching, editing helpers, and even the M-x command mechanism itself, all layered on that core. Boundaries are enforced by the language rather than by convention — internals are invisible from outside, and exported bindings cannot be reassigned.

Live evaluation and hot reloading

M-x runs Scheme expressions against the editor's live top level, with symbol completion, parameter hints while typing, a command history, and a transcript buffer. The author states that e is developed from inside itself: saving a module's source within the editor reloads it into the running session, and files edited elsewhere are picked up with a reload-module! call. When a module reloads, registrations are replaced and dependent modules recompile while open buffers stay in place.

Everyday editing features

The feature set covers familiar ground. C-x C-f opens a file in its own buffer, C-x 2 and C-x 3 split the current window, and each window keeps its own point, scroll position and status line. C-s starts an incremental search with Emacs-style smart case handling: matching is case-insensitive only while the search string is all lowercase, and a single typed capital switches to exact matching. M-% performs an always-exact query-replace.

Undo is unusually verbal: the README says each undo step reports what it did, such as undoing an insertion of "hello" or a replace-all from "xx" to "yy". Consecutive typed characters coalesce into one step, a paste is a single step, and an M-x command is one labelled step.

Indentation is the one formatting rule the editor enforces; spacing within a line is left to the author, and lines are never joined or split. scheme-mode supplies Emacs-like indentation, TAB cycles a line through its indent stops, and format-buffer! additionally widens tabs, trims trailing whitespace and applies bracket conventions — square brackets for let-family bindings and cond-style clauses, parentheses elsewhere. The same rules live in a standalone (scheme-format) library that also drives a command-line formatter.

Deployment model

There are no dependencies beyond Chez Scheme and a Unix-like terminal, and no build or installation step: a checkout runs in place, compiling its libraries on first start and starting in roughly 100 ms afterwards. Each installation is self-contained — the loader only uses the lib/ directory next to the script and compiled objects stay local — so e can be vendored into a repository, letting anyone who clones that project get a working editor with it. Project-specific modules dropped into a vendored copy's lib/ directory stay local to that project. One platform note: on FreeBSD, where the Chez port renames the interpreter, the launcher's shebang line needs adjusting.

Key bindings can be rebound from a config.e file, and C-h k explains a key, where its binding came from, and its contextual meanings — part of why the author describes the editor as self-aware.

Why it matters

Emacs demonstrated that an editor can be a language runtime with a user interface on top, but its extension model long predates modern module systems. e is an experiment in rebuilding that idea on R6RS libraries, where the module system — not discipline — keeps the core immutable and the internals hidden. Combined with Chez Scheme's fast native compilation, it offers near-instant startup, and the vendoring model lets projects ship a consistent editor with zero setup. For anyone curious how far a small, principled Lisp system can go as a daily editor, e is a compact and readable answer.

  • #scheme
  • #chez-scheme
  • #text-editor
  • #open-source
  • #r6rs

Related posts