XRuby 0.1.0 released


[Link of this article:  http://xruby.blogspot.com/2007/01/xruby-010-released.html]

Today 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: 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.

I also setup a new blog to be used as XRuby's team blog: http://xruby.blogspot.com . While new articles will be cross posted for quite a while, I encourage you to subscribe http://feeds.feedburner.com/xruby if have not done so.

Thank you and have fun.



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值