From: Richard Kilmer Date: 2003-03-19T14:19:09+09:00 Subject: Re: XML too hard (YAML opportunity?) I got this weird sense that people were talking about me...and here you are! First, YAML and XML are different. XML is a format for writing data, YAML is format for serializing language objects. That is different. If I wanted to take a series of Ruby objects and write out an XML file that contained their attributes I would write emitter code (possibly as methods on the object 'to_xml'...possibly as a separate method/class), and parser code to read them in and construct instances. If my Ruby model changed, I would keep the emitters/parsers updated. A bit of a pain to be sure. With YAML, I write Ruby code (but no emitters and parsers). I craft my objects a bit with YAML (with to_yaml_properites, etc) but that is really for attribute order/readability...but nothing like XML. And YAML is compact, yet readable (and simply editable). The configuration files of FreeRIDE used to contain only string values because it was XML...we could have supported a "type" attribute, but you would still have been limited. Now you can store anything in a configuration file, which is liberating. That something is a boolean, string, integer, array, hash or whatever...YAML deals with for me. That is really nice. Oh, and did I say that YAML files are readable? Here is a simple FreeRIDE plugin configuration file: --- !ruby/object:FreeBASE::PluginConfiguration name: rubyide_util_logger version: 1.0 autoload: true require_path: freebase/logger startup_module: FreeBASE::Plugins::Logger That's it...YAML parses that and creates a PluginConfiguration object for me. Simple. Oh, and version is a float, autoload is a boolean, etc, etc. BTW: I use XML quite a bit too, I am just stating a bit of the case for YAML's value. -rich On Tuesday, March 18, 2003, at 11:35 PM, wrote: > >> >> The only example I can/will give is Rich Kilmer, >> who is a YAML enthusiast (and who impresses me >> with his technical ability). He, of course, is >> the reason FreeRIDE uses YAML. > > Yes, I know, and YAML is perhaps better for config files where > name=value is too weak and XML is overkill. > > (BTW, does YAML support external entities?)