How sevinatenine/backwash works
Backwash is a compact esoteric-language interpreter. The main workflow is to select a .bw program, read it and optional input, execute its instructions, then emit characters to stdout or a file. The interpreter builds a label table before executing lines and maintains the language’s byte variables and stack. The README also documents a browser playground; its implementation was not sampled, so its wiring is shown only at the level the documentation supports.
Main entry points: main.js CLI entry point · code.js Instruction execution · index.html Browser playground
Components 15
Command-line runner
- CLI entry point
src/main.js - Character I/O callbacks
src/main.js
Language runtime
- Line and label scan
src/code.js - Instruction execution
src/code.js - Variables and stack
src/code.js
Browser playground
- Browser playground
playground/index.html
Other components
- Program user
- Program file
- Input file
- Output file
- Standard input
- Standard output
- Monaco editor
- Xterm I/O
- Browser user
Connections 15
- Program user → CLI entry point: runs program
- CLI entry point → Program file: reads source
- CLI entry point → Input file: reads optional input
- CLI entry point → Output file: writes optional output
- Standard input → Character I/O callbacks: provides bytes
- Character I/O callbacks → Standard output: writes characters
- CLI entry point → Instruction execution: calls run
- CLI entry point → Character I/O callbacks: supplies callbacks
- Instruction execution → Line and label scan: splits lines; scans labels
- Instruction execution → Variables and stack: updates state
- Instruction execution → Character I/O callbacks: invokes I/O callbacks
- Browser user → Browser playground: uses playground
- Browser playground → Monaco editor: uses editor
- Browser playground → Xterm I/O: uses terminal I/O
- Browser playground → Instruction execution: runs language