Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

Blue Ruby - New Exploratory Research


Dec 18, 2010

Wow, this took a year! But now, Blue Ruby is eventually available on Code Exchange

Nov 24, 2009

Blue Ruby will be available for download on SDN Code Exchange

Jul 20, 2009

New Article on Using Blue Ruby for Test Driven Development in ABAP

Jun 17, 2009

New Blog on BlueFS, the file system behind Blue Ruby

May 15, 2009

Blue Ruby is now 75% Ruby compatible (according to ruby_spec)

May 15, 2009

Blue Ruby trial program started - if you want to participate, send an email to

May 14, 2009

New Blog How to build a SE16 Emulator in Blue Ruby

May 06, 2009

New Blog Tasting the mix of Blue Ruby

Mar 25, 2009

New Blog New from SAP Research: Blue Ruby - a Ruby VM in ABAP

The Blue Ruby project is about creating an enterprise-ready dynamic language environment for the programming language Ruby [1] that runs inside the ABAP Virtual Machine. It combines the "best of both worlds" - lightweight, loosely-coupled, agile programming via Ruby, executed within the robust, proven SAP Web Application Server for ABAP. In many ways, Blue Ruby makes the simple things simple and the complex things possible.
Rather than just running Ruby programs isolated on the ABAP server, Blue Ruby also provides two-way integration with the surrounding ABAP environment - ABAP programs can invoke Ruby code easily and Ruby programs are able to access existing ABAP functionality. However, this integration is strictly controlled by the Blue Ruby VM, turning Blue Ruby into a sandbox inside the ABAP server.

Blue Ruby is an exploratory research project from SAP Labs Palo Alto and Shanghai.

Business Value
Simplify and reduce costs of development of composite applications that consume, adapt or extend existing components on SAP platforms by leveraging the popularity and productivity of Ruby, while retaining scalability and robustness similar to ABAP's, and providing seamless local integration with existing ABAP applications.

History has shown that there are major new programming languages every 10 years or so. The reasons for this are many, whether it be the needs of different domains, the needs of different types of programmers, or changes in programming philosophies. Recent years have seen a revival of a family of dynamic languages such as Python, Ruby, Smalltalk and others, with the Ruby language having one of the fastest growing communities - probably not completely unrelated to the success of the Rails framework.
In some ways, the emergence of dynamic languages merely represents a reawakening of the understanding of the benefits of things such as interpretation, dynamic typing / late binding, first class functions and closures, meta-programming and the like. The flexibility afforded by such features is particularly powerful in the case of Web programming where networking and heterogeneity are basic facts of life. Dynamic languages (and scripting languages - which usually are dynamic) are sometimes referred to as glue languages for their suitability to the tasks of integration and network programming. Another benefit of dynamic languages is that they aid succinctness (less code!) and understandability.
To cut a long story short: Developers seem to think that dynamic languages make them more productive.

Technical Approach
When we say "we want to run Ruby on the ABAP stack", we more specifically mean "on the ABAP call stack". Ruby programs should be able to share data and data representations with ABAP with minimal overhead while moving between the two. Ruby methods should be callable from ABAP programs and vice versa with a high frequency. To achieve this, we decided to make Ruby and ABAP execute together on the same virtual machine by extending the ABAP virtual machine.
The main building blocks of Blue Ruby are:

  • A virtual machine, which handles program loading, method invocation, control and data flow. Everything is an object in Ruby; therefore the basic operations of the virtual machine are in creating objects and sending messages to them
  • The runtime library, which enables the Ruby type system and provides the basic structure and relationships between classes, modules, methods and object instances and their lifetime
  • The built-in libraries of predefined operations on the base data types such as strings and numbers
  • A facility to add extension libraries that are wholly or partially implemented in ABAP Secured bridge packages, which allow access to the functionality of the underlying host platform in a secure way by establishing a well defined sandbox concept

Unlike Matz' Ruby Interpreter (aka MRI, the reference implementation of the Ruby language), Blue Ruby is not fully interpreted. Instead, a compiler - written in Ruby - will compile Ruby source code into a byte-code-like representation we call BRIL (Blue Ruby Intermediate Language) code. This BRIL code is interpreted and executed by the Blue Ruby VM which is essentially a stack machine. Ruby files are stored in a (virtual) file system using ABAP DDIC database tables and are automatically compiled when a file is saved.

Implementation Status
To measure our compatibility with the Ruby language, we run the rubyspec [3] test suite - a set of test cases written for the RSpec [4] library. As of May 15, 2009, we pass

  • 665 out of 743 language specifications (89.5%) - Object, Class, Module, Block, Proc, ...
  • 3031 out of 4152 core library specifications (73.0%) - String, Fixnum, Array, Hash, Regexp, ...
  • 3696 out of 4895 total specifications (75.5%)

Video Demo and Tutorials

Further Reading
[1] Ruby Language Homepage -
[2] Programming Ruby: The Pragmatic Programmer's Guide -
[3] Behaviour Driven Development (BDD) with RSpec-
[4] RubySpec: Executable Ruby Language Specification -
[5] JRuby: A Ruby implementation for Java -
[6] IronRuby: A Ruby for Microsoft .NET -
[7] Rubinius: Another popular Ruby implementation -

Feedback and Contacts
For more information and for leaving your ideas and feedback, please add a comment on this wiki page or contact Juergen Schmerder at Your comments will help us propagate this research project into an SAP product!

Test-drive environment
We are getting closer - our Blue Ruby early trial system is running and several users are playing with the system. Learn about the first experiences SDN Mentor Alvaro Tejada ('Blag') made here...

Our trial program is coming to an end. However, Blue Ruby will be hosted on SDN Code Exchange - if you want to learn more, please send an email to


  1. Guest

    I am excited and fascinated by this project. It would be awesome to use the power of Ruby within the SAP application stack. Please post more information on how we can get/use the fruits of your efforts.

  2. WOW!  Now I need to learn some Ruby to use it!