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.
It does seem that everybody is into this kind of stuff lately. Don’t really understand it though, but thanks for trying to explain it. Appreciate you shedding light into this matter. Keep it up!
Posted by: dsi credit repair reviews | Monday, March 21, 2011 at 06:25 AM
This was much informative article. thanks for sharing this information's here. we too had the similar problem and got a solution using your information.
Posted by: insanity review | Monday, March 21, 2011 at 08:48 AM
Thanks for sharing with us such interesting link.
Posted by: rjm acquisitions | Monday, March 21, 2011 at 05:50 PM
It worked for me, I never thought its gonna be so easy. Thanks a lot.
Posted by: lexington law complaints | Tuesday, March 22, 2011 at 08:57 AM
Job Training Courses. This development is such a model of the fresh programmers graduate. By the way I am James, I'm taking training courses at http://trainingcenter.com to enhance my skills.
Posted by: training courses | Tuesday, March 22, 2011 at 10:10 PM
I have not had much experience with Ruby, but it does seem intriguing. Your post only supports this idea.
Posted by: Speed Up Computer | Wednesday, March 23, 2011 at 12:03 PM
Those words add up to a strong recommendation of Ruby, in my opinion. I will check it out myself for my next project, although mine can not be as big as yours.
Posted by: auto insurance quotes | Thursday, March 24, 2011 at 04:20 AM
I am deeply in love with every single piece of information you post here.
Posted by: Shobi | Thursday, March 24, 2011 at 08:40 AM
Thank you so much for sharing on this such a great experienced I guest you have more knowledge from them.
Posted by: computer slow | Sunday, March 27, 2011 at 09:16 PM
realy nice job!and I will looking for your comment.You should come to my website to search what you need~
welcome everyone come to my website
Posted by: cheap laptop battery | Wednesday, March 30, 2011 at 06:22 AM
Ruby is a great system that you've develop. I think for sure this system is more helpful not only in our country but also to our neighboring countries. This experience you have shared is an great inspiration to those developers.
training courses - http://trainingcenter.com/corporate_training.htm
Posted by: training courses | Thursday, March 31, 2011 at 02:47 AM
Brilliant blog, thank you very much. It seems very well written and I have taken my time to read it thoroughly.
learning card
Posted by: Account Deleted | Thursday, March 31, 2011 at 03:07 AM
I think ruby on rail is best source of blog lovers.
Posted by: muslim matrimonials | Thursday, March 31, 2011 at 06:57 AM
Well I need to know about all regarding ruby on rail.
Posted by: asp.net ajax chat | Thursday, March 31, 2011 at 08:54 AM
Nicely presented information in this post, I prefer to read this kind of stuff. The quality of content is fine and the conclusion is good. Thanks for the post.
Posted by: restore credit score | Saturday, April 02, 2011 at 12:50 AM
Awesome information you got here. You truly realize this and I am glad I stumbled this post by you thanks a bunch.
Posted by: Scarlet Cary | Tuesday, April 05, 2011 at 06:06 AM
Good work, hope your blog be better! i just want to make a blog like this.
Posted by: improve credit rating | Tuesday, April 05, 2011 at 11:48 PM
Thank you for this post, It was a great read which was extremely helpful.
Posted by: house cleaning cincinnati | Wednesday, April 06, 2011 at 06:55 AM
Thank you that you made the interesting information associated with this good post.
Posted by: maid services cincinnati | Wednesday, April 06, 2011 at 07:28 AM
I really enjoyed this article. It is always nice when you read some thing that is not only
informative but entertaining. Excellent! that is not only informative but entertaining. Excellent!
Posted by: Essay | Wednesday, April 06, 2011 at 11:59 AM
I admiring time and effort you put in your blog, because it is obviously one great place where I can find lot of useful info.
Posted by: insanity workouts | Thursday, April 07, 2011 at 07:39 PM
I like the way you wrote this article it is awesome
Posted by: custom term paper | Friday, April 08, 2011 at 06:59 AM
Thank you so much for sharing on this wonderful experienced, I guest you gain more knowledge and development you made.
Posted by: credit restoration company | Saturday, April 09, 2011 at 11:08 PM
You've got to realize that things are working well. Economic condition is keeping the marketing alive.
Posted by: affordable health insurance | Monday, April 11, 2011 at 12:05 PM
Definitely you well doing a great job! Thanks for posting.
Posted by: fix windows xp | Friday, April 15, 2011 at 03:55 AM
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
Posted by: vocabulary builder | Saturday, April 16, 2011 at 02:50 AM
Make a decision and live with it's consequences for either good or bad it may be.
Posted by: custom kitchen cabinets design | Sunday, April 17, 2011 at 03:34 PM
Excellent piece of writing I am very thankful to you. Keep writing such kind of information on your blog.
Posted by: College admission essay examples | Tuesday, April 19, 2011 at 01:36 AM
Very nice info...All good issues require lots of hard work.
Posted by: apex credit services scam | Tuesday, April 19, 2011 at 10:43 PM
Your blog is really helps for my search and i really like it.. Thanks a lot..
Posted by: cincinnati maid service | Wednesday, April 20, 2011 at 01:08 AM
My apt. has been broken into I tried to talk to them about moving me to a different building but they refused so I will have to write a letter..I am going to use this letter as a template but if there’s anyone out there to help me or guide me with writing a letter with my situation
Posted by: thesis writing service | Wednesday, April 20, 2011 at 07:28 AM
cnn
bbc
foxnews
news
msnbc
yahoo news
abcnews
Posted by: cnn | Thursday, April 21, 2011 at 11:28 PM
I just started taking a Ruby class at school. The features mentioned make me glad I did.
Posted by: lexington law | Friday, April 22, 2011 at 12:57 PM
A good read, definitely worth a cut and paste. Thanks!
Posted by: Write eulogy | Monday, April 25, 2011 at 01:53 AM
I appreciate examing what you had to say, You have an splendid knowledge on the subject facts and I look forward to studying more of what you have to disclose.
Posted by: Cheap John Legend Tickets | Tuesday, April 26, 2011 at 08:38 AM
This is brilliant, very good information, interesting stuff. thanks and keep it up.
Posted by: find people free | Thursday, April 28, 2011 at 08:13 PM
personally i dont like Ruby, I have tried it once but i am not comfirtable with it. I am happy with other alternate solutions that i can use easily to do my stuff.
Posted by: marathi sms | Friday, April 29, 2011 at 03:10 AM
I admire the way you share this topic. I am sure lot of reader love it too.
Posted by: uniblue powersuite reviews | Monday, May 02, 2011 at 04:47 PM
I am very interested this topic hope you will write more on it in future posts.
Posted by: digital camera reviews | Thursday, May 05, 2011 at 10:37 PM
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: bad boys 3 | Friday, May 06, 2011 at 10:28 AM
I am simply out of words after reading your blog. I want to appreciate the way you handled such a complicated subject.
Posted by: 350-001 | Monday, May 09, 2011 at 12:21 AM
We definitely learned from our expriences, Keep up the good work and good luck.
Posted by: best credit restoration companies | Monday, May 09, 2011 at 06:32 PM
Excellent article.Its real a reputable article. It gives me lots of pleasure and pursuit.
Posted by: thesis writing service | Tuesday, May 10, 2011 at 02:54 PM
I am interested learn ruby, I think its cool.
Posted by: ankle braces | Thursday, May 12, 2011 at 02:59 PM
Thank for sharing this useful info for us. I didn't have the any idea about this before.
Posted by: bankruptcy credit report | Tuesday, May 17, 2011 at 01:36 AM
This is the ideal post for someone who desires to be familiar with this subject. You certainly place a new turn on a topic that’s been on paper about for years. Fabulous material, your post is absolutely impact a read if somebody comes across it. I didn’t grasp that this subject was so vital. You undeniably place it in perception for me.
Posted by: men perfume | Thursday, May 19, 2011 at 02:00 PM
nice ! thanks for sharing.
Posted by: жд перевозка | Friday, May 20, 2011 at 05:11 AM
Thanks for the wonderful post lot of nice information to all readers.
Posted by: charge offs | Monday, May 23, 2011 at 01:40 AM
the best post ever http://www.3d-webcam.info
Posted by: paolo webcam | Monday, May 23, 2011 at 10:13 AM
Just wanted to mention keep up the excellent work!
Posted by: lease audits | Monday, May 30, 2011 at 09:17 AM