Open-Source Wikis

/

Ruby

/

Ruby

ruby/ruby

Ruby

Ruby is an interpreted, dynamically typed, object-oriented programming language created by Yukihiro "Matz" Matsumoto. This repository (ruby/ruby) is the canonical implementation, sometimes called CRuby or MRI (Matz's Ruby Interpreter). It provides the ruby, irb, gem, bundler, and related executables that ship with every official Ruby release.

The codebase contains the C interpreter, the YJIT and ZJIT just-in-time compilers (Rust), the Prism and parse.y parsers, the standard library, and the build system that ties them together. The development branch in this checkout targets Ruby 4.1.0 (include/ruby/version.h).

What lives here

  • A bytecode-based virtual machine written in C (vm.c, vm_eval.c, vm_insnhelper.c, compile.c).
  • Two parsers: a long-standing Bison/Lrama grammar (parse.y) and the newer Prism parser (prism/).
  • Two JITs: YJIT, a method-based basic-block-versioning JIT (yjit/, yjit.c), and ZJIT, an ahead-of-time-leaning IR-driven JIT (zjit/, zjit.c). Both are written in Rust.
  • A pluggable garbage collector with a default mark-sweep-compact implementation (gc.c, gc/default/) and an MMTk-backed binding (gc/mmtk/).
  • Concurrency primitives: native threads (thread_pthread.c, thread_win32.c), fibers backed by hand-written coroutine assembly (cont.c, coroutine/), and Ractors for actor-style parallelism (ractor.c).
  • Core class implementations: String (string.c), Array (array.c), Hash (hash.c), IO (io.c, io_buffer.c), Regexp (the bundled Onigmo engine in regcomp.c/regexec.c), and many more.
  • A standard library written in Ruby (lib/) and a set of bundled C extensions (ext/).
  • Test infrastructure: bootstraptest/ (smoke tests), test/ (test-unit suite), spec/ (the ruby/spec submodule for behavior specifications), and benchmark/.

Project size at a glance

  • ~493 C files, ~455 C headers, ~7,500 Ruby files, ~150 Rust source files
  • Around 320,000 lines of C code in the top-level interpreter alone
  • ~98,500 commits, with ~13,800 commits in the last 12 months

See by-the-numbers.md for the full breakdown.

Authoring history

Ruby was first publicly released by Matz in December 1995. This repository's git history starts in January 1998 (imported from CVS) and contains commits from matz, nobu (Nobuyoshi Nakada), akr (Akira Tanaka), naruse (Naruse Yui), ko1 (Koichi Sasada), and hundreds of other contributors. See lore.md for the timeline of major eras.

Where to ask questions

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Ruby – Ruby wiki | Factory