Piscript
Piscript is a lightweight scripting language inspired by Python, built in C for speed and simplicity. It features a built-in 128x128 pixel graphics display and supports functional programming, matrix math, and WebAssembly via Emscripten. Ideal for learning, experimentation, and building retro-style visual programs.
Install / Use
/learn @rolandbrake/PiscriptREADME
✨ Overview
Pi-Script (Pixel Script) is a lightweight scripting language inspired by Python and implemented in C. It is designed for simplicity, performance, and creative experimentation within a 128×128 pixel virtual environment.
Pi-Script is ideal for:
- 🎓 Educational use
- 🎨 Creative coding
- 🕹 Retro-style graphics experiments
- 🌐 Embeddable web playgrounds
- 🧩 Lightweight scripting integration in C projects
<h1 align="center"> Pi-Script In Action </h1> <p align="center"> <img src="./images/examples.gif" alt="Piscript in action" /> </p>
Pi-Script makes it easy to create visual experiments, animations, and small interactive programs inside a retro-style virtual console.
🖥 Pi Shell
<p align=""> <img src="./images/shell.gif" alt="Pi Shell Demo" width="300"/> </p>Pi Shell is the native desktop runtime environment for Pi-Script.
It provides a lightweight development workflow for running Pi-Script locally with:
- 🧠 Interactive script execution
- 📁 File-based project support
- ⚡ Fast native performance
- 🛠 Integrated graphics window
- 🧩 Ideal for game development and experiments
Run scripts directly:
run <script-name>.pi
Pi Shell extends Pi-Script beyond the browser, turning it into a practical creative coding tool for real desktop development.
🐍 Pi-Script In Action — Snake Game
<p align=""> <img src="./images/snake.gif" alt="Snake Game in Pi-Script" width="300"/> </p>A complete Snake game built entirely in Pi-Script.
This example demonstrates:
- 🎮 Game loop implementation
- 🕹 Keyboard input handling
- 🧠 State management
- 🎨 Real-time rendering with
pixel()anddraw() - ⚡ Smooth performance inside the 128×128 virtual console
The Snake game proves that Pi-Script is capable of building fully playable retro-style games with clean and minimal code.
Try it in (snake.px):
- 🌐 Online Playground
- 🖥 Pi Shell (native build)
🚀 Features
Language & Runtime
- Clean, Python-like syntax
- Custom virtual machine implemented in C
- Variables, functions, and control flow
- Functional programming utilities:
mapfilterreducecompose
- Matrix and vector operations:
dotcrossmultiply
Graphics
- Fixed 128×128 virtual framebuffer
- SDL2-powered rendering
- Minimal and expressive graphics API:
clear()pixel()draw()
- Palette-based color system
- Built-in 3D rendering engine
.objfile support
Platform Support
- Native builds (Linux, macOS, Windows)
- WebAssembly support via Emscripten
- Embeddable in web applications
📦 Getting Started
🔧 Requirements
- C compiler (GCC or Clang)
- SDL2
- Emscripten (optional, for WebAssembly builds)
🛠 Build Instructions
Clone the Repository
git clone https://github.com/rolandbrake/piscript.git
cd piscript
Build Targets
make release # Optimized build
make debug # Debug build
make emscripten # WebAssembly build
make run # Run release build
make clean # Clean build artifacts
Run the Interpreter
run test.pi
🧪 Example
// Pi-Script example
clear(12)
for y in 0..127
for x in 0..127
if ((x + y) % 10 == 0)
pixel(x, y, 6)
draw()
Run this example:
- In the online playground
👉 https://piscript.netlify.app/playground - Or using the native build via Pi Shell
Related Skills
claude-opus-4-5-migration
92.1kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
model-usage
343.3kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
openhue
343.3kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
343.3kElevenLabs text-to-speech with mac-style say UX.
