Matz (Yukihiro Matsumoto) wanted a language perfect for his needs:
Ruby 1.8 was released in 2003. This release made large amounts of changes to the agile 10-year-old language. Including:
In 2005, Ruby use took off. The reason: Ruby on Rails. This new framework changed the history of rapid web development. Ruby had been used in the past to write CGI scripts, but Ruby on Rails took this a step further. Rails has a Model-View-Controller structure that focuses on “convention over configuration”, which is great for developing web applications.
COLORS = { black: "000", red: "f00", green: "0f0", yellow: "ff0", blue: "00f", magenta: "f0f", cyan: "0ff", white: "fff" } class String COLORS.each do |color,code| define_method "in_#{color}" do "<span style=\"color: ##{code}\">#{self}</span>" end end end
"Hello, World!".in_blue => "<span style=\"color: #00f\">Hello, World!</span>"
Global Interpreter Lock (GIL) is a mechanism used in computer language interpreters to synchronize the execution of threads so that only one thread can execute at a time. An interpreter which uses GIL will always allow exactly one thread to execute at a time, even if run on a multi-core processor.
Applications running on implementations with a GIL can be designed to use separate processes to achieve full parallelism, as each process has its own interpreter and in turn has its own GIL. Otherwise, the GIL can be a significant barrier to parallelism—a price paid for having the dynamism of the language.[citation needed]
Multithreading is mainly found in multitasking operating systems. Multithreading is a widespread programming and execution model that allows multiple threads to exist within the context of a single process. These threads share the process's resources, but are able to execute independently. The threaded programming model provides developers with a useful abstraction of concurrent execution.
A fiber is a unit of execution that must be manually scheduled by the application. Fibers run in the context of the threads that schedule them. Each thread can schedule multiple fibers. In general, fibers do not provide advantages over a well-designed multithreaded application.However, using fibers can make it easier to port applications that were designed to schedule their own threads.
EventMachine is an event-driven I/O and lightweight concurrency library for Ruby. It provides event-driven I/O using the Reactor pattern, much like JBoss Netty, Apache MINA, Python's Twisted, Node.js, libevent and libev.
EventMachine is designed to simultaneously meet two key needs:
Much of the difficulty with building concurrent programs in Ruby arises because the object-oriented mechanisms for structuring code, such as classes and inheritance, are separate from the concurrency mechanisms, such as threads and locks. Celluloid combines these into a single structure, an active object running within a thread, called an "actor", or in Celluloid vernacular, a "cell".
JRuby is an implementation of the Ruby language using the JVM.
It aims to be a complete, correct and fast implementation of Ruby, at the same time as providing powerful new features such as concurrency without a global-interpreter-lock, true parallelism, and tight integration to the Java language to allow you to uses Java classes in your Ruby program and to allow JRuby to be embedded into a Java application.
Rubinius is a modern language platform that supports a number of programming languages.
Rubinius includes a bytecode virtual machine, generational garbage collector, and just-in-time (JIT) native machine code compiler. Rubinius provides concurrency support via native OS threads with no global interpreter lock.
Modern concurrency tools for Ruby. Inspired by Erlang, Clojure, Scala,Haskell, F#, C#, Java, and classic concurrency patterns.
The design goals of this gem are: