BEEP-8 – compile C++20 to a tiny ARM ROM and run it instantly in a browser
I’ve been working on a small side project called BEEP-8 and thought some C++ folks might find it interesting.
The idea is:
* you write C++20 (subset) against a small SDK
* cross-compile it to a ROM image for a tiny ARM-based “console”
* open a URL, point it at the ROM, and it runs immediately in your browser on PC or phone
No native install, no WASM glue – the browser is just hosting an emulator for a fixed virtual machine.
What the target looks like
* CPU: software ARMv4-ish core, integer-only, fixed 4 MHz “virtual clock”
* Memory: 1 MB RAM, 1 MB ROM
* Video: simple 8/16-bit-style VDP (tilemaps, sprites, 16-colour PICO-8-compatible palette)
* Audio: small tone/noise APU
* Input: buttons plus touch-friendly controls so it works on phones as well
From user code you never touch JS or WebGL; it just looks like a small C++ API plus some memory-mapped registers.
Toolchain / workflow
1. `git clone` [`
https://github.com/beep8/beep8-sdk.git`](https://github.com/beep8/beep8-sdk.git)
* The repo includes a preconfigured GNU Arm GCC cross-compiler in-tree, so there’s no separate compiler install.
2. Write code in C or C++20 (integer-only environment) using the SDK headers.
3. Run `make` to build a `.b8` ROM for the virtual ARM machine.
4. Open [`
https://beep8.org`](
https://beep8.org) (or your own self-hosted copy), select the ROM, and it boots and runs in the browser at 60 fps.
Links
* Live console + sample games/demos (runs directly in the browser): [
https://beep8.org](
https://beep8.org)
SDK, toolchain, and source (MIT-licensed):
[
https://github.com/beep8/beep8-sdk](https://github.com/beep8/beep8-sdk)
I’m curious what the C++ community thinks about this kind of target:
* Would you consider it a useful little playground for teaching C/C++ or for jams / prototypes?
* Any obvious changes you’d make to the API or build flow to make it nicer for C++ developers?
* If you were writing a small C++ library or demo for a 4 MHz ARM with 1 MB RAM, what would you build first?
Happy to answer questions or share more details about the toolchain and runtime if anyone’s interested.
https://redd.it/1pgjqdl@r_cpp