Drb -- distrib'd ruby and marshalling, question about methods

Hello, I have been moving perl objects around for years and I was very
pleased to see the light article in Dr Dobbs – or was it Byte –

My problem w/ perl serialization is that you cannot serialize code,
such as methods. My knowledge of Ruby is scant so my question is
"does Ruby solve this problem ??"

If so, can you send a marshalled object to a remote ruby box and
expect it to be involked. ( can it be encrypted ??, asking gingerly
:wink: )

TIA, a brief description in lay terms for a shell/perl/unix_admin and
his speical interest group would be greatly appreciated.

John

Linux Society

I don’t know much about drb, etc. and look forward to be proven wrong :-).
I think you can’t as Ruby is C under the hood. What you can do though is
send a “text”-representation of the method from a client to a server
and then use the wonders of “eval”.

Cheers,

Armin.

···

Am Montag, 19. August 2002 20:48 schrieben Sie:

My problem w/ perl serialization is that you cannot serialize code,
such as methods. My knowledge of Ruby is scant so my question is
"does Ruby solve this problem ??"

well, drb really serves a slightly different purpose, in that you’re
remotely executing the methods as if they were local. but you are not
actually transmitting serialized methods via the network, you are merely
calling them by name, and it is the name that is transmitted. the
results of these methods are then serialized and transmitted back. but
some objects can’t be serialized, since drb, i believe, utilizes Ruby’s
standard Marshal module. this means bindings, procs, IO objects, and
singleton objects won’t fly.

the suggestion of having your methods sent in text representation form
and using eval, isn’t the most elegent, but could work. but then you
cannot do this via literially defined methods. rather, you have to put
them into strings. which gives one pause actually, what is the real
distinction between the two? why the execution slow down on evals? and
wouldn’t it be nice to have a method object dump its contents as a
string? and so on…

~transami

···

On Mon, 2002-08-19 at 14:57, Armin Roehrl wrote:

Am Montag, 19. August 2002 20:48 schrieben Sie:

My problem w/ perl serialization is that you cannot serialize code,
such as methods. My knowledge of Ruby is scant so my question is
"does Ruby solve this problem ??"
I don’t know much about drb, etc. and look forward to be proven wrong :-).
I think you can’t as Ruby is C under the hood. What you can do though is
send a “text”-representation of the method from a client to a server
and then use the wonders of “eval”.

Thanks for the info… I had gotten the notion that somebody had
seconded my motion to allow packages and methods to be distributed
right from live memory.

This is my ThinMan model, which is based on CPAN with the other added
feature that there is only one application – the Perl VM. The VM
recongizes the object that you are accessing w/ your browser and
brings in the proper packages and methods.

They way I dreamed it, it is infact text based, with the majority of
the code being machine code, encased in the methods as binary code is
in a tar file.

To this end, perl would have to become GPL to use the gnu/tar code…

And hell will freeze long before that happens !!!

Thanks again, John