InfoQ

News

Getting started with Rubinius development

Posted by Werner Schuster on Sep 28, 2007

Community
Ruby
Topics
Programming ,
Technology ,
Dynamic Languages
Tags
Rubinius ,
Trends
Rubinius has been getting a lot of support recently, and some in the group of Ruby VM implementers believe it to have a grand future

One of the reasons is the modular design and how Rubinius exposes its internals. Rubinius is well suited for new developers trying to help out, as it takes introspection all the way. Ruby already makes it trivial to inspect a Ruby class with methods such as obj.methods(shows the methods of obj). Rubinius goes one step further by giving access to the Abstract Syntax Tree (AST) of the Ruby code, a data structure representing the code. Rubinius uses ParseTree, a representation using symbols and nested lists. For example, this code:
puts "Hello, Rubinius. You rock my world!"  
is represented like this:
 [:fcall, :puts, [:array, [:str, "Hello, Rubinius. You rock my world!", 0]]] 
If this looks familiar to LISP or Scheme code, that's no accident. The representation is called s-expressions (symbolic expressions), which is also how these languages represent their code.

The benefit of representing an AST this way is that it's easier to read than a data structure made up of linked objects in memory. This becomes even more evident for creating ASTs, for instance for test cases using ASTs.

Reading up on ParseTree can be helpful for working on Rubinius. A couple of tools are already based on ParseTree. Ruby2Ruby takes an ParseTree AST and turns it into Ruby source code - useful for looking at runtime generated Ruby code. Flog is a new tool that analyzes code an generate a quality rating of it. Other tools based on ParseTree, such as Ruby2C or Heckle can provide some insights as well. Another use of ParseTree can be seen in the Ambition, a way of using ParseTree representation of Ruby code to create database and other queries.

Brian Ford discusses Rubinius internals, like getting ParseTree output. Among the topics are tools for looking at ParseTree ASTs for Rubinius code and the underlying bytecode for the code. This allows new Rubinius developers to quickly figure out is going on under the covers or what Ruby source is turned into for execution. More and updated details and command line options can be found in the Rubinius Wiki on Command line options.

For everyone now interested in looking at Rubinius code, Sam Aaron put together a list of links and instructions to get started on Mac OS X. One aspect, that might be problematic for new developers, is the source code management (SCM) system Rubinius uses. After using Subversion for some time, the team recently switched to Git. Git is a Distributed SCM, originally written by Linus Torvalds for Linux Kernel development, but an increasing number of projects are using it too. Distributed SCMs are increasingly popular, as they faciliate branching which allows for easy experimentation

To get started, see Using Git page at the Rubinius website. Once Rubinius is checked out, it's easy to keep up with the development using Git, as Sam Aaron points out:
Head to your Rubinius directory and utter forth the following:
git pull ; rake build
Git by Guy Coleman Posted Sep 28, 2007 3:25 AM
Re: Git by Werner Schuster Posted Sep 28, 2007 5:38 AM
Re: Git by Guy Coleman Posted Sep 28, 2007 9:40 AM
an or and by Yu Su Posted Sep 28, 2007 10:09 PM
  1. Back to top

    Git

    Sep 28, 2007 3:25 AM by Guy Coleman

    Unfortunately using Git means it's much harder to develop on Windows.

    The Linux kernel developers may all be using a certain free UNIX clone, but I bet there are one or two Ruby developers on Windows..

  2. Back to top

    Re: Git

    Sep 28, 2007 5:38 AM by Werner Schuster

    Git seems to work on Windows:
    git.or.cz/gitwiki/WindowsInstall
    No idea how well it works though.

    There seems to be a Java Git client and an Eclipse plugin
    git.or.cz/gitwiki/EclipsePlugin

    It's somewhat surprising (to me at least) that many projects now seem to choose Git, especially since it was designed for Linux Kernel work on Linux. I'd have thought that Mercurial www.selenic.com/mercurial/wiki/
    would be the choice for non-Linux Kernel projects. It's used by many projects
    www.selenic.com/mercurial/wiki/index.cgi/Projec...
    and (from what I know) was one of the two final candidates as DSCM for Rubinius.

  3. Back to top

    Re: Git

    Sep 28, 2007 9:40 AM by Guy Coleman

    It works, for some value of "works" :-)

  4. Back to top

    an or and

    Sep 28, 2007 10:09 PM by Yu Su

    Flog is a new tool that analyzes code an generate a quality rating of it OR
    Flog is a new tool that analyzes code and generate a quality rating of it

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.