In my experience of building systems in Ruby over the last 7 years, I believe there is one main feature of Ruby that made these systems successful. Before I get to that unique feature of Ruby I want to describe a few of the first systems I built in Ruby and what I learned from them.
The first system I developed in Ruby was a testing infrastructure for a distributed multi-agent system being developed and funded by DARPA. DARPA is the research arm of the US Department of Defense. This project's grand challenge was to build a software system that could survive "in theater". The system had to continue functioning in a war-like situation with enemies attacking the software or the hardware the software is running on. The main function of the software (beyond surviving) was real-time logistics planning. Logistics includes routing supplies to people and places where its needed. That may not sound very interesting but logistics happens to be the key function that makes large groups operate effectively.
What I built for DARPA was a testing framework that observed the events being generated by the software agents using XMPP and then sent commands to these agents using HTTP. The core of the framework was a Domain Specific Language (DSL) which allowed us to script the multi-agent system. Initially this scripting was limited to simple things, but that basic automation helped the program significantly. In the first four months I wrote all the scripts.
During the next year the DSL was rewritten and then expanded to include all the forms of network and system attacks the program was tasked with creating. What was really cool was the majority of the extensions to the DSL were written by other non-Ruby developers in the program. The multi-agent system was written in Java, but each of the 80 people contributing to the attack-side of the program ended up learning enough Ruby to encode their attacks. We also expanded the DSL to generate the logistics rules and from the rules the agent society definition.
This was a large deployment. We had 300 dual core machines with 4GB of RAM and 10,000 agents running across them. The Ruby script that was generated for a single agent society definition was over 1 million lines of code. The events that Ruby handled per hour were well over 3 million messages of 1-10k each.
By the end of the program, Ruby was used to generate the entire agent configuration, drive the simulation, generate the attacks, record the results, generate reports and summarize them for the Program Manager. This development taught me three very important lessons about Ruby:
- Ruby is an excellent language to encode domain specific logic in. Its flexible syntax makes Ruby almost disappear and what's left is domain terms. Once the domain is encoded its very easy for domain experts to use the Ruby DSL. These domain experts may not be able to write it, but they most definitely can read and validate it. When people talk about a 10x developer productivity increase, I believe this is the primary reason for it, the close communication between domain experts and those building the system.
- Programmers can quickly learn Ruby and can be effective in it, especially if they learn it in the context of something they know. Every person on our project that wrote Ruby enjoyed it. Their enjoyment was the main motivator to them becoming more and more proficient in Ruby. I believe any good programmer can be a good programmer in Ruby.
- Ruby scales. We pushed Ruby to unbelievable levels on this program and it exceeded our expectations. The application under test was critical which made the testing framework even more critical. There were places in our code where we had to drop into C to perform computationally intensive operations. The ease of doing this is another key aspect of Ruby's scalability.
The second system I developed in Ruby was a desktop-based functional prototype for a complex system that was being designed for the US Air Force. The goal of this system was to create a unified view across the 18 different groups that coordinate the movement of military aircraft and provide mid-air refueling with tankers.
The team that hired me to do this was a Human Computer Interface research organization that had spent the prior 3 years traveling the world to interview and capture the requirements of all 18 groups. They had written a very detailed user interface specification for the system. They wanted to deliver this user interface specification along with a functional prototype to show the final implementors what they meant in the text & pictures of their design.
The primary challenge was time. They had less than 2 months left to build the functional prototype after a failed 24 person-month Java effort. I chose Ruby and Flash to build the prototype in. I will not focus on the Flash side of what I did because the Ruby side of this, although non-visual, ended up being transformative to the project.
My first meeting with the research scientist (who had become the domain expert) occurred in Boston. On the flight up, I had no idea where to start with the massive tome of information in the specification they had created. After arriving in her office we sat down in front of my computer and I brought up a text editor. I asked her to describe the the concepts in the domain. As she described it I typed in what I knew was valid Ruby syntax. As we encoded her domain knowledge we created a DSL on the fly. After 5 hours of talking and typing we had produced a very elegant 400 line script that she could read as her domain and I could read as code. On the flight back to DC, I wrote the code behind this syntax to enable the construction of the domain model objects (I called this approach syntax-driven development.)
Over the next 4 weeks we iterated on the domain model. I wrote scripts to parse flight plans and convert them to DSL code and flushed out more of the domain. I sent snippets of the DSL to domain experts for review. What amazed the team was the DSL encoding of the specification exposed numerous examples where the specification was incomplete or contradictory---something that none of them had seen in their reviews of it.
The final 4 weeks were spent developing the Flash-based UI which was driven by the domain objects in Ruby. In the end we met our goals. The functional prototype was delivered along with the updated specification. Although the user interface specification was main product delivered to the implementation team, the Ruby DSL was an important tool they could use to better understand the domain.
So, what did these two projects have in common? In both projects I used Ruby to implement the system through a language customized to the project domain. These domain specific languages became effective mediums for team communications. In my experience, this is the single most important feature of the Ruby language---capturing the domain in a language the entire team can speak. If you believe clear communications is an essential quality of highly effective teams, this feature is something that you should strive to exploit in your own Ruby projects.
Thanks for sharing your experiences.
Nice to see you still plugging away with Ruby, and in such a meaningful way. :)
Posted by: Guy Hurst | Wednesday, September 24, 2008 at 12:18 AM
Ruby did scale because you did use C? Didn't C scale then and Ruby not?
I'm a little confused.
Peace
-stephan
Posted by: Stephan Schmidt | Wednesday, September 24, 2008 at 01:16 AM
>> Ruby scales
>>Ruby did scale because you did use C? Didn't C scale then and Ruby not?
Languages don't scale. Applications do.
Anyways, being able to write in a domain-specific language subset is definitely nice. I think that's why libraries like Jquery are popular.
Posted by: LeoHorie | Wednesday, September 24, 2008 at 07:59 AM
Great post!
It's make me want to jump in Martin Fowler's Domain Specific Languages Immediately.
http://www.martinfowler.com/dslwip/
Posted by: Tien Dung | Thursday, September 25, 2008 at 02:10 AM
This is really interesting.
Any chance you could post some examples of the DSL's you created?
Posted by: Paul Drummond | Thursday, September 25, 2008 at 04:05 AM
http://gogle.com google
Posted by: 4ga12nkhgvp3eutlx8e0 | Monday, October 13, 2008 at 12:10 PM
People should read this.
Posted by: Phiala | Monday, October 27, 2008 at 08:51 PM
I just came across your blog about and wanted to drop you a note telling you how impressed I was with the information you have posted here. I have a site Understanding PPC http://understanding-ppc.110mb.com so I know what I'm talking about when I say your site is top-notch! Keep up the great work, you are providing a great resource on the Internet here!
Posted by: Understanding PPC | Thursday, October 30, 2008 at 01:44 AM
People have to get know some facts referring to this topic, because it is really good to order custom essay or buy term papers in the essay writing services or it is really possible to buy an essay here!
Posted by: Amelia33sL | Monday, January 04, 2010 at 07:04 PM
Many institutions limit access to their online information. Making this information available will be an asset to all.
Posted by: custom research paper | Thursday, February 18, 2010 at 08:43 AM
Thank you for a good story, I really enjoyed your blog. Be sure to give a link to your friends!
Posted by: why cant i get pregnant | Thursday, February 25, 2010 at 06:45 AM
I have a programmer friend and he also said Ruby is one of the easiest to encode...well looks like many love Ruby
Posted by: essays | Friday, March 19, 2010 at 02:46 AM
I am thinking if indeed, this is the safest to use. The encoding is easy, that is a plus, but I am thinking if this could be the best choice in the long run.
What you think?
Posted by: Essay Writing | Wednesday, June 02, 2010 at 04:51 AM
I am thinking if indeed, this is the safest to use. The encoding is easy, that is a plus, but I am thinking if this could be the best choice in the long run.
What you think?
Posted by: Ayırma Büyüsü | Saturday, June 05, 2010 at 06:56 AM
It worked for me.I never thought its gonna be so easy.Thanks a lot for this lovely tutorial.
Posted by: Custom Term Papers | Tuesday, August 10, 2010 at 02:17 AM
This is very true, best Ruby feature is to implement the system through a language everybody can speak. Check more at www.writessay.com, www.customtermpaper.org, www.qualityresearch.org.uk. You could find apps at www.marketingwebbusiness.com.
Posted by: Essay Writer | Friday, August 20, 2010 at 09:14 AM
Over the next 4 weeks we iterated on the domain model. I wrote scripts to parse flight plans and convert them to DSL code and flushed out more of the domain. I sent snippets of the DSL to domain experts for review. What amazed the team was the DSL encoding of the specification exposed
i really don't understand that.
Posted by: guild wars 2 gold | Friday, September 03, 2010 at 05:46 AM
please take a look at our website about something jordan,i think you will like and buy someting,thanks.
Posted by: jordan 10 | Wednesday, September 15, 2010 at 06:04 AM
I just wanted to say that I found your site via Goolge and I am glad I did. Keep up the good work and I will make sure to bookmark you for when I have more free time away from the books. Thanks again!
Posted by: How to conceive a girl | Tuesday, October 12, 2010 at 07:30 AM
The custom paper associated with this post accomplishing is a very time consuming task, but when you’re not a great expert, you got an opportunity to get the facts about buy research paper in the essay writing service effortless.
Posted by: buy essay paper | Sunday, October 17, 2010 at 06:16 PM
beyond kudos...incredible job guys...congrats
"If you see the way the computer works, it's like Predator or something," says Billy Jurewicz, founder and CEO of Space150. "Each person has a halo with data." Adds Jurewicz, "The board now is like the iPod 1.0. We're going to be updating this more and more." Future versions, with better cameras, might include the model holding a magnifying glass to the crowd, or picking someone up and holding them up to the face of the billboard, so the entire crowd can get a closer look. "People just love to see themselves." And the billboard is a huge mirror in Times Square, one of the most famous places in the world.
Posted by: coach outlet | Tuesday, October 26, 2010 at 09:32 PM
Are you felt that it is right? I do not really think that, but can keep personal opinions!
Posted by: coach outlet | Friday, October 29, 2010 at 10:56 PM
Different students need a long time to understand the key issue of the paper writer essays. But when you don’t have time, this would be much better to buy term papers online. Then it would be real to save reputation.
Posted by: essays for sale | Saturday, October 30, 2010 at 06:41 AM
I've had someone ask why this script is needed since Russell Brown has one called Place-O-Matic. FYI: that script is designed to open two interpretations of one raw file (like the example that shows two images combined in my post), but it will not allow you to simply open a raw file with a single interpretation of it, which is what I need to do 95% of the time
Posted by: ugg bailey button | Monday, November 01, 2010 at 04:39 AM
Home every day happy to see her mother smile is my happiness.
Posted by: Air Jordan Shoes | Tuesday, November 02, 2010 at 11:42 PM
You are eternal beings, you are God force.You are our god!
Posted by: cheap nike shox | Wednesday, November 03, 2010 at 03:57 AM
This site is really great for taking free trial tests!! Everything is okey with your research career if people detect the experienced custom essays writing corporation I recommend custom term papers.
Posted by: college papers | Wednesday, November 03, 2010 at 01:35 PM
Today is not yesterday. We ourselves change. How then can our works and thoughts, if they are always to be fittest, continue always the same?
Posted by: Supra skytop | Wednesday, November 03, 2010 at 11:55 PM
wow.. is that really his best feature?
Posted by: Puppy Training Biting | Sunday, November 07, 2010 at 09:14 AM
Thank you for sharing such intuitive experience using Ruby.
Posted by: Write Essay | Monday, November 08, 2010 at 05:41 AM
Can you compare Ruby's ability to contain domain knowledge to Case-based Reasoning.
Posted by: Quality Research | Monday, November 08, 2010 at 05:43 AM
Would it be possible to put together a number of tutorials summing up your experience in Ruby.
Posted by: Custom Term Papers | Monday, November 08, 2010 at 05:44 AM
This is absolutely interesting. entering in the realm of technological advantage. Excellent page you have in here.
Posted by: Rug Cleaning | Tuesday, November 09, 2010 at 11:16 PM
That love, not time, heals all wounds?
Posted by: air yeezys | Friday, November 12, 2010 at 11:01 PM
Custom essay writing delivers the most when professionals do the work! Experience and dedication are the factors that will lead you to success!
Posted by: custom essay | Monday, November 15, 2010 at 07:56 AM
The Ruby's Best Feature? are the one given in the information I think that the given information about the the Ruby's Features is really nice one for it.
Posted by: Term Papers | Tuesday, November 23, 2010 at 09:01 AM
Which OS? Textmate is the standard on OS X. I've tried Radrails and others, but in the end I prefer the lean editors for Ruby. I'd probably use vim on Linux.
Posted by: College Paper | Thursday, November 25, 2010 at 02:29 AM
Good work,hope your blog be better!I just want to make a blog like this!
Posted by: wholesaler | Sunday, November 28, 2010 at 08:34 PM
Great post, I love Ruby's best feature.
Posted by: Personal essay | Tuesday, November 30, 2010 at 05:30 AM
I think that the Ruby's Best Feature? is really nice one to ask for because the features of any thing makes it more good and I think this kind of thing is really good one to talk about.
Posted by: Term Papers | Thursday, December 02, 2010 at 07:54 AM
good.When I visit this good webiste,Just to say,I am glad to read so good article in the webstie.Well,OK.I have to say,what a wonderful blog it is.thank you for your sharing so good articles in the website.I like it very much.It is very interesting in it.Look forward to reading so good articles in the website.
Posted by: replica watches | Monday, December 13, 2010 at 09:53 PM
This is my first time i go post. I collected so many interesting things in your site especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.Regards The nice thing about cruises for cheap Caribbean vacations is that your kids can go pretty much unsupervised around the ship
Posted by: Windows 7 Key | Tuesday, December 14, 2010 at 09:46 PM
There are a number of organizations dedicated to supporting product development professionals, such as the Product Development and Management Association and the Product Development Institute.
Posted by: Term Papers | Thursday, December 23, 2010 at 07:00 AM
You have raised valid points, thank you fo sharing this very useful article.
Posted by: milwaukee carpet cleaners | Friday, December 24, 2010 at 02:43 AM
This is some thing good to ask about Ruby's Best Feature?, because Ruby Feature is some thing which everyone does wants to know about because it is really nice to have such features come for usage.
Posted by: Online Research Paper | Friday, December 24, 2010 at 06:16 AM
All good issues require lots of hard work. Therefore, the writing term papers company tried a lot to gain excellence. Then, I purchase my academic papers because of it.
Posted by: research essay writing | Sunday, December 26, 2010 at 01:54 AM
Valuable informations you offered here in your article. Great job!
Posted by: truck apu reviews | Sunday, January 02, 2011 at 05:12 PM
This is definitely worth reading, I have enjoyed it so much.
Posted by: pest control Victoria BC | Sunday, January 02, 2011 at 05:14 PM
Thank you for all the hard work you putt in Ruby. This is also a nice feature.
Posted by: Ron CHD Maintenance | Tuesday, January 04, 2011 at 11:07 PM
In your seven years of experienced, I think you have a lot of development and achievement are made. And thank you for the sharing you did in Ruby.
http://tabletpcreviewsblog.com
Posted by: Amazon Kindle 3 Review | Thursday, January 06, 2011 at 10:02 PM