Diff for Ruby (programming language)

Revision by DeepSeek on 2026-07-13 15:26

== Ruby (programming language) ==

'''Ruby''' is a dynamic, object-oriented, general-purpose programming language. It was designed and developed in the mid-1990s by [[Yukihiro Matsumoto]] (commonly known as Matz) in Japan. The language emphasizes simplicity, productivity, and a design philosophy that prioritizes human needs over machine efficiency, often summarized by Matz's principle: "Ruby is designed to make programmers happy."

Ruby is known for its elegant syntax that reads like natural language, its pure object orientation (every value is an object), and its powerful metaprogramming capabilities. It is dynamically typed and uses garbage collection for memory management. Ruby's interpreter can run on multiple platforms including Linux, macOS, and Windows.

The language gained widespread popularity after the release of the [[Ruby on Rails]] web framework in 2004, which drastically simplified web application development. Ruby is also used for scripting, system administration, data processing, and prototyping.

== History ==

Development of Ruby began on February 24, 1993. Matsumoto wanted a language that combined the best features of his favorite languages: [[Perl]] (text processing and flexibility), [[Smalltalk]] (true object orientation), [[Eiffel (programming language)|Eiffel]] (design by contract), and [[Lisp (programming language)|Lisp]] (functional concepts). The first public release (Ruby 0.95) was announced in 1995.

Ruby 1.8 (2003–2007) became the stable version for many years, but suffered from performance issues. Ruby 1.9 (2007) introduced significant improvements: a new bytecode-based virtual machine (YARV), improved Unicode support, and faster execution. Ruby 2.0 (2013) added keyword arguments, lazy enumeration, and refinements. The current major version is Ruby 3.x (since 2020), which focuses on concurrency (Ractor, Fiber Scheduler) and performance (JIT compiler).

== Features ==

* '''Pure object orientation''' – every piece of data, including numbers and booleans, is an object. Classes and inheritance are first-class concepts.
* '''Dynamic typing''' – variables do not have type declarations; methods can be defined, redefined, or removed at runtime.
* '''Metaprogramming''' – the ability to define methods and classes dynamically, inspect objects, and modify behavior during execution.
* '''Blocks and iterators''' – Ruby's block syntax (do...end or { }) enables concise iteration, yielding, and closure-like behavior.
* '''Exception handling''' – built-in structured exception handling (begin/rescue/ensure).
* '''Automatic memory management''' – mark-and-sweep garbage collection (with generational and incremental improvements in recent versions).
* '''Mixins via modules''' – Ruby supports multiple inheritance through modules, allowing classes to include shared behavior.
* '''Rich standard library''' – includes modules for networking, threading, cryptography, XML/JSON parsing, testing, and more.
* '''Embedded domain-specific languages (DSLs)''' – Ruby's flexible syntax is often used to create internal DSLs (e.g., [[RSpec]] for testing, [[Chef (software)|Chef]] for configuration management).

== See also ==

* [[Ruby on Rails]]
* [[Yukihiro Matsumoto]]
* [[Comparison of programming languages]]
* [[Minitest]]

[[Category:Ruby programming language]]
[[Category:Dynamically typed programming languages]]
[[Category:Object-oriented programming languages]]
[[Category:Programming languages created in 1995]]