First stable release of Stack Machine Go (smg), a stack-based virtual machine and compiler written in Go. This is a complete port of Christian Stigen Larsen's original Stack Machine from C++ to Go, with additional tooling and improvements.
Features
- Complete stack-based virtual machine implementation
- Assembly language compiler
- Interactive interpreter
- Bytecode disassembler
- Cross-platform support (Linux, macOS, Windows)
- Comprehensive documentation
- Test suite and examples
Binary Downloads
Pre-built binaries are available for:
- Linux (amd64): smg-linux-amd64
- macOS (amd64): smg-darwin-amd64
- Windows (amd64): smg-windows-amd64.exe
SHA-256 checksums are provided in checksums.txt
Installation
From Binary
Download the appropriate binary for your platform and add it to your PATH.
From Source
git clone https://github.com/matt-dunleavy/stackmachine-go.git
cd stackmachine-go
go build -o smgOr use the provided build script:
./scripts/build.sh --mode releaseDocumentation
- See the [docs](./docs/) directory for comprehensive documentation
- Example programs are provided in examples/
- Command reference available via smg --help
Breaking Changes
- None (initial release)
Known Issues
- None at release time
License
This project is released to the Public Domain. In jurisdictions where such terms are not recognized, the source code is distributed under the terms of the ISC License.
Acknowledgments
Original [Stack Machine](https://github.com/cslarsen/stack-machine) (C++) by [Christian Stigen Larsen](https://github.com/cslarsen)
Release Assets
- smg-linux-amd64
- smg-darwin-amd64
- smg-windows-amd64.exe
- checksums.txt
- LICENSE
- README.md
Release Notes
This is the initial stable release of Stack Machine Go. The implementation provides a complete stack-based virtual machine with an assembly language compiler, interpreter, and disassembler. All core functionality from the original C++ implementation has been ported and verified.
Key Components
- Virtual Machine (VM) that executes bytecode
- Compiler that translates assembly-like source code to bytecode
- Interpreter for direct execution of source code
- Disassembler to convert bytecode back to assembly
- Command-line interface with multiple subcommands
- Cross-platform build system
Getting Started
- Download the appropriate binary for your platform
- Add the binary to your PATH
- Try the examples:
# Run the Hello World example
smg interpret examples/hello.srcCompile and run
smg compile examples/hello.src
smg run hello.bin
Disassemble bytecode
smg disassemble hello.bin