A faithful Electron-based emulator of the historic Setun computer, the world's first ternary (base-3) computer developed in the Soviet Union in 1958.
- Program Editor: Write programs using balanced ternary notation (-1, 0, +1)
- Execution Controls: Run, step, pause, and reset with adjustable execution speed
- Real-time Visualization: Watch registers and memory update as your program executes
- Sample Programs: Learn with built-in examples demonstrating ternary operations
- Syntax Validation: Immediate feedback on invalid ternary digits
- Retro Aesthetic: Amber and cyan color scheme inspired by classic computing terminals
- Native Desktop App: Cross-platform desktop application built with Electron
- Keyboard Shortcuts: Full menu system with keyboard shortcuts for quick access
- Node.js (v16 or higher)
- npm (comes with Node.js)
npm installRun the app in development mode with DevTools open:
npm startOr with the --dev flag for automatic DevTools:
npm run devYou can also run it as a web app by opening index.html in a web browser, or serving it with a local HTTP server:
python3 -m http.server 8080Build standalone executables for your platform:
# Build for current platform
npm run build
# Build for specific platforms
npm run build:win # Windows (NSIS installer + portable)
npm run build:mac # macOS (DMG + ZIP)
npm run build:linux # Linux (AppImage + DEB)Built applications will be in the dist/ folder.
- Load an example program from the dropdown menu
- Or write your own program in the editor
- Run (F5): Execute continuously at selected speed
- Step (F10): Execute one instruction at a time
- Pause (F6): Pause execution
- Reset (Ctrl/Cmd+R): Clear all state and start over
Ctrl/Cmd+N: New programCtrl/Cmd+S: Save programF5: Run programF10: Step through programF6: Pause executionCtrl/Cmd+R: Reset emulatorCtrl/Cmd+Q: Quit application
Setun uses balanced ternary digits:
- - or − represents -1
- 0 represents 0
- + or 1 represents +1
Example: +0- represents the values +1, 0, -1
The emulator includes:
- Accumulator: Main register for arithmetic operations
- Program Counter: Points to the current instruction
- Instruction Register: Holds the current instruction being executed
- Memory: 27 words of balanced ternary storage
- Addition: Demonstrates adding ternary numbers
- Multiplication: Shows ternary multiplication
- Conditional: Illustrates conditional logic
- Vanilla JavaScript (ES6+)
- HTML5
- CSS3 (with OKLCH color space)
- Google Fonts (JetBrains Mono, Inter)
See LICENSE file for details.