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.
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.
I agree. It is pretty easy to install, for example on Debian / Ubuntu:
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
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.
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.
almost everything in Ruby is object based. For example, in Perl, you write for loop like this
for ($i=0; $i<10; $i++) {
....
}
in Ruby,
1.upto(10).each{|x| puts x} # 1 is an integer class with method upto()
or
(1..10).each{|x| puts x} # (1..10) provides a range...like in Perl
There is no using loops here. "Looping" is taken care of by the programming language itself (of course, there are also for loops in Ruby ). If you are accustomed to procedural programming where you use for loops often, this might seem "obscure" at first.
Do you mean functional programming ? ( Its a more familiar term to me. ). If you do indeed mean functional programming, then yes, Ruby supports that. In fact, in the wiki page you provided, its stated it support multi paradigms.
Ruby can be used as "procedural" as well.... with that i mean, in the script, there isn't a single user defined class.
I see. Well, I am not sure about the distinctions between them...but i want to assume that if Ruby support functional prog , regular expression, then i would expect it to be a bit "declarative" as well.
I've been leisurely following ruby for a few years. I have one production code, glark, written in ruby. It is a grep-like utility, with lots of bells and whistles -- very slow, but very convenient in some situations. You might find it in one of your repositories, or at: incava.org
However, whenever I have tried to execute kurumi's one-liners, say: