$ cat tr.rb
attach_function :new, :TrVM_new, [ ], :pointer
attach_function :eval, :TrVM_eval, [ :pointer, :string, :string ], :long
ffi = "module LibC; attach_function :cputs, :puts, [ :string ], :int;end; LibC.cputs 'Hello via TinyRuby FFI'"
vm = Tr.new
Tr.eval(vm, "puts \"Hello, World via TinyRuby puts\"", "<eval>")
Tr.eval(vm, ffi, "<eval>")
$ ruby1.9 tr.rb
Hello, World via TinyRuby puts
Hello via TinyRuby FFI
Yep, thats using FFI from ruby 1.9 to call TinyRB and having it eval some code - including some FFI code of its own.