From: Jonathan Hudson Date: 2009-11-19T07:01:09+09:00 Subject: Re: How to using golang for write a xxx.so for ruby? On Wed, 18 Nov 2009 20:44:20 +0900, Eleanor McHugh wrote: > On 18 Nov 2009, at 02:50, Haoqi Haoqi wrote: > > you may see http://golang.org > > I want to using golang create a shared object thant can call from > > ruby,Is it possiable? > > First write your shared library in go, then load it into your ruby program using either ruby/dl (part of the MRI standard library) or ruby-ffi (available as a gem and supported under both MRI and JRuby). > > You will also have to figure out how go mangles function names to be able to call into the library and there may well be runtime aspects of the go language which are incompatible with current ruby implementations. > > Happy hacking :) > > > Ellie > From the Go FAQ: "There is no safe way to call Go code from C or C++ yet." -jh