I found this library
(ruby-internal)[http://rubystuff.org/ruby-internal/] that can
supposedly marshal procs and classes in both MRI and YARV. It was in
the comments on [yehuda's
blog](http://yehudakatz.com/2011/11/19/how-to-marshal-procs-using-rubinius/)
about marshaling procs with rubinius.


On Thu, Jan 5, 2012 at 8:47 PM, Urabe Shyouhei <shyouhei / ruby-lang.org> wrote:
> On 201216 08:54, Roger Pack wrote:
>> Every so often I wish I could do something like
>> a = background_process
>> a.send {
>> # compute something long
>> }
>>
>> Which would require the ability to "serialize" proc's.
>> So consider this my feature request.
>
> Short answer: we wish we could. And theoretically speaking it is not
> impossible. But no one have ever been successful.
>
>> First thing that comes to mind would be the ability to translate them
>> into an AST.
>> RubyVM::InstructionSequence.disassemble might be related.
>> Cheers!
>
> A proc is not a code snippet. It is a "closure". To serializelosure
> is not a easy job. If you just want to inject a code snippet to another
> process, you'd better propose something other than a proc serialization.
>