[Ironruby-core] How can IronRuby replace XML?

Jimmy Schementi Jimmy.Schementi at microsoft.com
Tue Dec 15 04:48:05 EST 2009

> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Mark Ryall
> Sent: Tuesday, December 15, 2009 1:33 AM
> To: ironruby-core at rubyforge.org
> Subject: Re: [Ironruby-core] How can IronRuby replace XML?
> That aspect of the blog entry was a little unclear.

Sorry! Hopefully our discussions here can clear up what I meant, so I can update the post accordingly.

> I'm not a big fan of XML.  XML has used for all sorts of different purposes -
> object serialisation, application configuration, etc. - although simpler
> alternatives exist, not all of these are completely evil.  These applications
> could not really be described as using XML as dynamic language.
> YAML is just another markup language and isn't specifically associated with
> ruby - there are YAML parsers for every programming language. It can be used
> as a drop in replacement for these sorts of uses of XML (object serialisation
> and configuration).
> One application of XML that can be avoided by using ruby is msbuild.
> Build scripting needs to be quick and convenient so ant, nant and msbuild
> have this awkward xml based representation of tasks/targets.
> If you want to extend these tools, you need to compile some code and load it
> in to your build file.  In this context I guess you could describe XML being
> used as a dynamic language.  Instead of this ugly and awkward approach, you
> can use something like rake which is an internal DSL for creating builds.
> XAML is another attempt at creating a dynamic language with XML and ASP.NET
> is another.  Both could be replaced with a more elegant and expressive ruby
> DSL.
> Is that the sort of thing you had in mind Jimmy?

Yes. I say in the post that XML has been used over and over again to add dynamic feature to .NET and Java, and I proposed using Ruby as a much more elegant and expressive solution.

Shay, while XML for configuration is a valid use (though, I'd argue Ruby would make a way better configuration language =)), XML tends to contain more than just key-value pairs that configuration is usually associated with. Mark brought up MSBuild as an example of XML which ends up describing a TON of behavior, which really makes it more of a domain-specific language. This tends to be one of the great abuses of XML which .NET developers are almost forced to use, since they don't have any "scripting" languages in their toolbox.


> On Tue, Dec 15, 2009 at 7:17 PM, Shay Friedman <shay.friedman at gmail.com>
> wrote:
> > Hi there,
> > Jimmy wrote in one of his latests posts that Ruby can replace XML. I
> > didn't understand this statement because XML files are static
> > configuration files (and Ruby also has an equivalent - YAML)...
> > How can Ruby code replace XML files?
> > Thanks!
> > Shay.
> > --
> > --------------------------------------------------
> > Shay Friedman
> > Author of IronRuby Unleashed
> > http://www.IronShay.com
> > Follow me: http://twitter.com/ironshay
> >
> > _______________________________________________
> > Ironruby-core mailing list
> > Ironruby-core at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/ironruby-core
> >
> >
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core

More information about the Ironruby-core mailing list