Why Build a Programming Language?
Not because the world needs another programming language. Because I needed to understand one deeply enough to teach it to a machine.
PewPew started as an experiment: could I build a language that's fun to write games in? Not a general-purpose language — a purpose-built one with a pixel-art game engine baked in.
The Stack
- Lexer & Parser: Flex + Bison (yes, the classics)
- Core: C++17
- Browser Runtime: WebAssembly via Emscripten
- Game Engine: Custom pixel-art renderer — SDL2 on desktop, browser canvas via WASM
- IDE Theme: Borland Turbo C++ inspired
What I Learned
- Parsing is just pattern matching with state. Flex makes it almost fun.
- Code generation is the easy part. Getting the grammar right is the hard part.
- WASM is magic. C++ running in the browser at near-native speed? Yes please.
- A language without a game engine is just a calculator. The game engine makes it worth learning.
The Result
A full language — six data types, its own game engine, three run targets (SDL2 desktop, browser WASM, headless). A WASM runtime. A Borland Turbo IDE-themed playground. A PewPew Academy with eight interactive courses. And a Hall of Fame where people showcase what they've built.
Live at pewpew.outshorts.in.