Skip to content

Instantly share code, notes, and snippets.

@krainboltgreene
Created May 5, 2011 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krainboltgreene/958208 to your computer and use it in GitHub Desktop.
Save krainboltgreene/958208 to your computer and use it in GitHub Desktop.

Rubinius: Ruby Harder

Rubinius is an implementation of the Ruby programming language, in Ruby!

Rubinius includes in it's core:

  • A bytecode virtual machine
  • A parser
  • A bytecode compiler
  • A garbage collector
  • A JIT native machine code compiler

More importantly Rubinius is built in Ruby so it has the Ruby Core with standard libraries. This allows your average Ruby developer to understand exactly what goes on inside as well as easier committing to the project. Rubinius currently is compatible with Ruby 1.8.7, MRI*.

* Support for Ruby 1.9.2 is coming soon.

Installing

Rubinius runs on Mac OS X and many Unix or Linux operating systems*. If you have rvm setup you should skip ahead.

For more information about building and running Rubinius, run rake docs and go here.

* Support for Microsoft Windows is coming soon.

Requirements

The requirements for installing Rubinius are a working installation of:

  1. Ruby 1.8.7, MRI. Verify with: ruby -v
  2. Rake. Verify with rake -V
  3. Git. Verify with git --version

Installing From Source

To install Rubinius from source use the following steps:

  1. In your Terminal type: git clone git://github.com/evanphx/rubinius.git
  2. Then type: cd rubinius
  3. And: ./configure --prefix=/install/dir, where the path /install/dir should be where you want it to be installed at.
  4. Finally finish with: rake install

Once this finishes follow the given directions to add the bin directory to your PATH.

Rubinius comes with Ruby Gems built-in, but installing a gem is not too different:

rbx gem install gem_name

You can access the built-in documentation by running rbx docs.

Rubinius with RVM

The Ruby Version Manager provides a much easier rbx setup and installation process. To learn more about rvm simply visit the website.

In order to view the dependency list to preinstall for rbx type rvm notes.

Assuming all Rubinius dependencies have been preinstalled on the system, you may now install Rubinius either latest or head as follows:

rvm install rbx         # Installs latest release (defaulted to install head)

or

rvm install rbx-head    # Installs Rubinius master branch from github

Once installed, type rvm use rbx into the current shell session. Making Rubinius the default in new shells is as easy as: rvm use rbx --default.

Versions

v1.2.3

v1.2

v1.1

Rubinius has been under development as a public open-source project since November 2006. Rubinius development is sponsored by Engine Yard, Inc. and assisted by the generous work of over 100 contributors.

At version 1.1 Rubinius is significantly feature-complete. You can expect to have your Ruby code will run correctly. Additionally, many MRI C extensions are expected to work assuming it doesn't depend on MRI specific object and/or interpreter internals.

The Rubinius JIT performance is quite good, sometimes faster than MRI and sometimes slower. Rubinius generally executes Ruby code very fast compared to MRI. Since the majority of the Ruby Core is implemented in Ruby, rather than C as in MRI, code that depends heavily on Array, Hash, String, etc. may run slower in Rubinius. As the JIT improves so does overall performance of your code under Rubinius.

Goals

  • Thread safety. Rubinius intends to be thread-safe so you could embed more than one interpreter in a single application.

  • Clean. Readable Ruby code that is easy for users to understand and extend.

  • Reliable. Rock-solid code, with the help of Valgrind to verify correctness.

  • Modern. Bringing modern research in virtual machines, garbage collectors, and compilers to the Ruby programming language.

Tickets

Please file issues for bugs or problems that you encounter at the issue tracker. The issue tracker is: http://github.com/evanphx/rubinius/issues.

Contributing

The Rubinius team welcomes contributions. Run rake docs and see the contributing page.

License

Rubinius uses the BSD license. See LICENSE for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment