What is Ruby?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What is Ruby?
# 1  
Old 09-21-2010
What is Ruby?

Lately there have been a lot of one-liners posted in "ruby" on the apparent assumption that mainstream unix or Linux come with "ruby. They don't.
  1. What is "ruby"?
  2. What platforms and Operating System versions are supported?
  3. The syntax for "ruby" seems remarkably obscure compared with say "awk" or "perl". Is it related to APL?
# 2  
Old 09-21-2010
Reference:

Ruby (programming language) - Wikipedia, the free encyclopedia
Quote:
Ruby is a dynamic, reflective, general purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features. Ruby originated in Japan during the mid-1990s and was first developed and designed by Yukihiro "Matz" Matsumoto. It was influenced primarily by Perl, Smalltalk, Eiffel, and Lisp.

Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective. It also has a dynamic type system and automatic memory management; it is therefore similar in varying respects to Python, Perl, Lisp, Dylan, Pike, and CLU.

The standard 1.8.7 implementation is written in C, as a single-pass interpreted language. There is currently no specification of the Ruby language, so the original implementation is considered to be the de facto reference. As of 2010[update], there are a number of complete or upcoming alternative implementations of the Ruby language, including YARV, JRuby, Rubinius, IronRuby, MacRuby, and HotRuby, each of which takes a different approach, with IronRuby, JRuby and MacRuby providing just-in-time compilation and MacRuby also providing ahead-of-time compilation. The official 1.9 branch uses YARV, as will 2.0 (development), and will eventually supersede the slower Ruby MRI.
This User Gave Thanks to Neo For This Post:
# 3  
Old 09-21-2010
Quote:
Originally Posted by methyl
What is "ruby"?
Just another programming language

Quote:
Originally Posted by methyl
What platforms and Operating System versions are supported?
the usual, Solaris, Windows,Linux, MacOS. etc

Quote:
Originally Posted by methyl
The syntax for "ruby" seems remarkably obscure compared with say "awk" or "perl"
that's because you don't know about it. Same concept as a person who doesn't understand Perl/awk will find them "obscure" as well.

Quote:
Originally Posted by methyl
Lately there have been a lot of one-liners posted in "ruby" on the apparent assumption that mainstream unix or Linux come with "ruby. They don't.
who says one has to solve everything using just "mainstream" tools? And how do you define mainstream? For example, nowadays, linux packages/CDs comes with Ruby. Either its selected by default or an administrator can choose to install it. Now, does the system become "mainstream" in that situation, or not?
Ruby is just a tool like any other languages out there, Perl, Python you name it.
These 3 Users Gave Thanks to kurumi For This Post:
# 4  
Old 09-21-2010
Quote:
Originally Posted by kurumi
Ruby is just a tool like any other languages out there, Perl, Python you name it.
I agree. It is pretty easy to install, for example on Debian / Ubuntu:

Code:
root@myserver:/home/neo/bin# ruby
The program 'ruby' is currently not installed.  You can install it by typing:
apt-get install ruby
ruby: command not found

On my Mac, is it installed "out of the box".

OSX: man ruby

See also: Apropos for Ruby

See also: Ruby Home Page (English)
This User Gave Thanks to Neo For This Post:
# 5  
Old 09-21-2010
Thanks for the links.

Having now seen properly laid out whole programs in Ruby the language structure is a bit clearer. I still am surprised that a modern programming language can have an obscure syntax.

Having first learnt to program in Algol 68, I find Python easiest to follow of the modern crop of languages. I've used a large number of programming and scripting languages over the years and have my favourites.
# 6  
Old 09-21-2010
Understood.

I don't program in Ruby, but a lot of people do!

Seem interesting, from a OO scripting perspective.
# 7  
Old 09-21-2010
Having now read the roots of "Ruby" are in "Lisp" it's giving me flashbacks. I found "Lisp" a pain the first time around compared with some of the contemporary languages.

Thank you all again for your responses. I've been bursting to ask the question for weeks.
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. What is on Your Mind?

Ruby language

Hi All, Could you please suggest books for learning ruby and python language ? Thanks, Pravin (1 Reply)
Discussion started by: pravin27
1 Replies

2. Shell Programming and Scripting

Printf with backreference in ruby

Hello everybody, May you help with this, I don't know what is wrong. I want trying to print the first 4 characters as decimal and remove the "k's" from the next 7 characters. I'm trying with gsub and backrefence as shown below trying to remove the "k's" and then trying to assign to "x" the... (0 Replies)
Discussion started by: Ophiuchus
0 Replies

3. UNIX for Advanced & Expert Users

Need help installing Puppet and Ruby..

Hi, I am working on RHEL 5.6 server, this is in private DMZ. No access to internet. I have downloaded the files I need to install the Puppet & Ruby. My goal is to install Puppet. I have downloaded.... mcollective-2.2.3-1.el5.noarch- SERVER.rpm ... (2 Replies)
Discussion started by: samnyc
2 Replies

4. Programming

Ubuntu ruby on rails

Hi, I am a php developer and I decided to learn ruby on rails. I have a few question. I have an ubuntu virtual machine with lamp. It mean that it has alrweady php and when I access the ip of the machine from my browser it does load the index.php. if I install ruby on rails will theere... (0 Replies)
Discussion started by: programAngel
0 Replies

5. Shell Programming and Scripting

Parsing the Ruby File

Hai any one pls guide me... We can extract the line number of the sub routine/function/method in a Ruby file using the ctags command. But I want to know the line number in which the sub routine is ending. Example: Say the function get_days_in_hash starts in the line number 20. It... (2 Replies)
Discussion started by: thillai_selvan
2 Replies

6. SuSE

how to ri-rdoc for Ruby on suse

Hello guys, This is suse SLES 9.2. I want to get ri working for all users on this system. I used gem rdoc --all --ri to generate documentation and it went on doing it successfully. Then I tried ri Array It shows following message : Nothing known about Array Therefore I ran... (0 Replies)
Discussion started by: upengan78
0 Replies
Login or Register to Ask a Question