Ruby (programming language): Difference between revisions

Content deleted Content added
Hirzel (talk | contribs)
No edit summary
clarify, wikify, remove non-standard terminology
Line 1:
[[de:Ruby]][[eo:Ruby Komputillingvo]][[fr:Ruby]][[nl:programmeertaal Ruby]][[ja:プログラミング言語Ruby]][[pl:Ruby (j%C4%99zyk_programowania)]]
'''Ruby''' is ana purely [[object-oriented]] interpreted [[programming language]] withoriginally cleandeveloped syntax.for It[[scripting hasprogramming itslanguage|scripting]]. rootsIt incombines [[Perl programming language|Perl]],-like [[syntax]] with [[Smalltalk programming language|Smalltalk]]-like [[semantics]], and also shares some features with [[Python programming language|Python]], [[Lisp programming language|Lisp]] and [[CLU programming language|CLU]], with Perl being the most important one.
 
Ruby currently has only one implementation, the Ruby [[interpreter (computer software)|interpreter]], although efforts are underway to implement a Ruby front end (called "Cardinal") for the [[Parrot virtual machine]].
 
Ruby language features:
 
* IntuitivePerl-like syntax
* Basic [[objectObject-oriented]] features:
** Special[[inheritance (object-oriented features:programming)|Inheritance]] with [[dynamic dispatch]]
** [[mixinsMixin]]s
** [[singletonSingleton methodsmethod]]s
** [[renaming]]
** [[object-specific classes]]
** [[etc.]]
* [[Operator overloading]]
* [[Exception handling]]
* [[Iterator]]s (which resemble those in [[CLU programming language|IteratorsCLU]] and [[ClosureSather (programming) language|ClosuresSather]])
* [[Closure (programming)|Closure]]s (also found in [[Smalltalk programming language|Smalltalk]] and many [[functional programming language]]s)
* [[Pearl|Perl]] [[regular expression]] support at [[syntax]] level
* Syntactic support for [[Perl]]-like [[regular expression]]s at the language level (not merely in [[library (software)|libraries]], as in Python or many other languages)
* [[computer memoryAutomatic garbage collection|Garbage collection]]
* [[DLL|Dynamic loadinglibrary]] loading/linking (depending on the architecture)
* High portability (runs on [[Unix]], [[Microsoft Windows]], [[DOS]], [[Mac OS X]], [[OS/2]], [[Amiga]], and many more)
* Distributed under an[[Free software|Free]] and [[open source]] licencelicences ([[GNU General Public LicenceLicense|GPL]] or [[Artistic Licence|ArtisticLicense]]).
 
Ruby is purely object-oriented: every bit of data is an object, even basicincluding types that are designated "primitive" in impure languages. Every function is a method. This is similar to Smalltalk but unlike [[Java programming language|Java]] and Python. WithEvery anamed fewvalue exceptions, every(variable name (variable) in a Ruby program holdsdesignates a reference to an object, not the object itself.
 
The language was created by [[Yukihiro Matsumoto]] (a.k.a. "Matz") on February 24, [[1993]]. The current stable version is 1.6.8. Note that the name is not an
current stable version is 1.6.8. Note that the name is not an
[[acronym]]--it is actually a [[pun]] on [[Perl]]. According to the author, he
designed Ruby to follow the ''[[principle of least surprise]]'' (POLS), meaning that the
language should be free from the traps and inconsistencies that plague other
languages.
 
From the Ruby [[FAQ]]: ''If you like Perl, you will like Ruby and be right at home with its syntax. If you like Smalltalk, you will like Ruby and be right at home with its semantics. If you like Python, you may or may not be put off by the huge difference in design philosophy between Python and Ruby/Perl.''
 
Here is a sample of Ruby code:
Line 53 ⟶ 52:
* [http://www.rubycentral.com/faq/rubyfaqall.html Ruby FAQ]
* [http://www.rubygarden.org/ Ruby Garden]
* [http://savannah.gnu.org/projects/cardinal/ Cardinal (Ruby front end for Parrot)]]