1. Computing
Michael Morin

A Quick Peek at Ruby: Is Ruby a Dynamic Language?

By September 8, 2008

Follow me on:

Today's quick peek at Ruby deals with the question: Is Ruby a dynamic language?

The quick answer to the question is "yes." However, it's important to note that the term "dynamic" can refer to a few things.

  • Ruby has dynamic method calls. In compiled languages, method calls are resolved at compile-time. There is no opportunity for a compiled language to implement runtime methods. In Ruby, method calls are not resolved until the call actually takes place. This allows object and classes to take on new methods, remove methods and emulate virtual methods using method_missing.

  • Ruby is reflective. A Ruby program can peer inside itself. It can see its own classes, which methods these classes have and even iterate over the "object space" and examine all of the objects that are instantiated. Most compiled languages cannot do this, nor can many scripting languages.

  • Ruby is "agile." Agile is another term like dynamic, there is no definition set in stone. Ruby has features that make it dynamic, it also has features that make it agile. Agile programming is the ability to make things like Domain-Specific Languages, change objects at runtime, and integrate your code with the base Ruby code.

No comments yet. Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.