Katana VentraIP

Ruby (programming language)

Ruby is an interpreted, high-level, general-purpose programming language. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

Not to be confused with Ruby on Rails.

Paradigm

Yukihiro Matsumoto, et al.

1995 (1995)

3.3.1 Edit this on Wikidata[1] / 23 April 2024 (23 April 2024)

Lexical, sometimes dynamic

C

Ruby is dynamically typed and uses garbage collection and just-in-time compilation. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming. According to the creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, BASIC, Java, and Lisp.[10][3]

Ruby 1.0: December 25, 1996

[13]

Ruby 1.2: December 1998

Ruby 1.4: August 1999

Ruby 1.6: September 2000

Thoroughly with inheritance, mixins and metaclasses[51]

object-oriented

and duck typing

Dynamic typing

Everything is an (even statements) and everything is executed imperatively (even declarations)

expression

Succinct and flexible syntax that minimizes syntactic noise and serves as a foundation for domain-specific languages[53]

[52]

Dynamic and alteration of objects to facilitate metaprogramming[54]

reflection

iterators and generators, with a block syntax[55]

Lexical closures

Literal notation for , hashes, regular expressions and symbols

arrays

Embedding code in strings ()

interpolation

Default arguments

Four levels of variable scope (, class, instance, and local) denoted by sigils or the lack thereof

global

Garbage collection

First-class continuations

Strict boolean rules (everything is true except false and nil)

coercion

Exception handling

[56]

Operator overloading

Built-in support for , complex numbers and arbitrary-precision arithmetic

rational numbers

Custom dispatch behavior (through method_missing and const_missing)

Native and cooperative fibers (fibers are a 1.9/YARV feature)

threads

Support for and multiple character encodings.

Unicode

Native API in C

plug-in

Interactive Ruby Shell, an interactive command-line interpreter that can be used to test code quickly ()

REPL

Centralized package management through

RubyGems

Implemented on all major platforms

Large standard library, including modules for , JSON, XML, CGI, OpenSSL, HTTP, FTP, RSS, curses, zlib and Tk[57]

YAML

Just-in-time compilation

a mixed Java and Ruby implementation that runs on the Java virtual machine. JRuby currently targets Ruby 3.1.x.

JRuby

a Java implementation using the Truffle language implementation framework with GraalVM

TruffleRuby

a C++ bytecode virtual machine that uses LLVM to compile to machine code at runtime. The bytecode compiler and most core classes are written in pure Ruby. Rubinius currently targets Ruby 2.3.1.

Rubinius

Repositories and libraries[edit]

RubyGems is Ruby's package manager. A Ruby package is called a "gem" and can be installed via the command line. Most gems are libraries, though a few exist that are applications, such as IDEs.[64] There are over 100,000 Ruby gems hosted on RubyGems.org.[65]


Many new and existing Ruby libraries are hosted on GitHub, a service that offers version control repository hosting for Git.


The Ruby Application Archive, which hosted applications, documentation, and libraries for Ruby programming, was maintained until 2013, when its function was transferred to RubyGems.[66]

Comparison of programming languages

Metasploit Project

Why's (poignant) Guide to Ruby

Crystal (programming language)

Ruby on Rails

Official website

Ruby documentation

at Curlie

Ruby