An implementation of a subset of Ruby in Go. The goal is to be able to run Pyramid-Scheme.
This project began as a fork of goruby/goruby and has since diverged.
make build # ./bin/goruby, ./bin/girb, ./bin/grgrRun a Ruby file (or one-line scripts via -e):
goruby program.rb
goruby -e 'puts "hello"'
goruby -e 'x = 1' -e 'puts x'Flags: --cpuprofile, -e, --trace-parse, --trace-eval, -v/--version.
Interactive REPL with multiline expressions and readline support. CTRL-D exits.
girbFlags: --noecho, --noprompt, -v/--version.
AST-printer / round-trip tool. Parses a Ruby file, runs the transformer pass, and prints the recovered source with debug comments.
grgr program.rbFlags: --trace-transform, -v/--version.
cmd/goruby—gorubybinary entry pointcmd/girb—girbREPL entry pointcmd/grgr—grgrAST-printer entry pointast— AST node definitionslexer— tokeniserparser— parser, produces anast.Programtransformer— AST rewrite passesevaluator— tree-walking evaluatorinterpreter— top-level glue used bycmd/gorubyobject— runtime object model (Integer, String, Array, Hash, Proc, ...)repl— REPL loop used bygirbtoken— token type and source positionstrace— parse / eval trace helpersinternal/version— generated build-info (Version,CommitSHA,BuildDate,BuildInfo)
VERSION is the source of truth. make build and make test regenerate internal/version/version.go via lczyk/version so each binary's --version reports the current version, commit SHA, build date, and dirty-tree marker.
MIT — see LICENSE. Upstream copyright from the goruby/goruby fork is preserved at LICENSE-goruby.