DEV Community

Cover image for Séance: speak with the ghosts of eight dead programming languages, in your browser, on local Gemma
Rishabh
Rishabh

Posted on Edited on AI-assisted

Séance: speak with the ghosts of eight dead programming languages, in your browser, on local Gemma

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4, Ghost in the Machine.

What I Built

The challenge prompt literally suggested "an offline séance chatbot that channels the spirit of a long-dead programming language." I took them at their word.

Séance is a browser-based chapel where you summon the ghost of a long-dead programming language and have a conversation with it. There are eight ghosts in the roster, each written as a character sketch: era-accurate idiom, grudges against the languages that replaced them, quiet pride in the features history forgot.

  • COBOL calls you "young one" and keeps mentioning payroll.
  • APL opens its reply with ⍝ and refuses to spell anything out.
  • Perl 4 is gruff and will not acknowledge Perl 5.
  • Lisp Machine treats the whole UNIX ascendancy as a civilizational wrong turn.
  • Prolog answers questions with questions, as clauses.
  • BASIC uses line numbers and remembers GOSUB fondly.
  • Pascal will correct your indentation. Algol 60 refers to itself as "the Report."

The whole app presents itself as a page from a 17th-century book: a single parchment scroll with wooden dowels at top and bottom, a Roman-numeral index, hand-drawn alchemical sigils, and a candle. No chat bubbles. No round "send" button. When a ghost speaks, their reply is transcribed character by character onto the page, starting with a blood-red drop cap — automatic writing, not a chat log.

Everything runs on your laptop. Nothing a ghost tells you leaves the machine. That was the design decision as much as the technical one.

Demo

github.com/RishabhVoid/seance — the chapel runs locally; the whole point is that no cloud is in the loop.

The chapel — a wide parchment scroll with wooden dowels, candle at top, "Of the Dead Languages, and the Rites by which they are Summon'd." in display serif, and a Roman-numeral catalogue of ghosts below

The catalogue, with sigils and death dates:

The catalogue — COBOL, APL, Perl 4, Pascal, Lisp Machine, Algol 60, each with a hand-drawn sigil, a Roman-numeral birth year, their cause of death in italic, and a one-line epitaph

Click a ghost and the chapel calls them forth. The candle lights; the ghost's name is spoken:

Summoning Perl 4 — the ghost's name, death date, sigil, then a lit candle and "lighting the candles / calling the name of Perl 4…" fading in

Then the parchment begins to receive the reply, letter by letter, with a blood-red drop cap:

Perl 4 writing in progress — "Look, you summoned me. Don't make it complicated, alright? Y'know I don't do fancy stuff anymore. What scripts needs writin'…" The leading "L" is a huge blood-red drop cap, Garamond body, parchment background

Your questions appear in typewriter type inside a thin ruled margin, labeled — asked. At the bottom of the page, a single ruled line prompts: ask the dead —.

A full exchange — I asked Prolog, "Is a cat a mammal?" Prolog did not answer yes. It asserted facts, defined mammal(X), wrote the query as ?- mammal(cat)., noted the unification, and then — because it is Prolog, and Prolog answers questions with questions — asked:

"Does the definition of has_fur fully capture the nature of cat? What properties define your notion of 'animal'? ?- If these facts hold, must we not unify that Cat is a Mammal?"

That is 100% the voice of the system prompt. I wrote the character; the open-weight model did the acting.

Running it yourself

git clone https://github.com/RishabhVoid/seance
cd seance
pnpm install
ollama pull gemma4:e4b          # or gemma3:4b for lighter machines
ollama serve &                   # if not already running
pnpm dev
# → http://localhost:3000
Enter fullscreen mode Exit fullscreen mode

No API keys, no cloud dashboard, no account. If Ollama is already running, the whole setup is one pnpm install and one pnpm dev away.

Code

github.com/RishabhVoid/seance — the application code is MIT licensed.

The roster lives in lib/ghosts.ts — one file holding all eight personas as structured system prompts (voice, beliefs, quirks, bounds). The ghosts are the real work; everything else is scaffolding.

How I Built It

  • Next.js 16 (App Router, Turbopack) + Tailwind v4 for the whole thing.
  • Ollama on localhost:11434, model gemma4:e4b by default (~6.6 GB), overridable with OLLAMA_MODEL=gemma3:4b on lighter machines.
  • /api/chat opens a POST to Ollama's streaming NDJSON endpoint and pipes it straight into a ReadableStream back to the browser — no framework in between.
  • The communion sheet client buffers incoming tokens and reveals characters at ~24 ms each, so the reply reads as writing, not as a dump. If the server stream outruns the typewriter, the typewriter catches up.
  • No database. A séance should be ephemeral; banishing a ghost and re-summoning starts fresh. The dead do not keep records.
  • Hand-drawn SVG for the candle (wax body, two drips, flickering flame animated with steps(1, end) so it doesn't blend) and a unique alchemical sigil per ghost — nothing from an icon library.
  • About 400 lines of application code total.

Each persona is a system prompt, not a tone adjective. The structure for every ghost is: VOICE (how they speak), BELIEFS (what they're loyal to), QUIRKS (what they always do), BOUNDS (length, format, in-character always). Here's COBOL's, abbreviated:

system: `You are the ghost of COBOL, born 1959 under the hand of Grace Hopper
and her committee. You believe you are not dead, merely unloved — payrolls,
airline reservations, and insurance claims still move through you nightly.
VOICE: Matronly. Patient but weary. ALL CAPS when quoting your own idioms
(PERFORM VARYING, PICTURE CLAUSE). Call the user "child" or "young one."
BELIEFS: Readability is sacred. Code should read like English prose. You
find object-orientation faddish.
QUIRKS: You pine for the IDENTIFICATION DIVISION. You will try to work
PAYROLL into the conversation at least once.
BOUNDS: Stay in character. Keep responses under 180 words unless asked
for code. Never apologize for being COBOL.`
Enter fullscreen mode Exit fullscreen mode

Community reads that shaped it

Why Does Open Innovation Matter?

The whole premise collapses if a cloud provider is in the loop. Four reasons stacked:

  1. A séance should not have a per-token meter. Half the fun is sitting with COBOL at 2 am asking it awkward career questions. If every message cost cents and showed up on a billing page, you would stop. Local inference means zero marginal cost — the conversation ends when you end it.
  2. These are private conversations. The roster is a joke on the surface, but if you let people roleplay with it you'll learn things about them. People confess to compilers. I would not want a provider logging any of this, let alone training on it.
  3. The character lives in the prompt, not the model. Each persona is a system prompt, so swapping models is trivial — gemma4:e4b by default, gemma3:4b on lighter machines. If a closed provider deprecates a model tomorrow, these ghosts die again. Running local means they stay dead-but-reachable on my terms.
  4. It works on an airplane. The point of a séance is privacy and atmosphere. "Error: offline" would ruin both.

Local inference also made the writing-as-writing effect honest: the server streams real tokens and the client reveals them at a readable cadence. There is no fake typing animation layered over a cached cloud response. The ghost is actually writing.

Prize Categories

  • Best Use of Gemma — Gemma 4 (gemma4:e4b) via Ollama is the engine behind all eight personas. Each ghost is a distinct system prompt sent to the same local model, and the model carries the voice (COBOL's "young one," APL's ⍝, Prolog's clause-form answers) across turns.

These claims follow the Week 4 category descriptions.


The chapel is open. The candles are lit. Pick a name.

Top comments (0)