Inspiration
Have you ever wondered what computer games looked like in the 70s and 80s? Back then, having access to a computer was rare and exciting—students often had to reserve time in a university computer lab or school library just to sit at a terminal. There, they would play classic text-based games like The Oregon Trail, Hammurabi, Lunar Lander, or Super Star Trek.
All of these games were written in BASIC (Beginner's All-purpose Symbolic Instruction Code). Created at Dartmouth College in 1964, BASIC wasn't just a language—it was designed specifically as an educational gateway to demystify computing for students. Its simple, human-readable syntax made programming approachable for the first time, allowing a generation of beginners to inspect code, experiment with logic, and build their own programs.
Wouldn't it be cool to step back in time and explore this piece of computer science heritage today—running and inspecting these original games hassle-free, directly in your web browser?
What it does
Basicade brings 142 original, text-based BASIC games from the 1970s and 1980s directly to Node.js and modern web browsers—without requiring you to change a single line of legacy code!
By porting classic C-based interpreters (Bywater BASIC and RetroBASIC) to WebAssembly and publishing them as open-source npm packages (bwbasic-wasm and retrobasic-wasm), you can now execute vintage BASIC code anywhere JavaScript runs.
For students, educators, and retro-computing enthusiasts, Basicade serves as a zero-setup, zero-install educational sandbox to play historical games, study early programming paradigms, and inspect classic algorithms in real time.
How we built it
- Interpreter WebAssembly Porting: We compiled the C source code of Bywater BASIC and RetroBASIC into WASM using Emscripten, turning decades-old C logic into lightweight JavaScript-compatible modules.
- Browser Thread Synchronization: To bridge the gap between synchronous C input (
scanf/fgets) and the browser’s asynchronous UI, we executed the WASM engines inside a Web Worker, leveragingSharedArrayBufferandAtomicsto pause and resume thread execution on user input. - Cross-Origin Security: Integrated a Service Worker (
coi-serviceworker) to enable required Cross-Origin Isolation headers (COOP/COEP) on static hosting platforms. - Historical Game Library: Preserved and organized 142 iconic text games originally published in legendary computer science books by David H. Ahl (BASIC Computer Games, 1978).
- CI/CD & Testing: Built an automated GitHub Actions pipeline that executes comprehensive unit tests, builds TypeScript assets, and automatically deploys the Web Launcher to GitHub Pages.
- AI Collaboration: Outlined the architecture and iteratively refined complex mobile UX and WASM bridging using ChatGPT and Codex.
Challenges we ran into
- Sync C Logic in an Async Browser: While building WebAssembly binaries from C source code was straightforward, getting synchronous, blocking C routines to interact gracefully with an asynchronous web terminal without locking up the browser UI was a major engineering hurdle.
- Legacy OCR Source Bugs: Many historical BASIC game scripts were digitized via OCR scans from 1970s books and magazines. Many contained subtle typos, broken variable references, or syntax quirks specific to vintage hardware dialects that required manual debugging and patch verification.
- Mobile Terminal Touch Input: Virtual touch keyboards handle caret control, input events, and backspace keycodes inconsistently across mobile browsers. Tailoring event listeners to ensure seamless mobile terminal typing without text-inversion or duplication took significant fine-tuning.
Accomplishments that we're proud of
- Preserving CS History: We successfully created a zero-install, interactive archive of foundational computer science history accessible to anyone with a browser.
- NPM Package Distribution: Rather than keeping the interpreters wrapped strictly inside our app, we published
bwbasic-wasmandretrobasic-wasmto npm, allowing any developer or educator to integrate legacy BASIC execution into their own learning platforms. - Thread-Safe Architecture: Successfully implementing
SharedArrayBufferandAtomicsinside Web Workers to create a buttery-smooth terminal experience for blocking C code.
What we learned
- Low-Level Browser Concurrency: Deepened our understanding of locking mechanisms, shared memory spaces, and
Atomicsthread synchronization between Web Workers and the main browser thread. - WASM Package Packaging: Learned best practices for compiling and bundling native C libraries into modern, dual-environment JavaScript/TypeScript packages targeting both Node.js and web runtime environments.
- Mobile Terminal UX Physics: Learned how touch browsers synthesize virtual keyboard events and how to structure write-only input streams to prevent character offset duplication.
What's next for Basicade
- Ongoing Game Catalog Patching: We will continue playing, testing, and debugging the 142-game catalog to fix remaining OCR syntax bugs and dialect mismatches.
- Enhanced Mobile UX: Continue polishing terminal responsiveness and custom mobile layouts to ensure retro gaming feels fantastic on smartphones and tablets.
- Community Educational Hub: We hope to gather feedback from educators, retro-computing fans, and developers to grow Basicade into a primary open-source hub for classic BASIC compilers, legacy code execution, and computer science history preservation.
Let's keep building and preserving computing history together!
Built With
- basic
- c
- chatgpt
- codex
- css3
- emscripten
- html5
- javascript
- node.js
- npm
- typescript
- vite
Log in or sign up for Devpost to join the conversation.