The Program That Made Me a Developer

>2026-01-14|6 min read

Get the code:

  • eliza-ts — My TypeScript implementation of ELIZA
  • All my tools — Full collection of agents, skills, and plugins

I was 12 when I met my first AI.

It wasn't really AI, of course. It was a BASIC program running on an old computer, probably something I found on a BBS or copied from a magazine listing. But when I typed "I feel sad" and it responded "Why do you feel sad?", something clicked.

This thing was talking to me.

The Discovery

Our middle school had just set up a computer lab. The math teacher was in charge of it, but he had no idea how to use the machines. I was already deep into computers by then, so I helped him out. Spent most of my free periods in that room.

That's where I found ELIZA. Might have downloaded it at 300 baud on an Apple Cat modem, might have been on a disk someone brought in. What I remember is the feeling: talking to a program that seemed to understand me.

ELIZA: How do you do. Please tell me your problem. ME: I am worried about school ELIZA: Why are you worried about school? ME: Because tests are hard ELIZA: Does that reason seem to explain anything else?

The responses felt intelligent. They asked follow-up questions. They turned my statements back into questions. For a 12-year-old, it was magic.

Then I did what any curious kid would do. I opened the source code.

Tearing It Apart

The BASIC listing was maybe a hundred lines. Variables like

K$
and
R$
. GOTO statements jumping around. DATA statements full of keywords and responses.

At first it looked like gibberish. But I started tracing through it. When the user types something, the program looks for certain words. If it finds "I am", it might respond with "Why are you" plus whatever came after. If it finds "my mother", it redirects to talking about family.

That was the moment. The moment I realized there was no understanding happening at all. It was pattern matching. Simple rules. IF this THEN that.

And instead of being disappointed, I was thrilled.

Because if it was just rules, that meant I could understand it. That meant I could build things like this myself.

How ELIZA Actually Works

Joseph Weizenbaum created ELIZA in 1966 at MIT. The most famous script, DOCTOR, simulates a Rogerian psychotherapist. Here's how it works:

Keywords with priorities. ELIZA scans your input for keywords like "mother", "feel", "want", "dream". Each keyword has a priority number. Higher priority keywords get processed first.

Decomposition patterns. For each keyword, there are patterns that try to match your input. The pattern

* I am *
matches anything followed by "I am" followed by anything else. The asterisks capture whatever's on either side.

Reassembly rules. When a pattern matches, ELIZA picks a response template and fills in the blanks with what it captured. If you said "I am feeling lonely", it might respond "How long have you been feeling lonely?" using the captured text.

Memory. Some responses get saved for later. If ELIZA can't find a good match, it might recall something you said earlier and bring it back up.

Substitutions. Before responding, ELIZA swaps pronouns. "My" becomes "your". "I" becomes "you". That's why "I feel sad" turns into "Why do you feel sad?"

That's it. No neural networks. No embeddings. No transformers. Just carefully crafted patterns that exploit how humans fill in gaps.

Try It Yourself

I built a TypeScript implementation of ELIZA. It's faithful to the original algorithm, complete with the classic DOCTOR script. Here it is, running right in your browser:

ELIZA.exe - 1966
Initializing ELIZA...
>Loading...

Try saying goodbye to end the session

Go ahead. Tell it your problems. Watch how it deflects, redirects, asks questions. Notice how it never actually says anything of substance, yet somehow keeps the conversation going.

This is the illusion that fascinated Weizenbaum. He was disturbed that people, including his own secretary, would confide in the program as if it understood them. He spent much of his later career warning about the dangers of anthropomorphizing computers.

The ELIZA Effect

There's a term for what happens when you interact with ELIZA: the ELIZA effect. It's the tendency to unconsciously assume that computer behaviors are analogous to human behaviors.

You type "I'm worried about my job" and ELIZA responds "Tell me more about your job." Your brain fills in the rest. You assume it understood. You assume it cares. You keep talking.

Weizenbaum wrote about this in his 1976 book "Computer Power and Human Reason":

"What I had not realized is that extremely short exposures to a relatively simple computer program could induce powerful delusional thinking in quite normal people."

Sound familiar? We're having the same conversations today about large language models. The technology has changed dramatically, but the human tendency to anthropomorphize remains the same.

Full Circle

Fifty years separate that BASIC listing from the tools I build today. I've gone from pattern matching to vector embeddings, from IF statements to transformer architectures.

But the core experience remains the same. You find something that seems magical. You tear it apart. You understand how it works. And then you build.

I wrote eliza-ts as a tribute to that 12-year-old who didn't know yet that looking at BASIC code would change the trajectory of his life. It's a clean TypeScript implementation with zero dependencies, faithful to Weizenbaum's original algorithm.

The repo includes the classic DOCTOR script, but the parser can load any ELIZA-format script. The pattern matcher supports wildcards, synonyms, and all the original features. And yes, it has 100% test coverage, because some habits stick with you.

What ELIZA Taught Me

That program taught me something that took years to fully appreciate: complex behavior can emerge from simple rules.

A chatbot that seems intelligent but is just pattern matching. An ant colony that solves optimization problems but has no central coordinator. A neural network that generates images but is just matrix multiplication and nonlinear functions.

The magic is in the emergent behavior. The trick is understanding that there's no magic at all.

When I build AI tools today, I think about ELIZA. I think about patterns and substitutions and the illusion of understanding. I think about what the code is actually doing versus what users perceive it's doing.

And I remember being 12, staring at a screen, realizing for the first time that I could understand how this thing worked.

That feeling never gets old.

>_Eric Engine

Ask me anything

Type your question below

>