in reply to Data Exchange between perl and java.

This is seriously off-topic and only peripherally Perl related, but I don't know where to ask these kinds of questions, so flame away if you like.

Has anyone used something lightweight like YAML or LISP to pass content between apps?

Just curious. Maybe some kind soul can point me to the right place to ask that kind of question?

Thanks for bearing with me.
rje
  • Comment on Re: Data Exchange between perl and java.

Replies are listed 'Best First'.
Re: Re: Data Exchange between perl and java.
by ViceRaid (Chaplain) on Aug 13, 2003 at 18:25 UTC

    I did try using YAML to pass data in HTTP headers from a (public-facing) server running mod_perl to a back-end server running mod_ruby. Since the data was pretty simple (a Hash), and therefore also a primitive type in both Perl and Ruby, YAML seemed like a good fit. It worked almostly completely smoothly; I seem to remember finding some surprises with empty elements, perhaps. I can't quite remember (not at the same PC today). Anyway, the code was amazingly concise compared to the stuff I write to use XML as a Perl-Java bridge.

    In this area, YAML has got some things going in its favour: a fast C-implementation (Syck) that works with PHP, Python and Ruby (it's in the 1.8 core); potentially less code; and less "stuff" to shunt about. I can see it being useful in internal applications, where the ease of cross-platform object sharing is a win; I can't see it taking off in public interfaces, where the preponderance of the (often Java-backed) XML apps is so great. Plus, bear in mind that they're not really the same thing; XML is a far more general-purpose tool than YAML, which is (just) a 'data serialization language.

    cheers
    ViceRaid

Re: Re: Data Exchange between perl and java.
by johnseq (Initiate) on Aug 14, 2003 at 01:40 UTC
    I've used Data::Javascript to serialize data and pass it between a pure perl screen scraping application and an IIS/JScript (ASP) web page.

    You just have a couple lines of code to serialize/deserialize the data. Better yet, the dependency libraries required are less than any comparable method, because you're using the language itself as the serialization format (like Data::Dumper).

    eval'ing foreign code is a big security hole, but I figured that simply including a passphrase in the payload and using https was good enough for an intranet apps.