Ruby (programming language): Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Pat Palmer
imported>Pat Palmer
Line 24: Line 24:
But simple as it initially may seem, Ruby is described as having hidden depths.  Peter Cooper, author of a 2007 book about Ruby, introduces the language by stating, "Ruby has more in common with more esoteric languages such as Lisp and Smalltalk than with better known languages such as PHP and C++"<ref name="petercooper">
But simple as it initially may seem, Ruby is described as having hidden depths.  Peter Cooper, author of a 2007 book about Ruby, introduces the language by stating, "Ruby has more in common with more esoteric languages such as Lisp and Smalltalk than with better known languages such as PHP and C++"<ref name="petercooper">
{{cite web|
{{cite web|
url=http://www.tiobe.com/tpci.htm|
url=http://books.google.com/books?id=RBUJZ-ma7voC&dq=peter+cooper+beginning+ruby&printsec=frontcover&source=web&ots=BCcI6QKZWu&sig=GzgPd-S5Nrr3ZXO5WNfNxdwLeHY#PPP1,M1|
title="TIOBE Programming Community Index"|
title="Beginning Ruby: From Novice to Professional" (paperback book)|
publisher=TIOBE Software|
publisher=Apress|
year=2007|
year=2007|
accessdate=2007-10-10}}
accessdate=2007-10-10}}
Line 37: Line 37:
# extensive libraries for networking and web services
# extensive libraries for networking and web services
# powerful support for making calls out to the native [[operating system]] if needful
# powerful support for making calls out to the native [[operating system]] if needful


==References==
==References==

Revision as of 11:09, 11 October 2007

Main Article
Talk Template:Default button 3
 
Template:Cell style

Ruby is a general-purpose, open-source computer programming language first released to the public in 1995 by Yukihiro Matsumoto, a Japanese computer professional working in an open-source software company. Named for the gemstone, Ruby soon obtained a dedicated mass of developers in the international open-source community. Ruby's place in the U.S. computer industry was boosted by the independent release, in 2004, of Rails, a Ruby-based, open-source web application framework created by David Heinemeier Hansson, a Danish software engineer working in the United States. By 2007, Ruby had risen to be tenth in usage among all programming languages, and its use is still growing[1]. This article is an overview of the features that Ruby provides, including a discussion of factors that are perceived as strengths or weaknesses of the language.

Ruby Implementations

Like many programming languages created since 1990 or so, Ruby is fully object-oriented and requires the installation of a runtime environment, or virtual machine before Ruby programs can be developed or run. Since the introduction of Ruby in 1995, Ruby has been tightly managed as open-source software by Ruby's creator, Yukihiro Matsumoto (commonly called Matz). As of October 2007, ever-improving versions of this original Ruby implementation have been released on several different operating systems. Virtual machines have also been developed by other groups, including JRuby (an attempt to port Ruby to the Java platform), and Rubinius (an interpreter modeled after self-hosting Smalltalk virtual machines).

No formal specification

Matz' runtime is interpreted, rather than compiled, and as of 2007, still lacks a formal written specification. So although Ruby can potentially can be used to create platform-independent programs, it is not currently guaranteed to be identical across platforms, and newer versions are not always upwardly compatible with older versions. Furthermore, a burgeoning number of books, articles and other documentation are not always in complete agreement about the syntax, semantics, and conventions of the language.

Things people like about Ruby

Despite performance concerns, enthusiasts of Ruby wax eloquent in praising the language, including countless subjections statements like "it's fun". Something of Ruby's appeal may be seen in the brevity of this Hello World program:

puts "Hello, world"

But simple as it initially may seem, Ruby is described as having hidden depths. Peter Cooper, author of a 2007 book about Ruby, introduces the language by stating, "Ruby has more in common with more esoteric languages such as Lisp and Smalltalk than with better known languages such as PHP and C++"[2]. Cooper's book, and numerous other sources, claim that the following characteristics of Ruby allow them to develop programs more quickly:

  1. closures
  2. a relatively permissive syntax, said to be "more like the way people think"
  3. loose typing
  4. good string handling and regular expressions
  5. extensive libraries for networking and web services
  6. powerful support for making calls out to the native operating system if needful

References