# Ouija Compiler: Talk with Dead Languages

> Source: <https://dev.to/mrayan980/ouija-compiler-talk-with-dead-languages-4bd9>
> Published: 2026-11-01 04:49:45+00:00

*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*

Séance is a terminal app where you talk to the ghosts of dead programming languages. Ask how to loop in COBOL, read a file in Fortran, or build a record in Pascal, and the spirit answers in eerie prose plus a complete program. Ask about a living language and the veil stays closed: it refuses, in character.

For the theme, I wanted to honor the past: languages that people stopped teaching but whose code is still out there. A ghost that makes things up is useless, though, and small open models are shaky on obscure syntax. So every answer is checked: the code is **compiled and run with a real compiler** before you see it.

```
You > How do I loop 5 times in COBOL?

📜 Scrolls consulted (vector): Loops: PERFORM VARYING, PERFORM UNTIL, PERFORM TIMES, ...

👻 COBOL:
The candlelight flickers, casting elongated shadows across the ancient mainframes...

✅ Verified: compiled (free-format) and ran cleanly.
   Output:
   | Iteration: 00
   | Iteration: 01
   | Iteration: 02
   | Iteration: 03
   | Iteration: 04
```

A local AI medium that only answers questions about dead or legacy languages. It replies
in spooky prose plus working code, and the code is **compiled and run for real** before
you see it. Everything runs on your machine with open-weight models (Ollama).

``` php
question -> gate -> RAG (reference scrolls) -> local LLM -> compile & run -> (error -> retry) -> answer
```

| File | Job | 
|---|---|
| `gate.py` | Only dead languages pass. Alias match first, local-LLM classifier as fallback | 
| `rag.py` | Chunks `knowledge/*.md` , SQLite index, vector search (Ollama embeddings) with automatic offline BM25 fallback | 
| `verify.py` | Extracts the code block, compiles with the real toolchain, runs it with limits | 
| `seance.py` | The loop: retrieve, generate, verify, repair, print. Run this one | 
| `knowledge/` | Reference "scrolls" for COBOL, Fortran, Pascal (every snippet is compile-tested) | 

```
# 1. models (pick any local chat model; coder models do best at old syntax)
```

…
Everything runs locally on an 8 GB Windows laptop (WSL2, no GPU):

These languages are not really gone, only quiet. Summoning them felt right, and making each spirit prove its answer by actually running it felt even better.
