A short poem written in FreeBASIC, hand-coded by a human learning the language for the first time alongside an AI as teacher.
The source is in poem.bas. It compiles and runs on the real FreeBASIC compiler in about 4.5 seconds.
The world is in a mess.
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
I am searching for Home...
still wandering... H
still wandering... Ho
still wandering... Hom
still wandering... Home
At last - Home.
A small artifact of one person learning a new programming language from scratch by writing every line themselves, guided chunk-by-chunk by an AI teacher. The output is both a working program and a poem — the structure of the code carries the meaning (Goto Home as the wanderer's intent, Home: as the destination, a brute-force search as the slowness of seeking).
The repository is also a teaching resource: the 8-chunk curriculum the AI produced is preserved verbatim, so anyone can follow the same lessons and write their own version. The full reflective story of the collaboration — what worked, what surprised me, where the AI was wrong — is in JOURNEY.md.
The source compiles with any real FreeBASIC compiler (fbc). Two practical paths:
In your browser (no install):
- Paste
poem.basinto JDoodle's FreeBASIC compiler and click Execute. - Or use OnlineGDB and select FreeBASIC from the language dropdown.
⚠️ Do not use QBJS (qbjs.org) — it does not supportGoto, which is the entire structural device of this poem.
Locally (one-time install):
- Install FreeBASIC from freebasic.net.
- Run
fbc poem.bas && ./poemfrom this directory.
If the idea interests you and you'd like to learn FreeBASIC the same way — by writing your own short poem-program alongside an AI:
- Read
JOURNEY.mdto understand the working agreement: the AI teaches small chunks, you write every line. - Follow the chunks in order under
docs/. Each chunk is a self-contained lesson with concepts, syntax examples, and a goal. - Open your own file in any text editor and write your own version as you go.
- Run your program in a real FreeBASIC compiler (see above) after each chunk.
If you're interested in the broader question of how to learn anything from an AI, JOURNEY.md closes with reflections on what made this collaboration work.
poem.bas the finished poem (80 lines of FreeBASIC)
README.md this file
JOURNEY.md the reflective story of the collaboration
docs/
chunk-1-variables.md ┐
chunk-2-arrays.md │
chunk-3-shuffle.md │ the 8-chunk curriculum,
chunk-4-goto.md │ preserved verbatim
chunk-5-search.md │ as the AI originally taught it
chunk-6-swap.md │
chunk-7-print.md │
chunk-8-arrival.md ┘
appendix-ai-errors.md an honest record of the AI's three errors
- William Wong — author of the poem, writer of all code.
- Claude (Opus 4.7) — AI teacher and reviewer, by Anthropic.
- FreeBASIC — the language. freebasic.net
Do what you like with this. If you build something similar — your own small, hand-coded creative artifact — I'd love to see it.