The best kittens, technology, and video games blog in the world.

Thursday, July 19, 2012

magic/xml for Ruby on github

Silver Profile at Window - Slightly Blurry 702 x 749 by ♥ Crystal Writer ♥ from flickr (CC-NC-SA)
Making all my old software publicly available on github continues. Now it's time for magic/xml - which can be now downloaded from github here.

I needed to do a few fixes for Ruby 1.9 compatibility - mostly Array#to_s is now Array#inspect, not Array#join, and it works just fine now with either 1.8 or 1.9.

Over all these years I haven't used magic/xml as much as I thought I would. Somehow the XML and XHTML dominance everybody was expecting never materialized, and instead JSON and HTML5 took over. I can't say I'm too unhappy about this development - but magic/xml remains the most convenient way to solve the (now less important) XML problem in Ruby.

I think I might have overdone monkey patching a bit - especially with regards to pattern matching, which in Ruby is pretty hard to extend cleanly due to lack of multimethods (and general massive hackery in Ruby's implementation of it). I'd love it if some future version of Ruby did pattern matching right, but since no other language ever did so (I might write more about it sometime later), it might be too much to hope for.

No comments: