# \[ANN\]XRuby compiler 0.1.0 released

**URL:** <https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919>\
**Category:** Ruby\
**Created:** [January 30, 2007, 7:27pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919 "2007-01-30T19:27:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 30, 2007, 7:27pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/1 "2007-01-30T19:27:17Z")

</div>

I am glad to announce the release XRuby 0.1.0 , a ruby compiler which  
compiles ruby script (.rb) to java bytecode (.class). You can download  
it from here: [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/xruby/downloads/list)

XRuby 0.1.0 is the first release of XRuby. It is able to pass all tests  
in samples/test.rb - a decent test suite that comes with ruby  
installation.

As a compiler, XRuby compiles ruby source code so that your program can  
run on top of Java Virtual Machine. For example, if you have a ruby  
script like this:

class MyClass  
def say\_hello\_three\_times  
3.times {puts “hello”}  
end  
end

MyClass.new.say\_hello\_three\_times

You can compile it with XRuby (assuming its name is test.rb):

> java -jar xruby-0.1.0.jar -c test.rb

The compiler will generate a test.jar. It can be launched as a regular  
java application, with the following command:

> java -jar test.jar  
> hello  
> hello  
> hello

For your convenience, you can also run the script directly (without -c  
option), just like the classic ruby interpreter. Under the hood it  
compiles the script then run the bytecode:

> java -jar xruby-0.1.0.jar test.rb  
> hello  
> hello  
> hello

While little known, this project has been under active development for  
one year and eight months. I started the project around mid 2005, and it  
took me about eight months to write a ruby parser with Antlr, and then  
one year to implement the compiler and runtime. Some people joined me  
during the second half of 2006 and made great contribution. It is just  
the beginning of an exciting journey.

We still have a long way to go before claiming XRuby is a very competent  
alternative implementation of ruby. And comparing with our peers we lag  
behind in implementing ruby’s built-in libraries and do not have  
Ruby-Java bridge. Our next focus is to improve this situation and make  
major ruby libraries and framework work under XRuby. And we hope by end  
of 2007 you can use XRuby to compile your Ruby On Rails application to a  
.war file and run it directly on a J2EE server.

We appreciate your feedback. Our development maillist is at:  
[http://groups.google.com/group/xruby-devel](http://groups.google.com/group/xruby-devel). The team blog is at  
[http://xruby.blogspot.com](http://xruby.blogspot.com)

Thank you and have fun.

---

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 30, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/2 "2007-01-30T19:38:39Z")

</div>

On 1/30/07, Xueyong Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> While little known, this project has been under active development for  
> one year and eight months. I started the project around mid 2005, …

I am impressed that you have the compiler working, but I guess the big  
question is why you started this project instead of joining and  
contributing to the JRuby project. Can you address that?

---

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 30, 2007, 7:40pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/3 "2007-01-30T19:40:40Z")

</div>

On 1/30/07, Lyle J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am impressed that you have the compiler working, but I guess the big  
> question is why you started this project instead of joining and  
> contributing to the JRuby project. Can you address that?

Diversity is good?

---

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 30, 2007, 8:39pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/4 "2007-01-30T20:39:48Z")

</div>

Lyle J. wrote:

> On 1/30/07, Xueyong Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > While little known, this project has been under active development for  
> > one year and eight months. I started the project around mid 2005, …
> 
> I am impressed that you have the compiler working, but I guess the big  
> question is why you started this project instead of joining and  
> contributing to the JRuby project. Can you address that?

When I started the project at that time, there is no ruby compiler  
exists ([Ruby.NET](http://Ruby.NET) become the first in early 2006), and JRuby was not is  
as exciting as it is now:)

---

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 31, 2007, 2:09pm UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/5 "2007-01-31T14:09:15Z")

</div>

XRuby is written in Java.

2007/1/31, Robert F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Xue\_Yong\_Z](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/8e8cbc/32.png) [@Xue\_Yong\_Z](https://www.ruby-forum.com/u/Xue_Yong_Z)\
**Post date:** [January 31, 2007, 11:58am UTC](https://www.ruby-forum.com/t/ann-xruby-compiler-0-1-0-released/83919/6 "2007-01-31T11:58:53Z")

</div>

Is it written in Ruby? I guess not since you use ANTLR?

Regards,

Robert F.
