Wednesday, August 24, 2005

Ruby Everywhere!

Hey, drop me a line if you know how to do a Word Mail-Merge through OA.

Anyways, another win for Ruby. Excel automation is a piece of cake, and it doesn't have the interop funkyness of c#. Yup, converted another coworker to Ruby today. It's infecteous. :)

Oh, btw, if you're using Ruby and DBI's dbd_ado driver, MAKE SURE TO USE SQLOLEDB database connection strings! That's the one that looks like Provider;DataSource;InitialCatalog instead of Driver;Server;Database. Update and Insert statements will magically fail to work with no warning if you don't. It can be very frustrating.

A buddy at work finished parsing a 1.3GB file in Ruby today. Parsed and written out to Yaml for archiving takes around 20 minutes. Having done a fair amount of c# processing I'm fairly impressed at Ruby's performance, and this is without StringBuilders or custom Buffers or Arrays or anything. He tried 'em of course, but the performance benefit was so slight as to not be worth the extra lines. I had some serious gut-feeling doubts that Ruby would be up to the task, but I'm pleased to say I couldn't have been more wrong... EXCEPT: Ruby really needs OS threading. It's not such a huge impact on this file, but there's definitely times where the resources could be better utilized, and it takes more thought to build a smooth process than should really be necessary. (Though still, not much code)

I'm convinced that Kernel::eval() could play a role in creating a "Smart Parser" if I got a chance to sit down and have at it for a few days. Something that could use a data-dictionary to derive what it could, and actively ask questions to fill in it's knowledge gap when it came across areas of files it couldn't. Might sound a little Sci-Fi, but I'm convinced it's feasible with the right coders behind it (and hey, that might not be me ;) ).

Ruby's certainly spreading like wild-fire at work it seems. Most of my and a collegue's (sp?) current work is now in Ruby.

Now I just have to figure out how to automate a mail-merge... ugh.
Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?