Ruby (programming language)
More sample Ruby code is available as algorithms in the following articles:
[
Implementations
- See also: Ruby MRI#Operating systems
Ruby has two main implementations: The official Ruby interpreter often referred to as the Matz's Ruby Interpreter or MRI, which is the most widely used, and JRuby, a Java-based implementation.
There are other less known implementations such as IronRuby (pre-alpha sources available on August 31st, 2007[13]), Rubinius, Ruby.NET, XRuby and YARV. YARV is Ruby 1.9's official new virtual machine and is no longer a separate project.
The maturity of Ruby implementations tend to be measured by their ability to run Rails (because this is a complex framework to implement, and it use a lot of Ruby specific features). The point when a particular implementation achieve this goal is called The Rails singularity. As of May 2008, only the reference implementation (MRI) and JRuby are able to run Rails unmodified in a production environment[14]. IronRuby[15][16] and Rubinius[17] start to be able to run Rails simple test cases, but they still are far from production ready for this task.
As of Ruby MRI, Ruby is available on a lot of operating systems such as Linux, Mac OS X, Microsoft Windows, Windows CE and most flavors of Unix.
[
Criticism
A number of the design choices made for Ruby have well-known disadvantages:
- As in BASIC, because variables are not required to be declared before use, typing errors can introduce new variables and cause unexpected behavior.[18]
- Dynamic typing can cause type errors to be found later in the development process, making them more expensive to fix, and add runtime overhead compared to static typing.
- The runtime extensible environment enabled by metaprogramming can make programs more difficult to reason about statically and inhibit some types of optimizations.
- The Ruby threading model uses green threads [19], and its model has some inherent limitations which render it difficult to use or unsafe in some scenarios.[20]
- Ruby 1.8 does not yet have native support for Unicode or multibyte strings,[21] although 1.9 added multiple improvements in this area.[citation needed]
- Ruby suffers from backward compatibility problems.[22]
Ruby 2.0 aims to address all of the aforementioned problems:
- Native threads will be used instead of green threads.[23]
- Full support for Unicode strings.
Some problems which may not be solved in version 2.0 include:
- Ruby still lacks a specification, the current C implementation being the de facto reference specification.[24][25]
[
Repositories and libraries
The Ruby Application Archive (RAA), as well as RubyForge, serve as repositories for a wide range of Ruby applications and libraries, containing more than seven thousand items. Although the number of applications available does not match the volume of material available in the Perl or Python community, there are a wide range of tools and utilities which serve to foster further development in the language.
RubyGems has become the standard package manager for Ruby libraries. It is very similar in purpose to Perl's CPAN, although its usage is more like apt-get.
[
See also
- PHP
- Duck typing
- Comparison of programming languages
- Watir
- Ruby MRI, the reference C implementation
- JRuby
- IronRuby
- Rubinius
- XRuby
- Ramaze
- Ruby on Rails
[
References
- ^ An Interview with the Creator of Ruby
- ^ The Ruby Programming Language by Yukihiro Matsumoto on 2000-06-12 (informit.com)
- ^ The Philosophy of Ruby, A Conversation with Yukihiro Matsumoto, Part I by Bill Venners on 2003-09-29 (Artima Developer)
- ^ The Philosophy of Ruby, A Conversation with Yukihiro Matsumoto, Part I by Bill Venners on 2003-09-29 (Artima Developer)
- ^ Ruby Weekly News 23rd - 29th May 2005
- ^ The Philosophy of Ruby
- ^ Green threads
- ^ Ruby FAQ
- ^ How Does Ruby Compare With Python? (FAQ)
- ^ Leverett, D. (2006-09-15). Ruby - Add class methods at runtime. Retrieved on 2007-11-01.
- ^ In Ruby's syntax, statement is just a special case of a expression which cannot appear as a argument (e.g. multiple assignment). http://ruby-talk.com/1120
statement [...] can not be part of expression unless grouped within parentheses. http://ruby-talk.com/2460 - ^ a b The Computer Language Benchmarks Game
- ^ John Lam. IronRuby on Rubyforge!. Retrieved on 2007-08-31.
- ^ Charles Nutter (2008-04-27). Promise and Peril for Alternative Ruby Impls. Retrieved on 2008-06-01.
- ^ John Lam (2008-05-25). IronRuby / Rails Question. Retrieved on 2008-05-25.
- ^ John Lam (2008-05-30). IronRuby and Rails. Retrieved on 2008-06-01.
- ^ Evan Phoenix (2008-05-17). Rails on Rubinius. Retrieved on 2008-05-25.
- ^ What’s Wrong With Ruby?
- ^ Ruby Threading - RubySpec
- ^ Writing a standlone, threaded application using Ruby On Rails at KILLERSITES.COM
- ^ Headius: Unicode in Ruby, Unicode in JRuby?
- ^ InfoQ: Ruby 1.9 released
- ^ Gluttonous : YARV Progress Report
- ^ Headius: What Would I (Will I?) Change About Ruby
- ^ From Java to Ruby
[
External links
- Ruby language home page
- Ruby documentation site
- Ruby.on-page.net — the simplest Ruby manual with many samples
- Ruby programming language at the Open Directory Project
- Ruby User Guide Mirror
- Ruby From Other Languages
- Wiki: Ruby language and implementation specification
- Writing C Extensions to Ruby (MRI 1.8)
- RubyFlow: Community Filtered Ruby News
|
||||||||||||||
For more information review our copyright contact and privacy policy.
