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
| [reply] |
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. | [reply] |