Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ruby (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Features == * Thoroughly [[object-oriented]] with [[Inheritance (object-oriented programming)|inheritance]], [[mixin]]s and [[metaclass]]es<ref name="stewart" /> * [[Dynamic typing]] and [[duck typing]] * Everything is an [[Expression (programming)|expression]] (even [[Statement (programming)|statements]]) and everything is executed [[Imperative programming|imperatively]] (even [[Declaration (computer science)|declarations]]) * Succinct and flexible syntax<ref name="venners-productivity" /> that minimizes [[syntactic noise]] and serves as a foundation for [[domain-specific languages]]<ref name="fowler-dsl" /> * Dynamic [[Reflective programming|reflection]] and [[Dynamic programming language#Object runtime alteration|alteration]] of objects to facilitate [[metaprogramming]]<ref name="codeproject-dynamic" /> * [[Closure (computer science)|Lexical closures]], [[iterator]]s and [[Generator (computer science)|generators]], with a [[Ruby syntax#Blocks and iterators|block syntax]]<ref name="venners-closures" /> * Literal notation for [[Dynamic array|arrays]], [[Associative array|hashes]], [[regular expression]]s and [[Symbol (Lisp)|symbols]] * Embedding code in strings ([[Variable interpolation|interpolation]]) * [[Default argument]]s * Four levels of variable scope ([[Global variable|global]], [[Class variable|class]], [[Instance variable|instance]], and [[Local variable|local]]) denoted by [[Sigil (computer programming)|sigils]] or the lack thereof * [[Garbage collection (computer science)|Garbage collection]] * [[First-class continuation]]s * Strict Boolean [[Implicit type conversion|coercion]] rules (everything is ''true'' except <code>false</code> and <code>[[Null pointer|nil]]</code>) * [[Exception handling]] * [[Operator overloading]]<ref name="Methods"/> * Built-in support for [[rational number]]s, [[complex number]]s and [[arbitrary-precision arithmetic]] * Custom dispatch behavior (through <code>method_missing</code> and <code>const_missing</code>) * Native [[Thread (computer science)|threads]] and cooperative [[Fiber (computer science)|fibers]] (fibers are a 1.9/[[YARV]] feature) * Support for [[Unicode]] and multiple [[character encoding]]s. * Native [[Plug-in (computing)|plug-in]] API in [[C (programming language)|C]] * Interactive Ruby Shell, an interactive command-line interpreter that can be used to test code quickly ([[Read–eval–print loop|REPL]]) * Centralized package management through [[RubyGems]] * Implemented on all major platforms * Large standard library, including modules for [[YAML]], [[JSON]], [[XML]], [[Common Gateway Interface|CGI]], [[OpenSSL]], [[HTTP]], [[FTP]], [[RSS]], [[curses (programming library)|curses]], [[zlib]] and [[Tk (software)|Tk]]<ref name="stdlib-master" /> * [[Just-in-time compilation]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)