jsonpickle Joose.Storage and MooseX::Storage

8 views
Skip to first unread message

Malte

unread,
Aug 1, 2008, 2:23:32 AM8/1/08
to jsonpickle
Hey,

we've been working on a similar functionality (called Joose.Storage)
for a javascript meta system called Joose that does very similar
things (and maybe a bit more) and it might be very interesting to make
jsonpickle wire-compatible with it.

http://code.google.com/p/joose-js/

The format allows serialization and deserialization of complex Joose-
based JS object. It is also wire-compatible with the format used by
MooseX::Storage
http://search.cpan.org/~nuffin/MooseX-Storage-0.14/lib/MooseX/Storage/Format/JSON.pm

Making this compatible with jsonpickle would allow for round-trip
object instantiation between JS, Python and Perl which might lead to
some very cool things.

I'm currenty working on a omplex Google App Engine application that
makes heavy use of Joose.Storage and it would be nice to be able to do
more with the objects on the server (Python) side.

For some examples of Joose.Storage usage you can look at the test
file:
http://code.google.com/p/joose-js/source/browse/trunk/tests/12_storage.js

The format itself looks like this:
http://scsys.co.uk:8001/17361 (This is the JSON serialization for a
Joose meta class)

We are currently working on driving this a little further. By
standardizing class names for the meta classes of generated methods we
want to enable automatic and save serialization and deserialization of
basic classes (including functionality) between programming languages.

Let me know if you're interested.

Cheers,
Malte

John Paulett

unread,
Aug 3, 2008, 6:53:22 PM8/3/08
to jsonp...@googlegroups.com, malt...@gmail.com
Malte,

Thanks for pointing out your work!

I think it is definitely a possibly to make jsonpickle wire compatible
with MooseX. One of the main issues that I see is that the __CLASS__
attribute starts with underscores, which CouchDB does not allow. I
think the best solution is to allow custom class definition tags. We
could allow the user to specify which tags should be used. So people
who want to use CouchDB could specify one set of tags to use, while
MooseX users could use the MooseX standard.

I am definitely interested, it would be very nice to be able to move
objets easily between languages.

John

Stevan Little

unread,
Aug 4, 2008, 2:40:28 PM8/4/08
to jsonpickle
John,

MooseX::Storage allows you to specify your own specific class marker
(at least I think we added that feature, if not we certainly can) so
the __CLASS__ bit is not set in stone. And no matter what it is a
simple matter of writing a custom MooseX::Storage role to tweak the
class marker as needed.

- Stevan

On Aug 3, 6:53 pm, John Paulett <j...@7oars.com> wrote:
> Malte,
>
> Thanks for pointing out your work!
>
> I think it is definitely a possibly to make jsonpickle wire compatible
> with MooseX.  One of the main issues that I see is that the __CLASS__
> attribute starts with underscores, which CouchDB does not allow.  I
> think the best solution is to allow custom class definition tags.  We
> could allow the user to specify which tags should be used.  So people
> who want to use CouchDB could specify one set of tags to use, while
> MooseX users could use the MooseX standard.
>
> I am definitely interested, it would be very nice to be able to move
> objets easily between languages.
>
> John
>
> Malte wrote:
> > Hey,
>
> > we've been working on a similar functionality (called Joose.Storage)
> > for a javascript meta system called Joose that does very similar
> > things (and maybe a bit more) and it might be very interesting to make
> > jsonpickle wire-compatible with it.
>
> >http://code.google.com/p/joose-js/
>
> > The format allows serialization and deserialization of complex Joose-
> > based JS object. It is also wire-compatible with the format used by
> > MooseX::Storage
> >http://search.cpan.org/~nuffin/MooseX-Storage-0.14/lib/MooseX/Storage...
>
> > Making this compatible with jsonpickle would allow for round-trip
> > object instantiation between JS, Python and Perl which might lead to
> > some very cool things.
>
> > I'm currenty working on a omplex Google App Engine application that
> > makes heavy use of Joose.Storage and it would be nice to be able to do
> > more with the objects on the server (Python) side.
>
> > For some examples of Joose.Storage usage you can look at the test
> > file:
> >http://code.google.com/p/joose-js/source/browse/trunk/tests/12_storag...

Malte Ubl

unread,
Aug 14, 2008, 4:36:37 PM8/14/08
to jsonp...@googlegroups.com
Hi John,

just wanted to let you know that latest SVN of Joose now supports
jsonpickle out of the box:
http://joose-js.blogspot.com/2008/08/joose-now-supports-jsonpickle.html

I left on thing that is special to Joose in this implementation that
could be easily ripped out if neccessary:
Joose's version of jsonpickle supports serialization of complex and
nested data structures. These might include the same object twice.
Joose adds an objectid__ field to the JSON to be able to find those
identical objects keep the identity after deserialization. Here is an
example how the resulting JSON looks with this extention:
{"a":{"classname__":"Point","classmodule__":"Geometry","objectid__":5,"x":10,"y":20},"b":{"objectid__":5},"c":{"classname__":"Point","classmodule__":"Geometry","objectid__":6,"x":20,"y":30}}

Cheers
Malte
--
SCHAFFHAUSEN COMMUNICATION GROUP
Schaffhausen ITC Solutions GmbH / Daimlerstraße 17 / 25337 Elmshorn

Fon +49 41 21.47 29-459 / Fax +49 41 21.47 29-455
u...@schaffhausen.de / www.schaffhausen.de

John Paulett

unread,
Aug 18, 2008, 10:23:35 PM8/18/08
to jsonp...@googlegroups.com, malt...@gmail.com
Malte,

Great stuff! Thanks for putting this together.

John

Reply all
Reply to author
Forward
0 new messages