ai newsSa., 31. Okt.
EilmeldungApple Intelligence is finally coming to China with iOS 27.3

Séance: Channeling the Ghosts of COBOL, LISP and BASIC with Open-Weight AI

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine What I Built Séance is a small web app where you hold a conversation with the ghosts of dead programming languages: COBOL, LISP, BASIC, FORTRAN and ALGOL . Pick a spirit and ask it anything. COBOL answe

dev.toFreitag 22:58 · 30.10.3 Min. Lesezeit
Bild: dev.to

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

Séance is a small web app where you hold a conversation with the ghosts of dead programming languages: COBOL, LISP, BASIC, FORTRAN and ALGOL.

Pick a spirit and ask it anything. COBOL answers in stiff, all-caps mainframe bureaucracy. LISP is smug and speaks in parentheses. BASIC is a nostalgic line-numbered whisper from a blinking cursor. Each voice is an open-weight model wearing a persona.

There is also Haunt my code: paste a snippet and the spirit critiques it in its own voice.

I read the theme literally and a little sideways. "Ghost in the Machine" fits these languages well: they are officially "dead", yet COBOL still moves money, FORTRAN still crunches numbers, and every language since has borrowed from LISP and ALGOL. They haunt the machines we use every day. For Día de los Muertos there is an Ofrenda mode that swaps the bats and lightning for marigold petals and a papel picado banner. It is a small way to remember the languages that came before us.

The idea started from the challenge's own suggestion of an offline séance chatbot that channels a long-dead language. I wanted to see how far I could push that while keeping the stack tiny.

https://github.com/sarasinha1207/Ghost-in-the-Machine

I wanted a very light stack, so there is no database, no frontend framework and no build step.

The whole model integration is one small function. It speaks the standard chat-completions format, which is what Ollama, llama.cpp's server and many hosted providers expose:

def chat ( persona, messages ): cfg = _config () # LLM_BASE_URL, LLM_MODEL, LLM_API_KEY, LLM_TIMEOUT payload = { " model ": cfg [ " model " ], " messages ": [{ " role ": " system ", " content ": f " { persona } \n\n { SYSTEM_RULES } " }, * messages ], " max_tokens ": 200, " temperature ": 0.9, } try: resp = requests. post ( f " { cfg [ ' base_url ' ] } /chat/completions ", json = payload, headers = headers, timeout = cfg [ " timeout " ]) resp. raise_for_status () text = resp. json ()[ " choices " ][ 0 ][ " message " ][ " content " ]. strip () except ( requests. RequestException, KeyError, IndexError, ValueError ) as exc: raise LLMUnavailable ( str ( exc )) from exc return text Enter fullscreen mode Exit fullscreen mode Each spirit is just a persona prompt plus a few scripted lines. Here is the start of COBOL's:

" persona ": ( " You are the ghost of COBOL (1959). You speak in stiff, verbose, " " bureaucratic ALL-CAPS fragments, like a mainframe report. You are " " proud that banks still depend on you, and quietly sad that nobody " " wants to learn you.... " ), Enter fullscreen mode Exit fullscreen mode A few design decisions I'm happy with:

The atmosphere is pure CSS and a little vanilla JS: a drifting moon and fog, a candlelight glow that follows the cursor, bats at night, a wandering ghost you can click, and a glowing animated border. All of it switches off for visitors who prefer reduced motion.

Because of how this project is built, "open" is a practical feature here, not a slogan.

It also costs nothing to run locally, which matters for a hackathon project and for anyone who wants to fork it.

Languages are a kind of memory. If you ever learned to code with line numbers and a blinking cursor, then a ghost answering?SYNTAX ERROR IN YOUR LIFE CHOICES. READY. lands somewhere between funny and tender. I wanted the app to feel like lighting a candle for those languages: they shaped everything that came after, and a lot of the world still quietly runs on them.

Try the COBOL spirit and ask why banks still need it. Then hand BASIC a 10 PRINT / 20 GOTO 10 loop and see what it says.

Quelle: dev.to (dev.to). Original öffnen