Ruby meets Go
summary
Shows that Go 1.5 buildmode c-shared/c-archive produces C-compatible .so libraries callable from Ruby using Ruby FFI and fiddle, demonstrates a working demo gem wrapping a memberlist (used by Consul/Serf) and a build flow using Rake/mkmf hacks. Explains concrete techniques: wrapping missing C macros, avoiding the usual two-copy penalty by using a zero-copy string pointer, and using a reference-count map so Ruby-referenced objects aren’t GC’d while used from Go.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:49CRD in Ruby 1.5
- 5:00Calling Go from Ruby
- 9:35Writing Go extensions
- 12:29C macros in Go
- 16:01String conversion pitfalls
- 21:25Ruby object references
- 23:37Building a Go gem
- 26:04Summary and demo








