ContentsRuby Ruby on Rails and the Growth of Ruby Virtual Machines for Ruby JRuby jMaki Groovy and Grails Ruby Development Using the NetBeans IDE Develop-and-Deploy Scenarios - Deploying on Solaris OS AMP - Deploying JRuby on the GlassFish Application Server - Java DB for JRuby Applications Why Run Rails on GlassFish? Opening the JVM to Other Languages
Although Ruby is sometimes described as a scripting language, its supporters characterize it as a general-purpose computer language with broad application. Ruby is free to use, copy, modify, and distribute -- and highly portable. Although it is most often developed on GNU/Linux or Mac OS X, Ruby works on many types of UNIX, Solaris OS, Microsoft Windows 95/98/Me/NT/2000/XP, and other operating systems. Ruby has recently released version 1.9.0. Ruby's features include the following:
RubyForge is a home for open-source Ruby projects. RubyGems, now part of the standard library from Ruby version 1.9.0, is a package manager for Ruby that provides a standard format for distributing Ruby programs and libraries. In March 2008, the TIOBE index, which measures the growth of programming languages, ranked Ruby 10th in worldwide popularity, accounting for roughly 2.6% of programmers. Much of Ruby's growth is tied to the popularity of the open-source Ruby-on-Rails framework, known as Rails, which is used for database-backed web applications based on the model-view-controller (MVC) design pattern. Ruby on Rails offers skeletal code frameworks to increase speed and ease of development for database web site creation and is popular among younger developers. The speed and agility of Rails has had a significant impact on web development. Rails works with web servers like GlassFish, Apache, Mongrel, and LightTPD, and databases such as MySQL, PostgreSQL, SQLite, Oracle, SQL Server, Java DB, and DB2.
The Rails framework fits well with what publisher Tim O'Reilly calls Web 2.0, which, however defined, refers to such proliferating interactive web sites as Flickr, YouTube, Facebook, MySpace, and others that are characterized by massive information entering the site from the edge of the network. Many future Web 2.0 sites are likely to use Rails, because rapid time to market and reliable maintenance are crucial to the success of Web 2.0. Rails excels in maintainability but can be slow with web applications that require computation. Ruby's official implementation, often referred to as Matz's Ruby Interpreter or MRI, after Matsumoto, is the most widely used. It is sometimes referred to as CRuby because it is written in C. Ruby's popularity has grown beyond its native runtime to VM-based runtimes, with the creation of several other implementations. These include JRuby, a port of Ruby to the Java platform; IronRuby an implementation for Microsoft's .NET framework; Ruby.NET, a compiler that translates Ruby source code into .NET intermediate code for third-party Microsoft platforms only; and Rubinius, an interpreter modeled after self-hosting Smalltalk virtual machines. YARV, which stands for Yet Another Ruby VM, is a new bytecode interpreter being developed for Ruby, designed to reduce execution time for Ruby programs. With Ruby's 1.9.1 release, due out soon, YARV will become the official Ruby interpreter.
Originally written by Jan Arne Peterson in 2001, JRuby was further developed by Thomas Enebo and Charles Nutter. Sun Microsystems hired the two developers in September 2006 as JRuby core developers -- evidence of Sun's commitment to JRuby development and openness to the expansion of Java technology for use with other languages.
Sun's strategy is tied to the assumption that deployment will follow adoption, and it derives from the belief that businesses will not deploy important applications or solutions without support. As Sun CEO Jonathan Schwartz puts it, "Mindshare gets market share."
In February 2008, the second release candidate of JRuby 1.1, JRuby 1.1 RC 2, was released.
"There are now a vast number of Java libraries accessible to Ruby developers," he writes. "JRuby may be a solution for developers who want to scale better or differently. The sandbox security of the JVM* allows developers to build robust Internet-based applications. Giving Ruby developers access to the Java APIs and the community of 6 million developers is a big plus." JRuby's features include the following:
JRuby on Rails, which is the original Ruby-on-Rails framework running on top of the Java platform, adds to Rails the power and functionality of Java libraries and application servers. Sun is actively working to make Rails applications into Java-platform apps, in the hopes of making JRuby on Rails central to future web development.
Its supporters claim that Groovy:
Groovy co-founder James Strachan first blogged about Groovy development in August of 2003, after which several versions were released between 2004 and 2006. After the JCP standardization process began, the version numbering was changed and a version called "1.0" was released on Tuesday, January 2, 2007. The release was immediately re-branded as Groovy 1.5 in recognition of its substantial improvements.
Grails attempts to provide:
The NetBeans Ruby Project Type supports Ruby files, RSpec specification files, and YAML files. Projects can be executed using JRuby or any other native Ruby installation on one's system. The NetBeans IDE has Rake build tool integration and offers access to the Interactive Ruby Shell (IRB). The Ruby Source Code Editor indents, completes, and highlights Ruby code syntactically as well as semantically, parsing code live as the developer types, so it can match words and brackets, mark errors and occurrences, and display hints and RDoc. Common code snippets can be inserted from live templates with a few keystrokes. Refactoring and support for Test::Unit, Auto Test, and RSpec are well integrated. NetBeans Ruby-on-Rails Project Type supports Rake targets and database migrations, enabling users to generate Rails projects or generate code through the Rails code generator graphical wizard. The logical project view clearly separates controllers from models, views, and database migrations. Users can edit RHTML files and deploy projects directly to the integrated WEBrick and Mongrel web servers, jump quickly between a Rails action and its corresponding view, and warp to the browser for the URL most relevant to the file being edited. The Ruby and Rails Debugger lets developers single-step or run through Ruby code and RHTML files. Users can set breakpoints, look at local variables, navigate the call stack, and switch threads. Hovering the mouse over a variable in the Editor lets developers evaluate the expression and show it in a tooltip. The NetBeans IDE supports the Fast Debugger extension for Ruby and Rails programs, a pure Ruby debugger, and a JRuby debugger. The Ruby Gems Installation Manager extends Ruby installations using the integrated Ruby Gems packaging system, enabling users to add and manage freely available Ruby software libraries and to distribute their own packages. Arun Gupta, a technology evangelist for web services and web 2.0 applications at Sun, has explained how to swap the JRuby interpreter in the NetBeans IDE with a C-based Ruby interpreter, and vice versa. Ruby has been most often developed on GNU/Linux, and works on many types of UNIX, Mac OS X, Microsoft Windows 95/98/Me/NT/2000/XP, DOS, BeOS, OS/2, and other operating systems. But Sun has now made it very easy to develop Ruby applications on the NetBeans IDE and the Solaris operating system. Here's how.
JRuby is supported on Project GlassFish V2 through a JRuby on GlassFish module. This module makes it easier to deploy a Ruby-on-Rails application to a GlassFish application server, enabling Rails developers to take advantage of GlassFish. The JRuby 1.0.1 source bits in this module have been updated with the following Ruby gems:
Opening the JVM to Ruby and the advent of JRuby on Rails marks an advance in Java technology. It enables the faster creation of easily maintained and rich web sites in the Web 2.0 era. Of particular note is Sun's Da Vinci Machine project, which is extending the JVM with first-class architectural support for languages other than the Java language, with a focus on dynamic languages. The project will prototype a number of extensions to the JVM so that it can run other languages efficiently, with a performance level comparable to that of the Java language itself. Sun is aspiring to a multilanguage renaissance for the JVM architecture. Ruby's growing popularity, as well as its support on the JVM through JRuby, plus the tooling support of the NetBeans IDE and Solaris OS support in Cool Stack, results in a complete Ruby developer environment, from tools and databases to servers and runtimes. As other dynamic languages and applications evolve, the flexibility, interoperability, and sheer power of the Java platform should enhance the power of the web for future generations.
_______ For More Information |
Here's what you need to develop Ruby, JRuby, and Rails applications with NetBeans, Solaris, Cool Stack SAMP, GlassFish, MySQL, and more on our Ruby Developer Resource
Center.
| ||||||||||||||||||
Oracle is reviewing the Sun product roadmap and will provide guidance to customers in accordance with Oracle's standard product communication policies. Any resulting features and timing of release of such features as determined by Oracle's review of roadmaps, are at the sole discretion of Oracle. All product roadmap information, whether communicated by Sun Microsystems or by Oracle, does not represent a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. It is intended for information purposes only, and may not be incorporated into any contract.
|
| ||||||||||||