Ruby 的 Java 实现,JRuby 9.0.0.0-pre1 发布

jopen 9年前

JRuby是面向Ruby、基于Java虚拟机(JVM)的一种解释程序,它结合了Ruby语言的简易性和功能强大的JVM的执行机制,包括与Java库 全面集成。Rails彻底加快及简化了Web应用的开发,不过它让人觉得不够成熟,特别是在高端企业级功能方面。另一方面,Java平台及其虚拟机、库和 应用服务器的速度、稳定性和功能方面却一直在提升,现在已被公认为是开发高端服务器应用的领先平台。不过如果Java平台不与Ruby等新兴语言联系在一 起,就有可能落后于流行趋势。

JRuby 9.0.0.0-pre1 发布,主要改进内容:

  • 兼容 Ruby 2.2

  • 基于传统编译器设计的全新优化的运行时

  • 新的 POSIX 友好的 IO 和 进程处理

  • 来自 MRI 的完全可移植的编码和转码

目前这还是预览版,详细介绍:

JRuby 9.0.0.0-pre1 Released

Tuesday, January 20 2015

The JRuby community is pleased to announce the release of JRuby 9.0.0.0-pre1

JRuby 9000 is the new version of JRuby, representing years of effort and large-scale reboots of several JRuby subsystems.

Major features of JRuby 9000:

  • Ruby 2.2 compatibility, minus features listed below
  • A new optimizing runtime based on a traditional compiler design
  • New POSIX-friendly IO and Process
  • Fully ported encoding/transcoding logic from MRI

This is a preview release, and we know there’s work to do. We are releasing now to get user feedback on Ruby 2.2 functionality and overall stability.

We hope all Ruby users will try out this release and report issues on our issue tracker at http://bugs.jruby.org. We also encourage users to join our IRC channel (#jruby on Freenode) and mailing lists. You may also follow @jruby on 推ter for updates.

Ruby 2.2 features yet to be implemented:

  • Refinements #1062
  • Enumerator#feed
  • Kernel#spawn close-on-exec support
  • ObjectSpace::WeakMap#each and Enumerable inclusion
  • ObjectSpace::count_objects
  • Thread#handle_interrupt is not yet fully functional
  • POSIX-friendly IO, TTY, and Process logic is not used on Windows

We also have additional work to do on the new runtime:

  • Startup time is a bit slower.
  • Memory usage is higher.
  • Straight-line performance is a little bit slower.

The new runtime gathers more information about Ruby code and performs more analysis and optimization than our old runtime. There’s great potential here to bring Ruby performance to native Java or C, but we are just starting the optimization phase of that work. We will do our best to get startup time, memory use, and performance on par with 1.7.x (or better) before the final release of JRuby 9000.

Truffle

JRuby 9000 includes an in-development version of support for the Truffle language implementation framework and Graal VM from Oracle Labs. In future releases, Truffle will provide an extremely high performance and compatible backend for JRuby. The Truffle backend supports all Ruby language features, but so far only some of the core and standard libraries. It has no support for RubyGems or Rails, does not work on Windows, and is not ready to be tested with applications at this stage. More information on Truffle and Graal can be found in the JRuby Wiki.