Skip to main content

Object serialisation in Squawk

1 reply [Last post]
Joined: 2007-11-16


Is it possible to serialise objects in Squawk? I'm writing a communication protocol for SPOTs and it would be great if I could do send(Object) rather than require clients to serialise/deserialise objects to byte arrays or introduce an interface similar to Serializable that all objects must implement.


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2006-09-08

It may be plausible to reuse the mechanism used for Isolate serialization for this purpose, but with the same restrictions: both the sender and receiver must have the same versions of the suites loaded.

To see how to implement this, look at and Isolate.load() in:

In save() you'll see that it calls "VM.copyObjectGraph(this)", where this (the isolate) is the root of the object graph to copy. You would use a different root.

You may not want to hear this :-), but it would be pretty simple to hack this in, and you are in a better position to test it out.

If you'd like the team to implement it you can add a feature request.