Skip to main content
Back to Articles
2026 / 01
| 2 min read

Big Repo Restructure and Backend Migration

Splitting the repository into clear domains—cores, languages, assemblers, BIOS—and making future work less of a guessing game.

emulator architecture rust refactoring

Every import path I touched broke two more. After the third hour of chasing circular dependencies and mysterious build failures, I gave up fixing the existing layout and spent the rest of the day moving hundreds of files into a structure that tells the truth about what depends on what.

The constraint was simple: a CPU core should build and test without importing the web app. An interpreter shouldn’t need to know about the modem.

The new backbone is:

cores/        # CPU emulators (Z80, MOS 6502, Intel 8080/8088)
languages/    # Interpreters (Forth, BASIC, Scheme, Prolog, ZIL)
assemblers/   # Assemblers (6502, Z80, x86)
bios/         # ROMs and BIOS code
src/          # Application code
  main/       # Entry point
  frontend/   # UI components
  backend/    # Backend services
  audio/      # Audio system
  serial/     # Modem communication

Once those edges exist, a local loop becomes possible. cargo test in cores/z80/ stops being a full-repo compile and starts being a tight, seconds-long answer. The same thing happens in languages/: you can hand someone a single interpreter and they can work without the rest of the system in their head.

The migration was a grind: move a file, fix imports; find an implicit re-export, fix three more; repeat until the graph stabilizes. The noisiest part was the backends—every game, every BBS service, every ANSI animator had to move and have its imports corrected. I touched forty-odd files just fixing paths after the main restructure landed.

Docs moved in the same direction. The README and manual pages now line up with the structure, which means a newcomer can build a mental model without a private tour.

Changes

  • Restructured the repo into domain directories (cores/, languages/, assemblers/, bios/) with real dependency boundaries.
  • Migrated all backends into a consistent directory structure within src/backend/.
  • Updated import paths, manuals, and top-level documentation to match the new shape.
  • Fixed dozens of broken imports from the circular dependency mess that started this whole exercise.

Tomorrow I’m going to tackle the remaining JavaScript-to-TypeScript migration. Half the worker files are still .js, and every time I touch them I have to mentally switch contexts. Should be able to knock out the language workers and frontend visualizations.

Previous: 2026-01-22