https://github.com/elgopher/piweb
Modern Pi backend for the web
https://github.com/elgopher/piweb
pi
Last synced: 6 months ago
JSON representation
Modern Pi backend for the web
- Host: GitHub
- URL: https://github.com/elgopher/piweb
- Owner: elgopher
- License: mit
- Created: 2025-08-01T16:08:55.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-10-05T11:48:40.000Z (9 months ago)
- Last Synced: 2025-12-14T10:17:54.013Z (7 months ago)
- Topics: pi
- Language: Go
- Homepage:
- Size: 56.6 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# piweb
**Pi backend for web browsers.**
A replacement for [piebiten](https://github.com/elgopher/pi/tree/master/piebiten) and [Ebitengine](https://ebitengine.org/).
[](https://elgopher.itch.io/snake)
---
## ๐ฏ Project Goals
The aim of this project is to create a new backend for [Pi](https://github.com/elgopher/pi) games that runs efficiently in modern web browsers and offers significant improvements over the standard [piebiten](https://github.com/elgopher/pi/tree/master/piebiten) backend:
### ๐ฆ Smaller Binary Size
* At least **2ร smaller** `.wasm` output
### ๐ Better Audio
* **Minimal latency** โ as low as **20 ms** (compared to 60 ms in piebiten)
* **Glitch-free playback** โ thanks to audio processing in a high-priority, separate audio thread
---
## ๐งช How It Works
These improvements are possible thanks to:
* **Audio Worklet API** โ the browser-native API for real-time, low-latency audio processing
* **SharedArrayBuffer** - a high-performance way to exchange data between the main thread and audio processor in the browser.
* Writing the code directly in **JavaScript**
* Reducing the number of dependencies
---
## ๐ง Status
The project is ready to use. Most features are ready. Some platforms are not supported yet though:
* [x] graphics rendering using Canvas2D
* [x] keyboard support
* [x] gamepad support
* [x] mouse support
* [x] debug mode support
* [x] desktop web browsers - Chrome, Firefox, Edge, Safari etc.
* [ ] mobile web browsers - virtual keyboard and gamepad support
* [x] audio support
* [x] 3x smaller WASM binary - Snake game is 3 MB (0.9 MB after gzip) instead of 10 MB
* [x] customizable template - developer can change all static files - HTML, CSS, JS etc.
* [x] works on itch.io and newgrounds.com
* [x] embedded HTTP server for rapid development
* [x] ability to release ZIP file
* [x] with embedded HTTP server
* [ ] with CLI
* [ ] documentation
* [ ] automated tests