The Portland White's

Family blogs, photos, files and news.
Welcome to The Portland White's Sign in | Join | Help
in Search

Kelly White

The professional, the personal, and everything else...

Initial Thoughts on IronRuby - Eating Some Humble Pie

July's PADNUG meeting featured John Lam talking about the work he is doing with IronRuby. That meeting was amazing! It's crazy how people (myself included) can get excited about writing compilers, interpreters, parsers, etc. Anyways, these are some of the thoughts I wrote down right after attending the event. It's just taken me a while to finally post it...

During last week's PADNUG meeting I did get a chance to ask John Lam some questions I had previously asked Scott Hanselman and which Scott suggested I should direct towards John.  Scott has a video of the presentation.

  1. When I contribute to IronRuby should I code using .NET libraries and methods or do lower-level type stuff (e.g. pinvoke, etc)?  Here John said he would like to see the code using the higher-level .NET classes and methods.  I'm guessing this is because of a "get it working now and optimize later" type of methodology being used with the community contributions (which would also make them more usable).
  2. What about creating domain specific languages with the DLR?  The Pragmatic Programmer talks about creating and using domain specific languages.  Scott and I talked about how Ruby is great for this.  However, I asked John about using the DLR to create domain specific languages and whether he thought this was a good idea.  I was very surprised that he shot this idea down.  He talked about how I'd have to write my own parser, come up with my own grammar, and that this is just plain difficult.  However, that's expected in creating a domain specific language which is what Andy Hunt and David Thomas recommended in their book.  They talked about designing a grammar, having to use Lex and YACC, and the like.  So I'm wondering if John’s comment had more to do with the fact that tools like Lex and YACC aren't available for the DLR?  I mean, you could use Lex and YACC right now, but it sounds like there is something else missing to make it possible for a normal person like myself to do this in a reasonable amount of time.

Note to self, there is that new book on building domain specific languages which I should probable pick up before Christmas.  You see, when John said I shouldn't use the DLR to create my own domain specific language I decided to take that as a challenge and actually do it.  I'm giving myself one year to hit that goal (by next year's OSCON), but really hope to have proven or disproven myself before then. 

Humble Pie Time

Previously I've posted about Ruby and compared it to VB.NET or said it was a horrible choice of platform for a production system because of its inability to scale.  Yes, I am a jackass.  I'm sorry for everyone I've offended.  I've spent more time with ruby and now I currently like it.  Let me tell you why.

I constantly miss the days where I would fire up bash and write a one-liner to take a file and manipulate it to my heart's content.  If I wanted something more complex I'd write a short Perl script.  Life was beautiful with Perl, and I was approaching the point where I could almost work at the speed of thought.

After switching over to the .NET world I found my productivity initially dropped, but because I could do so much more elegant and complex algorithms/solutions, I didn't mind.  Visual Studio had regular expression support and I could get by.  Plus if I really needed to, I could write a short program to do what I had previously done in Perl (granted, it took more time and lines of code to get it done).

I'm currently working on a project that at times has required me to work with and manipulate huge amounts of similar data.  I found myself in another situation where I was doing "search and replace" in Visual Studio using their regular expression support.  Let me just say that my one gripe with Visual Studio is that it does not support Perl regular expressions.  THIS IS HORRIBLE!!!  ScottGu, I know you don't read my blog, but please get this fixed, PLEASE!!!

Anyways, I was frustrated beyond Neopoleon (I'm not sure exactly what the means, but trust me, it's bad).  I didn't want to write a program to do what I was trying to do, I just wanted it to work.  I could see the one-liner in my head, why should it take 15 separate steps using Visual Studio's search-and-replace and then still now work.  OH THE PAIN AND TORMENT, IT'S JUST TOO MUCH!!!

I decided I'd had it and needed to find another solution.  I've tried Cygwin before but hate the install and didn't want to go through that again.  John Lam was going to be presenting at PADNUG later that night (talk about coincidences) so I figured I'd give IronRuby a shot, I knew that it's regex support was what I wanted and I should be able to come close to a one-liner with it.  I downloaded and messed around with IronRuby for about an hour, but decided it wasn't ready for what I needed (I do think it will be once it is done, however).  At that point I installed the windows version of Ruby.  I then wrote my script, wrote my regexes (Damn-it! Ruby doesn't have a s/match/replace/ operator like Perl, that was irritating), and got my modified output in the next hour.  The hardest part was installing Ruby and then trying to figure out how to code in it.  The nice part is I've got that script done, so as I need to use it again I just modify my regexes and away I go.

Let me just say that I am very happy and pleased with what I've seen so far with Ruby.  I accept it for what it is.  As long as I don't try to fit it into a spot where it doesn't belong or shouldn't be used then I should be alright.  Last week I ordered the "pickaxe" book, Programming Ruby.  This book is huge, which isn't a bad thing as it reminds me of my old "camel" book.  That book brought me a lot of comfort, and I feel pretty safe in expecting the same out of this one.

It's amazing how much peace can fill a person's heart once they repent.  Smile  I feel good.  I really think Ruby will fill the void in my life that Perl used to.  I'm really excited for IronRuby and I hope to be able to contribute to it.

PS:  I'm still anti-Rails. 

Published Tuesday, August 21, 2007 11:00 PM by kelly
Filed under:

Comments

No Comments
New Comments to this post are disabled
PDXUX.Net Logo
PDXNA Logo
Powered by Community Server, by Telligent Systems