[Ironruby-core] How can IronRuby replace XML?

C. K. Ponnappa ckponnappa at gmail.com
Tue Dec 15 05:11:50 EST 2009


Hello Shay,

Typically XML gets to be a pain when it goes from being configuration to 
a mini language. The classic example is an Ant/Nant build. The build.xml 
looks real cute and readable as long as you're doing the standard 
compile -> unit-test -> functional-test -> package flow on a toy 
project. Once you're on real-world project with a large codebase of 
several thousand classes and multistage/pipelined builds, then that XML 
rapidly becomes brittle, hard to change and hard to maintain.

If you examine the history of Ant/Nant, you'll notice that over time 
(due to popular demand) language constructs like branching have been 
added changing the build config from a configuration to a mini DSL. But 
this does not remove the basic problem - that one cannot trivially 
refactor a build config that contains logic (and is thus no longer a 
config) to extract abstractions and keep things civilized.

The Ruby contrast to this is Rake (not YAML directly - YAML as pure 
configuration has no real advantage over XML that I've seen beyond being 
more human readable). Rake builds pwn. Seriously. I know I've said this 
before on this list, but I love Rake, so I'll say it again - all .Net 
and Java builds should be moved off Ant/Maven/Nant to Rake. It has none 
of the limitations of an xml based build config. You can reafctor it. 
You can even write tests for it, should you need to. I've seen it done, 
and it works really well.

Is that fair example?

Cheers,
Sidu.
http://blog.sidu.in
http://twitter.com/ponnappa

Shay Friedman 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
>   


More information about the Ironruby-core mailing list