Ruby is the name of the latest programming language that's catching our attention. (Truthfully, I don't do all that much programming anymore, except for the occasional LISP programming -- a lanaguage that's as old as I am.) There's hasn't been this much excitment since Phillip shipped TurboPascal 1.0 nearly 25 years ago.
Developed over the last 12 years by Japanese programmer Yukihiro Matsumoto, Ruby is free and different. Rather than solve complex programming problems (as do C, C++, and .Net), Ruby seems more like AutoLISP -- designed to dash some lines of code to sove an immediate problem.
SketchUp is the first CAD program to adopt Ruby. Who will be next?
To learn Ruby, read why’s (poignant) guide to ruby", an online ebook by why the lucky stiff.
I wanted to give CAD users a better understanding of Ruby from a programmer than just the above, "Rather than solve complex programming problems...Ruby seems more like AutoLISP -- designed to dash some lines of code to solve an immediate problem.".
As a note about who I am: I am a veteran software engineer with 10 years professional experience in C, C++, Java, Python and Ruby. In fact my blog url link below is about my Ruby and Python adventures.
While Ruby allows coders to get scripts working quickly, Ruby is still very capable of solving complex programming problems just like C, C++ or .NET languages such as C#. In fact, I would argue that if speed wasn't too important (although Ruby isn't as slow in my experience as, say, Java or C#), I would suggest CAD users utilize Ruby over C, C++ or even C# because of the following reasons:
All-in-all Ruby (as is Python for the most part) is an ideal choice for an API where the people using the libraries aren't necessarily programmers by day. I would even urge vendor developers to expose Ruby or Python for use full developer-oriented APIs as well.
Also for those that do not want to use C++ for AutoCAD work, there is a tool called Swig where you can roughly translate a C++ API into Ruby or Python bindings for your to use instead of the C++ library. You can find Swig at:
http://www.swig.org/
This could save you tons of time.
Posted by: Susan Potter | Apr 26, 2006 at 07:44 AM
For the programmers out there using Ruby to program against CAD or GIS applications:
I need to make a quick qualification to my posting above, which is that while Swig will provide you with the ability to write Ruby code, the API you can use will be in the style of a C++ API. This is simply because Swig unintelligently translates what is in C++ directly to a Ruby binding. So some of the benefits of using a Ruby designed API will obviously not be there for this reason.
Posted by: Susan Potter | Apr 26, 2006 at 07:54 AM
Susan
your article was very informative.
thanks for such a good article
prakash
Posted by: prakash bajaj | May 12, 2006 at 07:25 PM