QBasic in the Browser
A QBasic 1.1 compiler and virtual machine for the web.
I wrote QBasic in the Browser to run QBasic 1.1 programs in a browser tab, with VGA graphics, sound, keyboard input, and the original standard library. Compilation and execution both happen in the tab; there is no server and no plugin.
The source goes through a lexer, a parser, an AST, and a bytecode emitter. The bytecode runs in a virtual machine that paces execution by cycle count, draws the VGA screen pixel by pixel, synthesizes square-wave sound, and handles keyboard and timer traps as interrupts. The runtime is a standalone TypeScript library and can be embedded in any JavaScript application.
Try it in your browser Browse the gallery
Stack
- TypeScript
- Svelte
- CodeMirror
- Canvas 2D
- Web Audio API
Get in touch
Drop me a line
Easiest to reach me on LinkedIn or by email. I read everything and usually reply within a day.