go-embedded-ruby (rbgo) is a from-scratch Ruby — lexer, parser, compiler, bytecode VM and an AOT backend — that embeds in any Go program and cross-compiles to a single CGO-free binary. Built in the open as a digital common (commun numérique), free to use, study, modify and share under the BSD-3-Clause licence.
# a real Ruby, no cgo, no Ruby installed $ rbgo -e 'puts (1..20).reduce(:*)' 2432902008176640000 # AOT-compile the hot path to native Go $ rbgo build --closed app.rb -o app → app (CGO=0, 1 file, runs anywhere) # the real Puppet CLI, end to end $ rbgo -e 'require "puppet"' apply site.pp Notice: hi from rbgo cli Applied catalog in 0.04s · exit 0
No FFI, no libruby, no system Ruby. Drop a genuine, monkey-patchable Ruby object model into your Go binary and ship it anywhere.
A real object model — classes, mixins, method_missing, metaprogramming, Fiber — callable straight from Go.
CGO=0 by default. Cross-compiles to amd64, arm64, riscv64, loong64, ppc64le and s390x.
Ahead-of-time method compilation to unboxed Go kernels — 18–24× over MRI+YJIT on loop/fib.
~100% of valid Ruby parsed across Rails + Puppet; parse+compile 99.82% / 100%, zero over-permissive.
rbgo build --closed bakes the program to bytecode and drops the front-end for a smaller binary.
Built from the go-ruby-* family — each a 100%-coverage, 6-arch stdlib module, bound natively.
Lexer → parser → compiler → bytecode VM, end to end.
Classes, modules, inheritance, mutable method tables, @ivars, new/initialize, constants, include mixins, super, blocks & yield, block_given…
Integer (with Bignum promotion + arbitrary-precision literals, radix literals 0x/0o/0b/0d, bitwise/shift << >> & | ^ ~), Float, mutable …
Exception hierarchy, raise/rescue/ensure/else/retry (block- and method-level), non-local break/next, Kernel#loop, and the eager Enumerator…
define_method, instance_eval/instance_exec, class_eval/module_eval/class_exec, send/public_send, respond_to?, instance_variable_get/set/…
Interpolation, keyword args, endless methods (def foo = expr), beginless/endless ranges, the stabby lambda, multiple assignment, full …
Regexp bridge landed: /re/imx literals, Regexp/MatchData, =~/match/scan/gsub/sub/split and the match globals, on the pure-Go Onigmo engine (…
rbgo build landed: AOT method compilation to native Go (unboxed int64 kernels beat MRI+YJIT ~4×), and closed-world builds (rbgo build --…
A conformance campaign brought the pure-Go front-end to ~100% of all valid Ruby parsed across Rails + Puppet (99.
One binary. Six architectures. No cgo, no runtime to install. Embed a real Ruby — or compile it away. Open infrastructure, governed as a commons.
Read the source on GitHub →