August 2006 Archives

pat eyler

AddThis Social Bookmark Button

Gregory is a free software developer from Connecticut. He is currently an undergraduate student at the University of New Haven pursuing a double major in Computer Science / Mathematics. His primary focus has been working on Ruby Reports for the last year. This summer, Gregory participated in Google Summer of Code, working on Ruport to implement several features requested by the community. Gregory is also an active member of the new_haven.rb and NYC.rb Ruby Users Groups.

Due to space constraints, there are a couple of excerpts to this interview, located here and here.

Mike Loukides

AddThis Social Bookmark Button

About a month ago, there was a flurry of blogs and articles on what is, and what isn’t, a domain-specific language. I’m not sure who started it, but articles include Martin Fowler’s, Nutrun’s, and Jeremy Voorhis’. At the same time, I was having some interesting conversations about DSLs with Terence Parr, the author of ANTLR. So much for link-dropping.

I think there’s a question that’s more interesting than “what’s the lower bound for a DSL” (essentially the question that Martin is asking), or “is Rails a DSL?” (the question that Jeremy and Nutrun are asking). What makes a working language? Well, there are lots of components, but basically, you have a vocabulary and a grammar. Ruby DSLs are structurally very similar: they define a lot of methods (often via metaprogramming); they typically don’t define any new grammar, but use Ruby’s relatively loose and flexible grammar. So what looks like a nice domain-specific language that requires minimal knowledge of a formal programming language is, in fact, just a bunch of method calls in a formal programming language. The method names are the vocabulary, and the grammar is Ruby. Jeremy calls this a “fluent interface” (and notes that it’s often just good design).

Creating a really good fluent interface is a neat trick: it looks like you’re getting a new language “for free” (almost). You could argue that these fluent interfaces aren’t really DSLs–they’re really just Ruby. But that’s not a very useful or interesting argument. Here’s a more interesting question, which I haven’t seen discussed: what’s the point at which it becomes necessary for a DSL to have a distinct grammar? (I don’t think it was discussed at the DSL session at our FOO conference, which I missed). What’s the point at which the control structures, etc., in Ruby (or whatever the parent language) are no longer sufficient or adequate for the domain? What’s the point where you have to go beyond creating classes and metaprogramming, and generate your own parser with the venerable YACC, or a successor like ANTLR?

After all, it doesn’t matter whether you call it Ruby or Java or Python; most programming languages have fairly similar control structures (if/else, for, while, unless), and in most OO languages, the class system is fairly similar. That works well for computing–but what about other domains? When does the grammar of a traditional programming language, even one as flexible as Ruby, become inadequate?

Whether or not Rails is a DSL, it’s not terribly surprising that it doesn’t require any new grammar. There’s certainly an impedance mismatch between OO languages and relational databases, but it’s not a huge one: Web interfaces, OO languages, and RDBMSs are all things designed by us computer folk, and they’re more similar than different. Could you use a language like Ruby to model business strategies, musical compositions, and other domains where the impedance mismatch is greater? Or would you need a different grammar entirely?

pat eyler

AddThis Social Bookmark Button

This weekend, I flew out to Grand Rapids, Michigan for the first ever RubyConf*MI — one of the first regional Ruby Conferences (David Alan Black reminded me that San Diego held one earlier this year). Other than what might have been the worst flight schedule in my long history of flying it was a great weekend, centered around a great little conference.

It was a well attended conference. There were 58 people there, including the organizers and speakers (an overlapping group). People travelled a lot further than I’d have thought: there were several from Toledo, Ohio (~2 hours); 4 from South Bend, Indiana (~3 hours); a couple from Columbus, Ohio (~5 hours); and one from Ft Collins, Colorado.

The schedule was full, with nine 45 minute presentations separated by 15 minute breaks. A lunch and lots of bottled water were also provided. The presentations were about 2/3 Rails oriented, and 1/3 pure Ruby. Speakers included: Zach Dennis, one of the organizers (who presented twice); Karlin Fox from Atomic Object, who talked about some of their Rails testing practices and tools; David Alan Black, who talked about Relational Database Engineering and Rails; Patrick Hurley, who talked about Ruby, Performance and C; Mark Van Holstyn (another organizer), who talked about using AJAX in Rails; Craig Demyanovich (an organizer and first time presenter, who gave a good introduction to BDD and RSpec; Dan Morrison, who talked about deploying Rails apps with Capistrano; and myself, I talked about libraries for developers.

As a whole the conference was well received, getting an average 4.19 satisfaction rating out of 5 (hanging out with the organizers, I got to see the aggregated data). I’ve also seen some good write-ups including: Andrew Turner’s and Zach Denis’. I also blogged some feedback on my flight home (isn’t free WiFi in airport terminals wonderful?).

If you’re planning a regional conference, I think you’d do well to look at what the RubyConf*MI guys did. I hope your conference goes as well. I know I’m looking forward to next year’s conference in Michigan, I hope I’ll be able to make it back.

pat eyler

AddThis Social Bookmark Button

Brandon Keepers, Mark Van Holstyn, Zach Dennis, and Craig Demyanovich have been working on RubyConf*MI, a regional Ruby conference in Michigan for a while now. Now that they’ve announced it publicly (and opened up the registration — only $20 for a full day), I wanted to talk to them about what it’s like to set up a conference.

I think regional RubyConfs are going to be a big part of the Ruby community. So getting some pioneers’ takes on how to run one should be helpful to everyone who follows.

Update: I’ve posted retrospective interview with the RubyConf*MI team over on my blog.

Gregory Brown

AddThis Social Bookmark Button

The Google Summer of Code program is winding down now, and it’s finally time to take a deep breath and look around a bit. I’d like to try to share with the readers of this blog my experiences with the Summer of Code program, and also offer a little bit of insight for those who are interested in how the whole thing came together, from the beginning to now.

Though the program doesn’t officially end until the 21st, I leave on vacation tomorrow, so this will serve as my end of program reflection. This article is rather long, so for those uninterested in SoC, you may wanna mosey on along now. ;)

pat eyler

AddThis Social Bookmark Button

Ever since I saw Charlie Savage’s blog post about ruby-prof 0.4.0, I’ve been thinking about how great it was to see faster and better profiling tools (how cool are cross-referenced call graphs?). Now that I’m writing up my talk for RubyConf*MI , I’ve been looking a little bit deeper. For those of you not planning on being in Michigan on August 26th (your loss), here are three blog entries I’ve put together about ruby-prof and profiling in general: Profile and ruby-prof, ruby-prof and call graphs, and Profile and ruby-prof: getting specific.

I’m constantly amazed at how many tools are floating around out there for Ruby developers. What are your favorites?

pat eyler

AddThis Social Bookmark Button

First, there were the threads about rewriting Ruby apps in C, then I wrote a pair of follow up posts (here and here). These got picked up by an article over on InfoQ, which also pointed to How to Create a Ruby Extension in 5 Minutes. Finally, zenspider picked that up, tried it out, and wrote about his take on RubyInline and extensions: Writing C Extensions, Improved.

The traditional way meant creating a 5 line mkmf generator, 7 lines of C, running through the two step build process to end up with a dynamic library that can be required by ruby programs. With RubyInline, it took 8 lines of Ruby and C that live inside the Ruby program itself — the best part is that their now user run configure and compile cycle. they just run the Ruby program, and RubyInline does the work.

To quote zenspider, “It doesn’t get simpler than this… and really, it shouldn’t ever be more difficult than this.” Go take a look at the blog posts listed above, then go download RubyInline and make your life a whole lot easier.