Discussion:
Why Ruby over Python?
(too old to reply)
h***@gmail.com
2006-07-08 14:10:08 UTC
Permalink
Besides ROR, can you give me a reason why perfer ruby instead of
python?

seems to many users, they are very similar in nature...

such as

1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Lyle Johnson
2006-07-08 14:18:05 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
http://www.google.com/search?q=ruby+versus+python
vasudevram
2006-07-08 14:40:08 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Hi,

I'm sticking my neck out here a bit, since I'm relatively new to Ruby,
but gonna do it anyway ... :0) [I do have a good amount of experience
in other languages like Java, C, Python]. More knowledgeable Rubyists,
feel free to flame away at what I say below :-) I know I'll learn
something from it anyway.

Reason 0: First of all, its not necessarily a matter of preferring Ruby
*over* Python. Its not an either-or situation at all - unless you want
to make it one. Its quite possible to learn and work with more than one
language at the same time, or at least in a staggered/parallel manner.
Many top developers are of the view that learning and using more than
one language is beneficial, helps you grow as a programmer. I believe
that myself. Dave Thomas recently spoke at a No Fluff Just Stuff
interview on this point. I heard the MP3 - it was good. Don't have the
URL right now, try Googling for keywords like +"Dave Thomas" + "NFJS"
or variants.

Reason 1: Ruby is more object-oriented than Python.

Reason 2: The Principle of Least Surprise. You can, to a good extent,
almost figure out how parts of the language / syntax work, after you've
learnt a bit of it. Read the Pickaxe and other Ruby books and the docs
to see more on what this means.
I've been writing some Ruby code and can attest to it.

Reason 3: No indentation rules like in Python. Just open the logical
construct like if or while with its corresponding keyword ("if" /
"while"), close it with "end". Though I'm an experienced developer and
a very good typist, Python's syntax rules recently almost drove me mad,
trying to track down an elusive bug that was related to indentation.
The rules of indentation themselves are straightforward enough. The
problem arises when you accidentally, say, mix spaces and tabs, or, if
you're not using tabs (which is probably better), put in one more or
less space - stuff like that. This was not the problem in my case,
since I consistently use tabs. The problem arose - I think - because I
was switching text editors (Metapad and GVim on windows) at times in a
coding session. This somehow led to the changing of some tabs to
spaces. Hard to detect visually in a Windows style editor like Metapad.
Using the ":se list" option in GVim can help, but it still takes time
to track down and change all those spaces back to tabs. One can argue
away that one should not change editors in the middle of a session,
etc., but the point is that this problem simply would not happen in
Ruby, even if you switch editors midway.

Though I like Python a lot, this is one reason why I'm moving some of
my work to Ruby.
[ I finally did manage to identify and fix the problem. ]

I'm sure you'll get some other replies, which I'll read with interest
...

HTH
Vasudev
------------------------------------------------------------------------------------------------
Vasudev Ram
Independent software consultant
http://www.geocities.com/vasudevram
PDF conversion toolkit:
http://sourceforge.net/projects/xtopdf
------------------------------------------------------------------------------------------------
M. Edward (Ed) Borasky
2006-07-08 17:08:17 UTC
Permalink
Post by vasudevram
Hi,
I'm sticking my neck out here a bit, since I'm relatively new to Ruby,
but gonna do it anyway ... :0) [I do have a good amount of experience
in other languages like Java, C, Python]. More knowledgeable Rubyists,
feel free to flame away at what I say below :-) I know I'll learn
something from it anyway.
Not so much flames as challenges ...
Post by vasudevram
Reason 0: First of all, its not necessarily a matter of preferring Ruby
*over* Python. Its not an either-or situation at all - unless you want
to make it one. Its quite possible to learn and work with more than one
language at the same time, or at least in a staggered/parallel manner.
Many top developers are of the view that learning and using more than
one language is beneficial, helps you grow as a programmer.
I have found that switching languages rapidly, frequently, even in a
"staggered/parallel" manner is for the most part counter-productive.
Programming in *any* language is an activity that requires a mix of
intense focus on the programming tasks *and* an intensely active
communication in a spoken human language with customers and colleagues.
Add multiple programming languages and you lose focus.

Occasionally a project will need multiple languages. I've found those go
slower and are more difficult than projects where you can wallow in your
knowledge of a single language and a single application domain. I pity a
programmer who has to write a Ruby - FORTRAN bridge that is called by a
Java ERP application for an engineering firm located in Quebec. :)

Yes, indeed, learning multiple languages does help you grow, provided
they aren't too similar. There's a note about that on someone's blog --
give me a day or so and I can track it down. But briefly, he claimed --
and I somewhat agree -- that there are two broad classes of language.

There's the "Algol Family", into which class C/C++, Java, Python, Ruby,
Perl, etc. fall, and there's the "Lisp Family". If you're like most of
us, you spend most of your time in the Algol family. His point was that
you grow more if you learn a Lisp family language than if you learn
another Algol family language.

Incidentally, where I disagree is that I think there are six families:

1. Macro assemblers
2. Algol
3. Lisp
4. APL
5. Forth
6. Smalltalk

One of the things that's attractive to me about Ruby is that it contains
features from most of the six. I haven't found much of APL or Forth, but
there are clearly influences from Algol, Lisp, Smalltalk and macro
assembler.
Post by vasudevram
Reason 1: Ruby is more object-oriented than Python.
Well ... Ruby objects were there from day one, and they resemble
"classical" object concepts like those in Smalltalk, C++ and Java, but I
don't think *today's* Python is "less object-oriented" than *today's*
Ruby, nor do I think Ruby is "more object-oriented" than R, Lisp or Scheme.
Post by vasudevram
Reason 2: The Principle of Least Surprise. You can, to a good extent,
almost figure out how parts of the language / syntax work, after you've
learnt a bit of it. Read the Pickaxe and other Ruby books and the docs
to see more on what this means.
I've been writing some Ruby code and can attest to it.
I haven't found Ruby code all that obvious to a newcomer. I've been
programming a long time, and I have a programming style that evolved
from macro assembler to FORTRAN to Perl to R, with influences from Lisp,
FORTH and Java.

Part of it is that I'm very much more familiar and comfortable with
functional programming than I am with object-oriented programming. In my
younger days, I was actually one of those people who went around on long
tirades declaiming that Functional Programming was the one true way. :)
I thought pure functional languages had a lot going for them. I still do.

I spent about three hours last night trying to understand Hal Fulton's
well-crafted example of metaprogramming that reads CSV files. I know it
will make sense to me eventually, but it didn't after three hours. I
know it's "good code", I know it's "elegant code", I know it's an
example of the wonders of Ruby, and I know it works. But I still don't
know why. :)
Post by vasudevram
Reason 3: No indentation rules like in Python. Just open the logical
construct like if or while with its corresponding keyword ("if" /
"while"), close it with "end". Though I'm an experienced developer and
a very good typist, Python's syntax rules recently almost drove me mad,
trying to track down an elusive bug that was related to indentation.
The rules of indentation themselves are straightforward enough. The
problem arises when you accidentally, say, mix spaces and tabs, or, if
you're not using tabs (which is probably better), put in one more or
less space - stuff like that. This was not the problem in my case,
since I consistently use tabs. The problem arose - I think - because I
was switching text editors (Metapad and GVim on windows) at times in a
coding session. This somehow led to the changing of some tabs to
spaces. Hard to detect visually in a Windows style editor like Metapad.
Using the ":se list" option in GVim can help, but it still takes time
to track down and change all those spaces back to tabs. One can argue
away that one should not change editors in the middle of a session,
etc., but the point is that this problem simply would not happen in
Ruby, even if you switch editors midway.
Well ... there are language-specific IDEs for Python. If I were
planning/required to learn Python, I'd probably use Leo. I've got Leo
and if I can get it integrated with the languages I do use, Perl, R and
Ruby, I'll give it a shot. And there are language-specific IDEs for
Ruby. But don't *real* programmers use Emacs?

<ducking>

Actually, I've never bothered to learn Emacs. It had a (justified)
reputation as a memory hog, so I learned vi. I'm pretty sure GNU Emacs
is no longer a memory hog, but I'm so firmly down the "vim" path that
Emacs seems like a distraction.
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
M. Edward (Ed) Borasky
2006-07-08 17:20:31 UTC
Permalink
Post by M. Edward (Ed) Borasky
Yes, indeed, learning multiple languages does help you grow, provided
they aren't too similar. There's a note about that on someone's blog --
give me a day or so and I can track it down. But briefly, he claimed --
and I somewhat agree -- that there are two broad classes of language.
http://weblog.hypotheticalabs.com/?p=59
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Robert Dober
2006-07-08 17:52:25 UTC
Permalink
Post by M. Edward (Ed) Borasky
Post by vasudevram
Hi,
I'm sticking my neck out here a bit, since I'm relatively new to Ruby,
but gonna do it anyway ... :0) [I do have a good amount of experience
in other languages like Java, C, Python]. More knowledgeable Rubyists,
feel free to flame away at what I say below :-) I know I'll learn
something from it anyway.
Not so much flames as challenges ...
Post by vasudevram
Reason 0: First of all, its not necessarily a matter of preferring Ruby
*over* Python. Its not an either-or situation at all - unless you want
to make it one. Its quite possible to learn and work with more than one
language at the same time, or at least in a staggered/parallel manner.
Many top developers are of the view that learning and using more than
one language is beneficial, helps you grow as a programmer.
I have found that switching languages rapidly, frequently, even in a
"staggered/parallel" manner is for the most part counter-productive.
Programming in *any* language is an activity that requires a mix of
intense focus on the programming tasks *and* an intensely active
communication in a spoken human language with customers and colleagues.
Add multiple programming languages and you lose focus.
Occasionally a project will need multiple languages. I've found those go
slower and are more difficult than projects where you can wallow in your
knowledge of a single language and a single application domain. I pity a
programmer who has to write a Ruby - FORTRAN bridge that is called by a
Java ERP application for an engineering firm located in Quebec. :)
Yes, indeed, learning multiple languages does help you grow, provided
they aren't too similar. There's a note about that on someone's blog --
give me a day or so and I can track it down. But briefly, he claimed --
and I somewhat agree -- that there are two broad classes of language.
There's the "Algol Family", into which class C/C++, Java, Python, Ruby,
Perl, etc. fall, and there's the "Lisp Family". If you're like most of
us, you spend most of your time in the Algol family. His point was that
you grow more if you learn a Lisp family language than if you learn
another Algol family language.
1. Macro assemblers
2. Algol
3. Lisp
4. APL
5. Forth
6. Smalltalk
One of the things that's attractive to me about Ruby is that it contains
features from most of the six. I haven't found much of APL or Forth, but
there are clearly influences from Algol, Lisp, Smalltalk and macro
assembler.
Post by vasudevram
Reason 1: Ruby is more object-oriented than Python.
Well ... Ruby objects were there from day one, and they resemble
"classical" object concepts like those in Smalltalk, C++ and Java, but I
don't think *today's* Python is "less object-oriented" than *today's*
Ruby, nor do I think Ruby is "more object-oriented" than R, Lisp or Scheme.
Post by vasudevram
Reason 2: The Principle of Least Surprise. You can, to a good extent,
almost figure out how parts of the language / syntax work, after you've
learnt a bit of it. Read the Pickaxe and other Ruby books and the docs
to see more on what this means.
I've been writing some Ruby code and can attest to it.
I haven't found Ruby code all that obvious to a newcomer. I've been
programming a long time, and I have a programming style that evolved
from macro assembler to FORTRAN to Perl to R, with influences from Lisp,
FORTH and Java.
Part of it is that I'm very much more familiar and comfortable with
functional programming than I am with object-oriented programming. In my
younger days, I was actually one of those people who went around on long
tirades declaiming that Functional Programming was the one true way. :)
I thought pure functional languages had a lot going for them. I still do.
I spent about three hours last night trying to understand Hal Fulton's
well-crafted example of metaprogramming that reads CSV files. I know it
will make sense to me eventually, but it didn't after three hours. I
know it's "good code", I know it's "elegant code", I know it's an
example of the wonders of Ruby, and I know it works. But I still don't
know why. :)
Post by vasudevram
Reason 3: No indentation rules like in Python. Just open the logical
construct like if or while with its corresponding keyword ("if" /
"while"), close it with "end". Though I'm an experienced developer and
a very good typist, Python's syntax rules recently almost drove me mad,
trying to track down an elusive bug that was related to indentation.
The rules of indentation themselves are straightforward enough. The
problem arises when you accidentally, say, mix spaces and tabs, or, if
you're not using tabs (which is probably better), put in one more or
less space - stuff like that. This was not the problem in my case,
since I consistently use tabs. The problem arose - I think - because I
was switching text editors (Metapad and GVim on windows) at times in a
coding session. This somehow led to the changing of some tabs to
spaces. Hard to detect visually in a Windows style editor like Metapad.
Using the ":se list" option in GVim can help, but it still takes time
to track down and change all those spaces back to tabs. One can argue
away that one should not change editors in the middle of a session,
etc., but the point is that this problem simply would not happen in
Ruby, even if you switch editors midway.
Well ... there are language-specific IDEs for Python. If I were
planning/required to learn Python, I'd probably use Leo. I've got Leo
and if I can get it integrated with the languages I do use, Perl, R and
Ruby, I'll give it a shot. And there are language-specific IDEs for
Ruby. But don't *real* programmers use Emacs?
<ducking>
Actually, I've never bothered to learn Emacs. It had a (justified)
reputation as a memory hog, so I learned vi. I'm pretty sure GNU Emacs
is no longer a memory hog, but I'm so firmly down the "vim" path that
Emacs seems like a distraction.
--
M. Edward (Ed) Borasky
http://linuxcapacityplanning.com
*much* shorter answers ;)
--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.

- Albert Einstein
Ron M
2006-07-09 08:37:32 UTC
Permalink
Post by M. Edward (Ed) Borasky
I have found that switching languages rapidly, frequently, even in a
"staggered/parallel" manner is for the most part counter-productive.
...
Add multiple programming languages and you lose focus.
I find this not to be true when the languages each are used for the
special purpose they're best suited for. I've seen this to be true
for hardware design, where switching from C models to VHDL or Verilog
makes sense; and for web stuff where switching between (whatever)
and SQL is common; and for embedded DSP stuff where switching
between C and assembly is not uncommon.

I'd even go so far as saying that a mix of Ruby with C extensions is
better in all ways than Java or C# or C++ since in the former case you
can more often use the right-tool-for-the-job while in the latter case
you're using a crippled compromise language that sucks at OO and that
sucks at low-level stuff.

I think many of the more interesting ruby projects (
* _why's Hpricot;
* David Balmain's Ferret;
* Ara's NArray+mmap
) are proving this out, since they're excellent examples of
using Ruby where appropriate and using C where appropriate
and are producing results that go a long way to bringing the
best of both worlds to the user.



And this thought lets me drift back on-topic to the original
Python question -- I find Ruby's C interfaces (both RubyInline
and the traditional one) cleaner than that of most languages,
including Python back when I looked at it. And this cleanliness
is why I care very little about ruby performance concerns - it's
very easy to apply micro-optimizations this way if you need to.
Post by M. Edward (Ed) Borasky
I pity a
programmer who has to write a Ruby - FORTRAN bridge that is called by a
Java ERP application for an engineering firm located in Quebec. :)
Hmm.. I did Ada/Fortran and Fortran/Forth bridges as
one of my earlier programming jobs. Close enough?
Daniel Martin
2006-07-09 12:35:50 UTC
Permalink
Post by M. Edward (Ed) Borasky
1. Macro assemblers
2. Algol
3. Lisp
4. APL
5. Forth
6. Smalltalk
I'm just curious; where does Haskell fit in this? I think in this
taxonomy it might fall under "lisp" because of the broad "functional"
language category, but I've found that doing serious stuff in Haskell
stretches my mind more than the bits of common lisp I've learned (but
that's probably because I have never gotten heavily into CL macros).

I remember several years ago someone responded to a slashdot interview
question with a list of about twelve language categories, with several
languages fitting into multiple categories; the idea was that a
well-rounded programmer would know at least one language from each
category. I'll see if I can find it.

As for the original subject of this thread, I just find ruby more fun
to program in. I definitely do not think that ruby code is more
obvious to the untrained eye than other languages - if that were the
only category, python would indeed win. However, the experience of
writing python feels like explaining things in detail to a somewhat
dim coworker. While there's something to be said for that approach, I
find that it often gets in the way of what I want to do - I want a
fast way to translate ideas into running code. Since there's not yet
a telepathic compiler, we're stuck with using some sort of language,
and I see no reason to use a language more cumbersome than necessary.
I suppose that the whitespace usage comes into play here, although I'm
definitely not opposed to using significant whitespace, having been
bitten a few times by ruby code that looked right indentation-wise but
left off the "end". I just wish python whitespace were optional the
way it is in Haskell.

That being said, the dynamic language I use the most is still perl. I
was never nearly as put off by all the bits of "snoopy swearing" as
some people seem to be - I suppose I learned perl at a time when my
mind was flexible enough that it just twisted certain structures into
a perl shape. Perl also has the advantage of being much faster for
most operations than ruby or python.

When I want to move text A in spot one over to text B in spot two, I
use perl. That's what it's for, and it does that job amazingly well.
(It's not all regexps either. The one-liner to convert fixed length
records into newline-delimited regexps is nice and tight.) It's
disturbing how many business problems boil down to moving text from A
to B.

When I wanted to document an algorithm for my father (who speaks none
of the same computer languages I do aside from C/C++, and has spent
his career largely in VB or at the VB/COM interface), I used python.
I was already doing extensive documentation, so at that point...

When I want to play with programming, I choose ruby. When I want to
experiment, and don't really know where I'm going to end up, or how
I'm going to want to do something, ruby is there and ready to be
twisted however I want. In short, when I want to have fun, I choose
ruby.

(those business analysts who are looking at this and thinking of right
now mandating python use for everything are well advised to go
(re-)read the book "Peopleware", and realize that developers having
"fun" has very serious economic advantages)
Francis Cianfrocca
2006-07-09 13:19:30 UTC
Permalink
Post by Daniel Martin
I'm just curious; where does Haskell fit in this? I think in this
taxonomy it might fall under "lisp" because of the broad "functional"
language category, but I've found that doing serious stuff in Haskell
stretches my mind more than the bits of common lisp I've learned (but
that's probably because I have never gotten heavily into CL macros).
Haskell is a strict, lazy functional language (and pretty close to the
state-of-the-art in computer languages, IMHO). As such it neatly fits the
Lisp category.

(those business analysts who are looking at this and thinking of right
Post by Daniel Martin
now mandating python use for everything are well advised to go
(re-)read the book "Peopleware", and realize that developers having
"fun" has very serious economic advantages)
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really interested to
hear them.

If you follow the framework debates in the Java world, they've been talking
for months now about how heavyweight frameworks (which are still being
invented every other day, it seems) may be dying because of Ajax (read,
because of Rails). This obviously scares the hell out of people who have
invested heavily in Struts, Faces, and similar stuff.
M. Edward (Ed) Borasky
2006-07-09 17:59:51 UTC
Permalink
Post by Francis Cianfrocca
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really
interested to
hear them.
Well, I rather suspect .NET has reached the point that it's
"mandatable", like all other Microsoft products. On the other hand, the
whole point of Java is, or at least was, to be server and desktop
platform independent. Whether it's worked out that way is a question I
can't answer.
Post by Francis Cianfrocca
If you follow the framework debates in the Java world, they've been talking
for months now about how heavyweight frameworks (which are still being
invented every other day, it seems) may be dying because of Ajax (read,
because of Rails). This obviously scares the hell out of people who have
invested heavily in Struts, Faces, and similar stuff.
Has anyone really determined once and for all whether the dinosaurs died
out because they were too large for their environment or because a huge
hunk of rock hit the Yucutan Peninsula? :)
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Joel VanderWerf
2006-07-09 19:51:00 UTC
Permalink
Post by Francis Cianfrocca
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really
interested to
hear them.
Google? (Python and AJAX)
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
James Britt
2006-07-09 20:30:34 UTC
Permalink
Post by Joel VanderWerf
...
Google? (Python and AJAX)
Microsoft has been using AJAX since 1998 or so.

Not so much Java. :)
--
James Britt
Francis Cianfrocca
2006-07-09 21:49:18 UTC
Permalink
GOOG isn't a big company ;-).
MSFT is, though. But they don't really count for this discussion because
they have a dog in the fight.
Post by Joel VanderWerf
Post by Francis Cianfrocca
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is
seen
Post by Francis Cianfrocca
by many as a dangerous and subversive practice that must not be allowed
to
Post by Francis Cianfrocca
take root. If you have examples to the contrary, I'd be really interested to
hear them.
Google? (Python and AJAX)
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Christian Neukirchen
2006-07-09 21:31:21 UTC
Permalink
Post by Francis Cianfrocca
Post by Daniel Martin
I'm just curious; where does Haskell fit in this? I think in this
taxonomy it might fall under "lisp" because of the broad "functional"
language category, but I've found that doing serious stuff in Haskell
stretches my mind more than the bits of common lisp I've learned (but
that's probably because I have never gotten heavily into CL macros).
Haskell is a strict, lazy functional language (and pretty close to the
state-of-the-art in computer languages, IMHO). As such it neatly fits the
Lisp category.
Except just about all Lisps are dynamically-typed, not lazy and not
side-effect free either... Haskell would make a good addition to the
taxonomy on itself.
--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
Francis Cianfrocca
2006-07-09 21:59:11 UTC
Permalink
Post by Christian Neukirchen
Except just about all Lisps are dynamically-typed, not lazy and not
side-effect free either... Haskell would make a good addition to the
taxonomy on itself.--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
I guess you could say that. I used to write compilers for a living, so
perhaps my perspective is different. To me the essential trait that
distiguishes the Lisp-like family is that they're all based on
lambda-calculus. Everything Algol-like (including Ruby) is basically a
Turing machine. SQL and similar languages are off to the side, and Fortran I
guess would have to be classed as Turing-like. We're way off thread here, so
if you want to have the last word, be my guest ;-).
Martin DeMello
2006-07-10 06:44:27 UTC
Permalink
Post by Francis Cianfrocca
Post by Christian Neukirchen
Except just about all Lisps are dynamically-typed, not lazy and not
side-effect free either... Haskell would make a good addition to the
taxonomy on itself.--
I guess you could say that. I used to write compilers for a living, so
perhaps my perspective is different. To me the essential trait that
distiguishes the Lisp-like family is that they're all based on
lambda-calculus. Everything Algol-like (including Ruby) is basically a
Turing machine. SQL and similar languages are off to the side, and Fortran I
guess would have to be classed as Turing-like. We're way off thread here, so
if you want to have the last word, be my guest ;-).
From what little I've seen of Smalltalk it looks pretty lispy to me -
why does it get a category of its own?

martin
Christian Neukirchen
2006-07-10 20:42:57 UTC
Permalink
Post by Francis Cianfrocca
Post by Francis Cianfrocca
Post by Christian Neukirchen
Except just about all Lisps are dynamically-typed, not lazy and not
side-effect free either... Haskell would make a good addition to the
taxonomy on itself.--
I guess you could say that. I used to write compilers for a living, so
perhaps my perspective is different. To me the essential trait that
distiguishes the Lisp-like family is that they're all based on
lambda-calculus. Everything Algol-like (including Ruby) is basically a
Turing machine. SQL and similar languages are off to the side, and Fortran I
guess would have to be classed as Turing-like. We're way off thread here, so
if you want to have the last word, be my guest ;-).
From what little I've seen of Smalltalk it looks pretty lispy to me -
why does it get a category of its own?
Because of the environment?

Although you now could claim Lisp is image-based too...
Post by Francis Cianfrocca
martin
--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
Christian Neukirchen
2006-07-10 20:33:49 UTC
Permalink
Post by Francis Cianfrocca
Post by Christian Neukirchen
Except just about all Lisps are dynamically-typed, not lazy and not
side-effect free either... Haskell would make a good addition to the
taxonomy on itself.--
I guess you could say that. I used to write compilers for a living, so
perhaps my perspective is different. To me the essential trait that
distiguishes the Lisp-like family is that they're all based on
lambda-calculus. Everything Algol-like (including Ruby) is basically a
Turing machine. SQL and similar languages are off to the side, and Fortran I
guess would have to be classed as Turing-like. We're way off thread here, so
if you want to have the last word, be my guest ;-).
I didn't write a compiler worth that name yet, but I read a fair lot
about compiling Lisp, Scheme and Haskell. All I can say, a good
Haskell compiler is pretty different to a good Lisp compiler.
--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
Joe Van Dyk
2006-07-10 05:29:34 UTC
Permalink
Post by Francis Cianfrocca
Post by Daniel Martin
I'm just curious; where does Haskell fit in this? I think in this
taxonomy it might fall under "lisp" because of the broad "functional"
language category, but I've found that doing serious stuff in Haskell
stretches my mind more than the bits of common lisp I've learned (but
that's probably because I have never gotten heavily into CL macros).
Haskell is a strict, lazy functional language (and pretty close to the
state-of-the-art in computer languages, IMHO). As such it neatly fits the
Lisp category.
(those business analysts who are looking at this and thinking of right
Post by Daniel Martin
now mandating python use for everything are well advised to go
(re-)read the book "Peopleware", and realize that developers having
"fun" has very serious economic advantages)
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really interested to
hear them.
Boeing's recognized that Python has significant advantages over Java
for some things. The company certainly isn't mandating Java.

Joe
Mat Schaffer
2006-07-10 12:30:00 UTC
Permalink
Post by Francis Cianfrocca
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really interested to
hear them.
Comcast is laying some serious AJAX groundwork these days. We still
do a lot of Java, but I've done Ruby for smaller projects already.
-Mat
M. Edward (Ed) Borasky
2006-07-10 13:31:57 UTC
Permalink
Post by Mat Schaffer
Post by Francis Cianfrocca
I haven't met anyone working for a large or reasonably-large company
who is thinking of mandating anything but Java. Python is generally
considered highly suspect and Ruby isn't on the radar at all. Ajax is seen
by many as a dangerous and subversive practice that must not be allowed to
take root. If you have examples to the contrary, I'd be really interested to
hear them.
Comcast is laying some serious AJAX groundwork these days. We still
do a lot of Java, but I've done Ruby for smaller projects already.
-Mat
I know of several organizations that have thrown Java out because of
excessive memory usage on the servers. What I don't know is whether the
alternatives (PHP and ASP-non-.NET) are any more respectful of one's
memory budget than Java.
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Francis Cianfrocca
2006-07-10 13:48:45 UTC
Permalink
Post by M. Edward (Ed) Borasky
I know of several organizations that have thrown Java out because of
excessive memory usage on the servers. What I don't know is whether the
alternatives (PHP and ASP-non-.NET) are any more respectful of one's
memory budget than Java.
That's really interesting. Are these big companies that have given up on
major projects?
In my experience, the only thing that compares to Java in its desire to be
the only major application running on a server is Oracle (which seems to eat
as much shared memory as it get its paws on). We sell an appliance product
and have always resisted installing a JVM on it, despite the value it would
bring, because of the memory issue.
M. Edward (Ed) Borasky
2006-07-11 03:27:55 UTC
Permalink
Post by Francis Cianfrocca
That's really interesting. Are these big companies that have given up on
major projects?
The one instance I'm most familiar with was a Linux/Apache/PHP project
using a legacy database. They were using Java for some essential
functionality but the real guts of the app was PHP. They pulled Java out
and moved the functionality somewhere else, but I don't recall where.
Post by Francis Cianfrocca
In my experience, the only thing that compares to Java in its desire to be
the only major application running on a server is Oracle (which seems to eat
as much shared memory as it get its paws on). We sell an appliance product
and have always resisted installing a JVM on it, despite the value it would
bring, because of the memory issue.
Yeah ... last time I looked the minimum JVM was 32 MB, and I'm not sure
that would support more than one thread.
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
vasudevram
2006-07-09 18:25:10 UTC
Permalink
Post by M. Edward (Ed) Borasky
Not so much flames as challenges ...
Post by vasudevram
to make it one. Its quite possible to learn and work with more than one
language at the same time, or at least in a staggered/parallel manner.
Many top developers are of the view that learning and using more than
one language is beneficial, helps you grow as a programmer.
I have found that switching languages rapidly, frequently, even in a
"staggered/parallel" manner is for the most part counter-productive.
Programming in *any* language is an activity that requires a mix of
intense focus on the programming tasks *and* an intensely active
communication in a spoken human language with customers and colleagues.
Add multiple programming languages and you lose focus.
I might not have made my above point ("it is quite possible to ...")
clear. What I meant was, once you've learned those (more than one)
languages, to a reasonable degree of proficiency, then its quite
possible to work with more than one at the same time (strictly
speaking, in a staggered manner - I haven't yet seen anyone who can
write more than one program (whether in one language or two) literally
at the same time ... :-) in a given project.

I've done that in real-life projects (and this is often a genuine need
in such projects); e.g. have programmed in Informix ESQL/C (which is
actually like two languages - C and SQL in one source file) (for
database apps), plain UNIX C (for system tools or one-off programs to
be used by me and developers), Java (for biz apps again, as well as
system utliities), standalone SQL scripts (run from an SQL client), and
UNIX shell scripts (for automating tasks and calls to other programs) -
all in a single large long-running corporate project.

The organization not having resources for hiring specialized developers
for each individual language can also be a reason for needing to have
people (rather, the same person) develop in more than one language on
one project.
Post by M. Edward (Ed) Borasky
Occasionally a project will need multiple languages. I've found those go
slower and are more difficult than projects where you can wallow in your
knowledge of a single language and a single application domain. I pity a
programmer who has to write a Ruby - FORTRAN bridge that is called by a
Java ERP application for an engineering firm located in Quebec. :)
Not so occasionally, IMO - at least in larger corporate projects - see
1st para above.
Post by M. Edward (Ed) Borasky
Yes, indeed, learning multiple languages does help you grow, provided
they aren't too similar. There's a note about that on someone's blog --
give me a day or so and I can track it down. But briefly, he claimed --
and I somewhat agree -- that there are two broad classes of language.
Why should learning languages that are somewhat similar but with some
differences, not help you grow? (challenge:-) E.g, Case in point:
Python and Ruby.
Post by M. Edward (Ed) Borasky
There's the "Algol Family", into which class C/C++, Java, Python, Ruby,
Perl, etc. fall, and there's the "Lisp Family". If you're like most of
us, you spend most of your time in the Algol family. His point was that
you grow more if you learn a Lisp family language than if you learn
another Algol family language.
1. Macro assemblers
2. Algol
3. Lisp
4. APL
5. Forth
6. Smalltalk
You forgot Prolog-style languages - which are different from Lisp. I'm
not a language lawyer or expert, but have checked both those out a bit,
and I do feel that the programming paradigm in Prolog is different from
Lisp. Can't speak from a theoretical standpoint (e.g. some Lispers may
say that Prolog is in the same family as Lisp), and if I remember, Paul
Graham's On Lisp or some other Lisp book has an implementation of
Prolog in Lisp - though that may not be against my point that Prolog is
a different family than Lisp).
Post by M. Edward (Ed) Borasky
Ruby, I'll give it a shot. And there are language-specific IDEs for
Ruby. But don't *real* programmers use Emacs?
<ducking>
I was quite skilled at vi before vim came out, and managed very well
with that, though I'm aware (now) that vim has lots more features, and
am slowly checking them out.

A couple of times I've heard people (newbies mostly) mutter "magic..."
to themselves, standing behind me and watching me type code .... ;-)
Nothing special about it - just years of typing .... I'm sure many
others are the same .......

Vasudev Ram
http://www.dancingbison.com
http://www.geocities.com/vasudevram
http://sourceforge.net/projects/xtopdf
Post by M. Edward (Ed) Borasky
Actually, I've never bothered to learn Emacs. It had a (justified)
reputation as a memory hog, so I learned vi. I'm pretty sure GNU Emacs
is no longer a memory hog, but I'm so firmly down the "vim" path that
Emacs seems like a distraction.
--
M. Edward (Ed) Borasky
http://linuxcapacityplanning.com
d***@wobblini.net
2006-07-08 15:11:13 UTC
Permalink
Hi --
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
I can give you the answer in my case: love. I fell in love with the
Ruby language, and subsequently with the Ruby culture and community.
That gives you a much more lucid, rigorous account of my experience
than anything I can say about blocks, significant whitespace, or other
language features possibly could.


David
--
"To fully realize the potential of Rails, it's crucial that you take
the time to fully understand Ruby--and with "Ruby for Rails" David
has provided just what you need to help you achieve that goal."
-- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at http://www.manning.com/black!
r***@gmail.com
2006-07-09 04:40:17 UTC
Permalink
I love Ruby because I can do this:

class Integer
def even?
( self % 2 ) == 0
end
end

puts 3.even?
puts 28.even?

-R
"Quis custodiet ipsos custodes?"
Post by d***@wobblini.net
Hi --
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
I can give you the answer in my case: love. I fell in love with the
Ruby language, and subsequently with the Ruby culture and community.
That gives you a much more lucid, rigorous account of my experience
than anything I can say about blocks, significant whitespace, or other
language features possibly could.
David
--
"To fully realize the potential of Rails, it's crucial that you take
the time to fully understand Ruby--and with "Ruby for Rails" David
has provided just what you need to help you achieve that goal."
-- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at http://www.manning.com/black!
Elliot Temple
2006-07-09 04:49:20 UTC
Permalink
Post by r***@gmail.com
class Integer
def even?
( self % 2 ) == 0
end
end
puts 3.even?
puts 28.even?
I don't know if that's possible in Python, but apparently I can't
guess how to do it based on a little previous Python usage:

irb(main):037:0> quit
curi-g5:~ curi$ python
Python 2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Post by r***@gmail.com
Post by r***@gmail.com
Integer
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'Integer' is not defined
Post by r***@gmail.com
Post by r***@gmail.com
3
3
Post by r***@gmail.com
Post by r***@gmail.com
3.methods
File "<stdin>", line 1
3.methods
^
SyntaxError: invalid syntax
Post by r***@gmail.com
Post by r***@gmail.com
3.x = 4
File "<stdin>", line 1
3.x = 4
^
SyntaxError: invalid syntax
Post by r***@gmail.com
Post by r***@gmail.com
x = 3
x.x = 4
Traceback (most recent call last):
File "<stdin>", line 1, in ?
AttributeError: 'int' object has no attribute 'x'
Post by r***@gmail.com
Post by r***@gmail.com
quit
'Use Ctrl-D (i.e. EOF) to exit.'
curi-g5:~ curi$ irb
irb(main):001:0>

I may have typed "quit" on purpose. *ducks*

-- Elliot Temple
http://www.curi.us/blog/
Elliot Temple
2006-07-09 05:22:12 UTC
Permalink
Post by Elliot Temple
Post by r***@gmail.com
class Integer
def even?
( self % 2 ) == 0
end
end
puts 3.even?
puts 28.even?
I don't know if that's possible in Python, but apparently I can't
<snip>
Post by Elliot Temple
Post by r***@gmail.com
list.x = 5
Traceback (most recent call last):
File "<stdin>", line 1, in ?
TypeError: can't set attributes of built-in/extension type 'list'


-- Elliot Temple
http://www.curi.us/blog/
Marcelo
2006-07-10 12:35:06 UTC
Permalink
In Python you have to sub-class int:

class MyInteger(int):
def is_even(self):
return (self % 2) == 0

a = MyInteger(3)
a.is_even() -> False
a = MyInteger(4)
a.is_even() -> True

It's not the same as in Ruby, I can see that, but it is very posible.
Post by r***@gmail.com
class Integer
def even?
( self % 2 ) == 0
end
end
puts 3.even?
puts 28.even?
-R
"Quis custodiet ipsos custodes?"
k***@enigo.com
2006-07-08 15:26:13 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
RoR is irrelevant to it.

Ruby is love.
Python is bondage.

I choose love.


Kirk Haines
M. Edward (Ed) Borasky
2006-07-08 17:10:10 UTC
Permalink
Post by k***@enigo.com
RoR is irrelevant to it.
Ruby is love.
Python is bondage.
Uh ... love ... bondage ... uh ... never mind

<ducking>
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Christian Neukirchen
2006-07-09 13:34:41 UTC
Permalink
Post by k***@enigo.com
Ruby is love.
Python is bondage.
I choose love.
Vanilla!

SCNR.
Post by k***@enigo.com
Kirk Haines
--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
James Britt
2006-07-08 15:48:56 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
The Ruby community is better-looking.
--
James Britt

"The use of anthropomorphic terminology when dealing with
computing systems is a symptom of professional immaturity."
- Edsger W. Dijkstra
Jamey Cribbs
2006-07-08 16:06:34 UTC
Permalink
Post by James Britt
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
The Ruby community is better-looking.
And more modest.
Robin Stocker
2006-07-08 16:21:05 UTC
Permalink
Post by Jamey Cribbs
Post by James Britt
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
The Ruby community is better-looking.
And more modest.
And more funny. :)
Meino Christian Cramer
2006-07-08 16:25:51 UTC
Permalink
From: Robin Stocker <***@nibor.org>
Subject: Re: Why Ruby over Python?
Date: Sun, 9 Jul 2006 01:21:05 +0900
Post by Robin Stocker
Post by Jamey Cribbs
Post by James Britt
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
The Ruby community is better-looking.
And more modest.
And more funny. :)
And has shorter answers. ;)))
Troy Denkinger
2006-07-08 17:02:49 UTC
Permalink
As a longtime Perler, I dislike Python's significant whitespace. That's why
I could never go for it. Ruby just feels right to me. I enjoy writing it
and it feels liberating when I do.

I still like Perl, but Ruby is quickly winning me over.
Xavier Noria
2006-07-08 17:24:37 UTC
Permalink
Post by Troy Denkinger
As a longtime Perler, I dislike Python's significant whitespace.
That's why
I could never go for it. Ruby just feels right to me. I enjoy writing it
and it feels liberating when I do.
I still like Perl, but Ruby is quickly winning me over.
Let's be clear about this, though: people *are* allowed to like and
use more than one language :-) This is a point that sometimes gets
obscured in these "winner-take-all" language comparison discussions.
Indeed, I am a dynamic languages enthusiast. Perl specialist by
historical accident, that's the one I learned the firt. But very
happy to code in either Python or Ruby. My Perl module Acme::Pythonic
is kind of a joke about these "dualities".

-- fxn
s***@gmail.com
2006-07-08 19:35:08 UTC
Permalink
I got into Ruby because of Rails. I like Ruby because of the
readability, funcitonality, and object oriented approach not to mention
the integration with Rails. Perl is great and has a bunch of
packages/support because its been around a bit longer. I just finished
reading David Black's book about RoR and it increased my interest in
Ruby considerably. I guess to sum it up... less headache's >_<

_Steve
d***@wobblini.net
2006-07-08 17:08:38 UTC
Permalink
Hi --
Post by Troy Denkinger
As a longtime Perler, I dislike Python's significant whitespace. That's why
I could never go for it. Ruby just feels right to me. I enjoy writing it
and it feels liberating when I do.
I still like Perl, but Ruby is quickly winning me over.
Let's be clear about this, though: people *are* allowed to like and
use more than one language :-) This is a point that sometimes gets
obscured in these "winner-take-all" language comparison discussions.


David
--
"To fully realize the potential of Rails, it's crucial that you take
the time to fully understand Ruby--and with "Ruby for Rails" David
has provided just what you need to help you achieve that goal."
-- DAVID HEINEMEIER HANSSON, in the foreword to RUBY FOR RAILS.
Complete foreword & sample chapters at http://www.manning.com/black!
James Britt
2006-07-08 19:22:22 UTC
Permalink
Hi --
Post by Troy Denkinger
As a longtime Perler, I dislike Python's significant whitespace.
That's why
I could never go for it. Ruby just feels right to me. I enjoy writing it
and it feels liberating when I do.
I still like Perl, but Ruby is quickly winning me over.
Let's be clear about this, though: people *are* allowed to like and
use more than one language :-) This is a point that sometimes gets
obscured in these "winner-take-all" language comparison discussions.
Don't be a party pooper.

Next thing you know, people will start thinking it's OK to like and use
more than one Web framework, or more than one editor, or more than one OS.

And what fun would that be?
--
James Britt

"You harmonize; then you customize."
- Wilson Pickett
M. Edward (Ed) Borasky
2006-07-08 19:29:20 UTC
Permalink
Post by James Britt
Hi --
Post by Troy Denkinger
As a longtime Perler, I dislike Python's significant whitespace.
That's why
I could never go for it. Ruby just feels right to me. I enjoy writing it
and it feels liberating when I do.
I still like Perl, but Ruby is quickly winning me over.
Let's be clear about this, though: people *are* allowed to like and
use more than one language :-) This is a point that sometimes gets
obscured in these "winner-take-all" language comparison discussions.
Don't be a party pooper.
Next thing you know, people will start thinking it's OK to like and
use more than one Web framework, or more than one editor, or more than
one OS.
And what fun would that be?
Wait a minute ... there's *another* OS? This changes *everything*!
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Doug H
2006-07-08 17:10:09 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Go ask this same question over on comp.lang.python and you'll see why
you might prefer ruby.
j***@gmail.com
2006-07-11 15:00:06 UTC
Permalink
Post by Doug H
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Go ask this same question over on comp.lang.python and you'll see why
you might prefer ruby.
Funny you ask:
http://groups.google.ca/group/comp.lang.python/tree/browse_frm/thread/40d8d11e12cb00ba/12306d4d9b0ce50c?rnum=11&q=ruby+or+python&_done=%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2F40d8d11e12cb00ba%2F7256adbbc7f79afe%3Fq%3Druby+or+python%26rnum%3D1%26#doc_74bfb0743eff1367

Jean-Marc
Stefan Lang
2006-07-11 21:34:16 UTC
Permalink
Post by j***@gmail.com
Post by Doug H
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead
of python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Go ask this same question over on comp.lang.python and you'll see
why you might prefer ruby.
http://groups.google.ca/group/comp.lang.python/tree/browse_frm/thre
ad/40d8d11e12cb00ba/12306d4d9b0ce50c?rnum=11&q=ruby+or+python&_done=
%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2F40d8d11e12cb00ba
%2F7256adbbc7f79afe%3Fq%3Druby+or+python%26rnum%3D1%26#doc_74bfb0743
eff1367
Interesting. Someone there said that Python is more like Java
and Ruby is more like Smalltalk. I've never written any
Smalltalk, but I know some Lisp. IMO, Ruby and Python are both
somewhere between Lisp and Java, Python closer to Java, Ruby
closer to Lisp.

I have learned many programming languages in the last two years
and the ones I like most are Ruby, Lisp and Haskell. There is one
thing these three languages have in common: It's easy and natural
to construct domain specific languages in them, allowing you
to write code that expresses more directly the problem at hand.

Consider Rake/Rant syntax:

task :a do
...
end

task :b => :a do
...
end

Or a well known (in the Haskell community) DSL in Haskell
is Parsec; an example from the Haskell wiki:

parseInput = do
dirs <- many dirAndSize
eof
return dirs

data Dir = Dir {dir_size::Integer, dir_name::String} deriving Show

dirAndSize = do
size <- many1 digit
spaces
dir_name <- anyChar `manyTill` newline
return (Dir (read size) dir_name)

Of course, Lisp is *the* language for DSL construction.

Python, and more so Java do not allow you to construct a DSL.
Thus in Python and Java, on the syntax level you are always
limited to the few constructs the language provides: Defining
classes and methods, constructing objects, calling methods,
arithmetic expressions, branches via if/else, switch/case.
This gets more limiting the bigger a project grows. Java people
compensate this via huge frameworks that interpret XML files.

Ruby's design is also more coherent than Python's. One example
where Python really f****d up are properties. Python's properties
are an ugly mess, just IMO.

If you already know Java/C#/C++, you'll gain much more in
learning Ruby than Python.
--
Stefan
Mark Volkmann
2006-07-11 21:50:32 UTC
Permalink
Post by Stefan Lang
Post by j***@gmail.com
Post by Doug H
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead
of python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Go ask this same question over on comp.lang.python and you'll see
why you might prefer ruby.
http://groups.google.ca/group/comp.lang.python/tree/browse_frm/thre
ad/40d8d11e12cb00ba/12306d4d9b0ce50c?rnum=11&q=ruby+or+python&_done=
%2Fgroup%2Fcomp.lang.python%2Fbrowse_frm%2Fthread%2F40d8d11e12cb00ba
%2F7256adbbc7f79afe%3Fq%3Druby+or+python%26rnum%3D1%26#doc_74bfb0743
eff1367
Interesting. Someone there said that Python is more like Java
and Ruby is more like Smalltalk. I've never written any
Smalltalk, but I know some Lisp. IMO, Ruby and Python are both
somewhere between Lisp and Java, Python closer to Java, Ruby
closer to Lisp.
I have learned many programming languages in the last two years
and the ones I like most are Ruby, Lisp and Haskell. There is one
thing these three languages have in common: It's easy and natural
to construct domain specific languages in them, allowing you
to write code that expresses more directly the problem at hand.
task :a do
...
end
task :b => :a do
...
end
I haven't done much with Rake yet, but fortunately I knew that => is
used to indicate that one task depends on another. I wonder how many
people who didn't know Rake would guess that.
Post by Stefan Lang
Or a well known (in the Haskell community) DSL in Haskell
parseInput = do
dirs <- many dirAndSize
eof
return dirs
data Dir = Dir {dir_size::Integer, dir_name::String} deriving Show
dirAndSize = do
size <- many1 digit
spaces
dir_name <- anyChar `manyTill` newline
return (Dir (read size) dir_name)
And this? I don't know Haskell, but I thought if it's a good language
for creating DSLs then I'd at least have a good guess at what the code
does. Unfortunately I don't have a guess here. I think that's a bad
sign. Call me stupid if you'd like.
Post by Stefan Lang
Of course, Lisp is *the* language for DSL construction.
I'd like to see a DSL example in LISP.
Post by Stefan Lang
Python, and more so Java do not allow you to construct a DSL.
Thus in Python and Java, on the syntax level you are always
limited to the few constructs the language provides: Defining
classes and methods, constructing objects, calling methods,
arithmetic expressions, branches via if/else, switch/case.
This gets more limiting the bigger a project grows. Java people
compensate this via huge frameworks that interpret XML files.
Ruby's design is also more coherent than Python's. One example
where Python really f****d up are properties. Python's properties
are an ugly mess, just IMO.
If you already know Java/C#/C++, you'll gain much more in
learning Ruby than Python.
--
Stefan
--
R. Mark Volkmann
Object Computing, Inc.
Stefan Lang
2006-07-12 21:35:38 UTC
Permalink
[...]
Post by Mark Volkmann
Post by Stefan Lang
I have learned many programming languages in the last two years
and the ones I like most are Ruby, Lisp and Haskell. There is one
thing these three languages have in common: It's easy and natural
to construct domain specific languages in them, allowing you
to write code that expresses more directly the problem at hand.
task :a do
...
end
task :b => :a do
...
end
I haven't done much with Rake yet, but fortunately I knew that =>
is used to indicate that one task depends on another. I wonder how
many people who didn't know Rake would guess that.
You have to learn *any* syntax/API. Important is that it's
easy to remember and that you don't have to write unnecessary
code each time you define a task. In Python this would
probably be done like this:

def fun_a():
...

task("a", fun_a)

def fun_b():
...

task("b", "a", fun_b)

Having to define the separate functions fun_a and fun_b
is an unnecessary burden for the programmer. Having to
invent those function names gets tiresome. And I don't
see how that would be any clearer than the Ruby version.
Post by Mark Volkmann
Post by Stefan Lang
Or a well known (in the Haskell community) DSL in Haskell
parseInput = do
dirs <- many dirAndSize
eof
return dirs
data Dir = Dir {dir_size::Integer, dir_name::String} deriving Show
dirAndSize = do
size <- many1 digit
spaces
dir_name <- anyChar `manyTill` newline
return (Dir (read size) dir_name)
And this? I don't know Haskell, but I thought if it's a good
language for creating DSLs then I'd at least have a good guess at
what the code does. Unfortunately I don't have a guess here. I
think that's a bad sign. Call me stupid if you'd like.
Perhaps it wasn't so a good idea to drop these examples
in without any explanation :(

The parseInput function parses lines like this:

65572 /home/adept/photos/raw-to-burn/dir1

This example is from
http://haskell.org/haskellwiki/Hitchhikers_Guide_to_the_Haskell

The important point here is again that if you know basic
Haskell, Parsec provides an easy way to define parsers.
There is no bookkeeping for the Haskell compiler.
Parsec was used for Pugs, the first Perl 6 compiler. So
it seems to work for harder tasks too.
Post by Mark Volkmann
Post by Stefan Lang
Of course, Lisp is *the* language for DSL construction.
I'd like to see a DSL example in LISP.
Taken from "Practical Common Lisp",
http://www.gigamonkeys.com/book/practical-building-a-unit-test-framework.html

Usage of a small unit test framework:

;; Define a test case for the "+" function
(deftest test-+ ()
(check
(= (+ 1 2) 3)
(= (+ 1 2 3) 6)
(= (+ -1 -3) -4)))

;; Another test case for "*"
(deftest test-* ()
(check
(= (* 2 2) 4)
(= (* 3 5) 15)))

;; Test suite for arithmetic functions
(deftest test-arithmetic ()
(combine-results
(test-+)
(test-*)))

;; run the test suite
(test-arithmetic)
pass ... (TEST-ARITHMETIC TEST-+): (= (+ 1 2) 3)
pass ... (TEST-ARITHMETIC TEST-+): (= (+ 1 2 3) 6)
pass ... (TEST-ARITHMETIC TEST-+): (= (+ -1 -3) -4)
pass ... (TEST-ARITHMETIC TEST-*): (= (* 2 2) 4)
pass ... (TEST-ARITHMETIC TEST-*): (= (* 3 5) 15)
T

That "T" in the last lines means that all tests have passsed.
"deftest", "check" and "combine-results" are user defined macros.
The whole "framework" is defined in 26 lines of code.
For my needs, I would tweak it so that the test code is printed
only for tests that failed.

Currently I have to write a Java webapp at work. Writing Java and
loads of XML when you know Lisp and Ruby really hurts.
If Java would provide something like Lisp's macros or some of
Ruby's features (anonymous closures, defining own attr_* methods,
higher order functions, etc.), I'm sure we could reduce the code
size of the project to a quarter or less of the current size.
The same goes for the XML code. Those XML DSLs have a serious
problem. When a certain pattern occurs often in the project and
the framework hasn't a builtin way to factor it out, you're out
of luck. Type it out each time.

In an Rantfile/Rakefile I have the full power of Ruby at hand.
I simply Won't Repeat Myself.
--
Stefan
Christian Neukirchen
2006-07-13 20:47:16 UTC
Permalink
Post by Stefan Lang
Post by Mark Volkmann
Post by Stefan Lang
task :a do
...
end
task :b => :a do
...
end
I haven't done much with Rake yet, but fortunately I knew that =>
is used to indicate that one task depends on another. I wonder how
many people who didn't know Rake would guess that.
You have to learn *any* syntax/API. Important is that it's
easy to remember and that you don't have to write unnecessary
code each time you define a task. In Python this would
...
task("a", fun_a)
...
task("b", "a", fun_b)
Having to define the separate functions fun_a and fun_b
is an unnecessary burden for the programmer. Having to
invent those function names gets tiresome. And I don't
see how that would be any clearer than the Ruby version.
<heretic>
I can think of a syntax that is far easier. ;-)

a:
stuff to do
for a

b: a
stuff to do
for b
</heretic>
--
Christian Neukirchen <***@gmail.com> http://chneukirchen.org
Marcin Mielżyński
2006-07-13 21:40:07 UTC
Permalink
Post by Stefan Lang
Interesting. Someone there said that Python is more like Java
and Ruby is more like Smalltalk. I've never written any
Smalltalk, but I know some Lisp. IMO, Ruby and Python are both
somewhere between Lisp and Java, Python closer to Java, Ruby
closer to Lisp.
Ultimate object orientation, continuations and blocks/closures - the
last is very very smalltalkish ;D

Smalltalk at: #a put: (Array new: 2)!
a at: 1 put: 'some string'.
a at: 2 put: 'some other string'.
a do: [:n| n printNl].

a=[]
a << 'some string'
a << 'some other string'
a.each{|n| n.display}


The similarity is obvious.


lopex

Matt Lawrence
2006-07-08 22:27:43 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
Did you see the lovely young ladies (I hope you know who you are) at the
last RubyConf?

-- Matt
It's not what I know that counts.
It's what I can remember in time to use.
M. Edward (Ed) Borasky
2006-07-09 00:00:25 UTC
Permalink
Post by Matt Lawrence
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
Did you see the lovely young ladies (I hope you know who you are) at
the last RubyConf?
And ... which would *you* give a lovely young lady -- a ruby or a
dangerous reptile?

:)
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Troy Denkinger
2006-07-09 00:35:05 UTC
Permalink
Post by M. Edward (Ed) Borasky
And ... which would *you* give a lovely young lady -- a ruby or a
dangerous reptile?
I got yer snake right heah, baby!
b***@googlemail.com
2006-07-09 21:15:10 UTC
Permalink
Post by M. Edward (Ed) Borasky
Post by Matt Lawrence
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
Did you see the lovely young ladies (I hope you know who you are) at
the last RubyConf?
And ... which would *you* give a lovely young lady -- a ruby or a
dangerous reptile?
:)
I have a friendly pet snake I'm often trying to give to lovely young
ladies. :)
gregarican
2006-07-09 01:55:16 UTC
Permalink
As someone who has used both languages for various projects I would say
that I honestly have more fun programming in Ruby. It fits the way I
think better and therefore is more intuitive than Python IMHO. The
languages are similar in nature and if you learn one then learning the
other shouldn't be too tough. The other external factor (other than
personal experience) is the community. As others have posted the Ruby
community is active, helpful, patient, and funny. Not every language
necessarily can say that...
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Michael Greenly
2006-07-09 02:36:20 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
They are both excellent so you will not be unhappy with either.

The significant whitespace was really the decider for me personally.
--
Posted via http://www.ruby-forum.com/.
James Britt
2006-07-09 03:21:16 UTC
Permalink
Post by Michael Greenly
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
They are both excellent so you will not be unhappy with either.
There are differences in development philosophy among the two
communities, though. For example, both Python and Ruby allow running
code to alter existing classes, including core classes (though I do not
know if they are equivalent in options and effect).

The Python community is likely to look down on this, calling it "monkey
patching." In the Ruby community this is simply one of many techniques
for building applications and is pretty common.

Ultimately the language is yours to use as you please, but it helps to
have a community with a sense of design and development that matches
your own, one that will help you grow in the direction you prefer.
Post by Michael Greenly
The significant whitespace was really the decider for me personally.
Ruby has significant white space, too. But no significant indentation
(or, as I tend to think of it, "static indentation.")
--
James Britt

"A language that doesn't affect the way you think about programming is
not worth knowing."
- A. Perlis
Logan Capaldo
2006-07-09 04:42:26 UTC
Permalink
Post by James Britt
Ruby has significant white space, too. But no significant
indentation (or, as I tend to think of it, "static indentation.")
Significant whitespace in ruby? Perhaps you mean "\n" as a statement
terminator? Are there any other examples?
Bill Kelly
2006-07-09 04:48:20 UTC
Permalink
Post by Logan Capaldo
Post by James Britt
Ruby has significant white space, too. But no significant
indentation (or, as I tend to think of it, "static indentation.")
Significant whitespace in ruby? Perhaps you mean "\n" as a statement
terminator? Are there any other examples?
# ruby -we "puts ('hi')"
-e:1: warning: (...) interpreted as grouped expression
hi


Regards,

Bill
Marcin Mielżyński
2006-07-09 10:25:05 UTC
Permalink
Post by Logan Capaldo
Significant whitespace in ruby? Perhaps you mean "\n" as a statement
terminator? Are there any other examples?
"" +"".to_s +""

which gives syntax error, not undefined +@ for String runtime error ;)

lopex
Michael Greenly
2006-07-11 02:01:29 UTC
Permalink
Post by James Britt
Post by Michael Greenly
The significant whitespace was really the decider for me personally.
Ruby has significant white space, too. But no significant indentation
(or, as I tend to think of it, "static indentation.")
Next you're going to correct me for calling plum... purple?

Fine, significant indention, if that make you feel better.
--
Posted via http://www.ruby-forum.com/.
c***@gmail.com
2006-07-09 04:25:12 UTC
Permalink
Post by h***@gmail.com
2. focus on codes readability, not like Perl
Perl makes it easy to write clear, readable code. Perl also makes it
easy to write incredibly dense, ugly code. Blaming the language for
crappy code is like blaming a bicycle for not having training wheels
welded to the frame.
Actually, one of the reasons why I am looking at Ruby is because it
ieasier on a Perl person like me, as opposed to Python. Plus it is so
much cleaner as an OOP language -- more like Objective C / SmallTalk,
rather than Java/C++.
Minkoo Seo
2006-07-09 07:37:52 UTC
Permalink
Okay, I've attracted to Ruby because of RoR. But, I've learned that Ruby
is much more than that.

1) It supports blocks: I've heard that Python will support this, but I
couldn't find
any explanation regarding that in Python Tutorial.

2) OOP style codes: I hate mentioning self everytime I want to instance
methods.

3) quit: I can quit irb using 'quit'. Python urges me to press CTRL+D though
it knows
that I want to quit.

4) inject: inject is very interesting and powerful. I don't know how python
programmers
are handling the situtation where inject fits.

Sincerely,
Minkoo Seo
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
N***@aol.com
2006-07-09 18:08:12 UTC
Permalink
Has anyone really determined once and for all whether the dinosaurs died
out because they were too large for their environment or because a huge
hunk of rock hit the Yucutan Peninsula? :)
They haven't died out - they're all in the programming business now, so
they're just less visible to some people as they are mainly night-active and pay
the delivered pizzas they live
on using electronic money transactions. Paleontologists think they could
search
for 100 million years old skeletons by day as well.
That explains the worries of non-dinosaurs in the programming business as
well
as the erroneous claims of paleontologists that dinosaurs have died out. :)

Best regards,

Axel
Marcelo
2006-07-10 02:10:05 UTC
Permalink
What about GUI programming?
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
M. Edward (Ed) Borasky
2006-07-10 02:27:59 UTC
Permalink
Post by Marcelo
What about GUI programming?
A Pythonista will immediately counter with, "What about Python/TkInter?" :)
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Marcin Mielżyński
2006-07-10 08:40:05 UTC
Permalink
Post by Marcelo
What about GUI programming?
http://www.trug.ca/Ruby_GUI_Toolkits

lopex
Doug Bromley
2006-07-10 09:20:53 UTC
Permalink
I wrote a blog entry on my experiences of going from one to the other.

http://straw-dogs.co.uk/blog/04/06/the-journey-from-python-to-ruby-pt-1/

You may find it interesting. :)
Marcelo
2006-07-10 12:25:05 UTC
Permalink
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.

Am I wrong? Who is doing GUI development in Ruby and what are they
using? (please, Tk is awful both in Ruby and Python) I think that in
GUI development, Ruby is far behind Python, and that is something that
keeps me from stepping into Ruby.

Any help would be appreciated, and sorry for my English.

Marcelo
gregarican
2006-07-10 12:40:05 UTC
Permalink
You can use Wx, Qt, Fox, and a variety of other standard GUI toolkits
that are used in other programming languages. There's even non-standard
ones such as http://www.widestudio.org. Tk is primitive and just more
of a starter option in my eyes, but it goes allow a newbie to get their
feet under them. Past that there are plenty of other GUI toolkits as
you will find out...
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
Am I wrong? Who is doing GUI development in Ruby and what are they
using? (please, Tk is awful both in Ruby and Python) I think that in
GUI development, Ruby is far behind Python, and that is something that
keeps me from stepping into Ruby.
Any help would be appreciated, and sorry for my English.
Marcelo
Marcelo
2006-07-10 13:25:09 UTC
Permalink
What I wanted to know with my previous post was what are rubyist using
IN PRACTICE NOW. That's to say, what are the GUI toolkits more used
(except Tk)
Post by gregarican
You can use Wx, Qt, Fox, and a variety of other standard GUI toolkits
that are used in other programming languages. There's even non-standard
ones such as http://www.widestudio.org. Tk is primitive and just more
of a starter option in my eyes, but it goes allow a newbie to get their
feet under them. Past that there are plenty of other GUI toolkits as
you will find out...
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
Am I wrong? Who is doing GUI development in Ruby and what are they
using? (please, Tk is awful both in Ruby and Python) I think that in
GUI development, Ruby is far behind Python, and that is something that
keeps me from stepping into Ruby.
Any help would be appreciated, and sorry for my English.
Marcelo
Jon Egil Strand
2006-07-10 13:47:49 UTC
Permalink
Post by Marcelo
What I wanted to know with my previous post was what are rubyist using
IN PRACTICE NOW. That's to say, what are the GUI toolkits more used
(except Tk)
FXRuby - actively maintained by Lyle Johnsen and well enough documented.
--
Jon Egil Strand
Phone: +47 98232340
***@luretanker.no
Marcin Mielżyński
2006-07-10 13:25:24 UTC
Permalink
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.

lopex
M. Edward (Ed) Borasky
2006-07-10 13:38:30 UTC
Permalink
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and
swig interfacing with c++. I had some minor problems with it. As can
be seen from wxruby homepage, it is also under active development.
And if having a well-written tutorial matters, check out the Pragmatic
Programmers' book on QTRuby (with additional info on Korundum and
Kommander).
--
M. Edward (Ed) Borasky

http://linuxcapacityplanning.com
Marcelo
2006-07-10 14:35:07 UTC
Permalink
I would LOVE wxRuby when it is done.

This is the last state, from SourceForge:

Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004

Not as near as wxPython 2.6.3.

It's a shame.
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.
lopex
gregarican
2006-07-10 14:45:06 UTC
Permalink
Have you actually read the feature list of both Wx projects to
determine their completeness? Or are you just basing things on the fact
that the wxRuby project hasn't been updated since late 2004? I wouldn't
always base things solely on revision dates. There are some mature
projects out there that aren't updated on a monthly basis.
Post by Marcelo
I would LOVE wxRuby when it is done.
Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004
Not as near as wxPython 2.6.3.
It's a shame.
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.
lopex
Marcelo
2006-07-10 15:20:10 UTC
Permalink
I also have seen:

http://wxruby.rubyforge.org/wiki/wiki.pl?What_Classes_Are_Implemented_In_Wxruby

especially section: Classes missing in both TODO for wxruby2

I don't know if I have something more to see, so that's why I'm asking.
Post by gregarican
Have you actually read the feature list of both Wx projects to
determine their completeness? Or are you just basing things on the fact
that the wxRuby project hasn't been updated since late 2004? I wouldn't
always base things solely on revision dates. There are some mature
projects out there that aren't updated on a monthly basis.
Post by Marcelo
I would LOVE wxRuby when it is done.
Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004
Not as near as wxPython 2.6.3.
It's a shame.
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.
lopex
gregarican
2006-07-10 16:10:05 UTC
Permalink
After reviewing both sites in terms of their documentation it does
indeed appear that Ruby's Wx implementation lacks a considerable amount
of classes. That taken with your observation that the last release
update was almost two years ago, might place wxRuby down there is the
ranks of GUI toolkit consideration if you are looking for a current and
complete offering.

That narrows things down to Fox, GTK, and Qt. From what I have read and
experienced the Ruby Qt implementation is current and very active. As
in version 4.x. The original Ruby-GNOME project is obsolete and been
replaced with Ruby-GNOME2, which also appears to be current and active.
As in the last revision update being this month. Then as others have
posted, FXRuby is worthy of consideration. It's last revision update
was just a couple of months ago and it is gaining popularity from what
I have seen.

Personally, I haven't used FxRuby but have used Ruby implementations of
GTK and Qt. Of those two to me I felt more comfortable with Qt. Taking
all of the licensing bias aside it just seemed a better fit in terms of
Ruby's OO and mindset. The GTK option just felt more "jammed in" to
make it fit into Ruby's world. Just my feelings using them.
Post by Marcelo
http://wxruby.rubyforge.org/wiki/wiki.pl?What_Classes_Are_Implemented_In_Wxruby
especially section: Classes missing in both TODO for wxruby2
I don't know if I have something more to see, so that's why I'm asking.
Post by gregarican
Have you actually read the feature list of both Wx projects to
determine their completeness? Or are you just basing things on the fact
that the wxRuby project hasn't been updated since late 2004? I wouldn't
always base things solely on revision dates. There are some mature
projects out there that aren't updated on a monthly basis.
Post by Marcelo
I would LOVE wxRuby when it is done.
Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004
Not as near as wxPython 2.6.3.
It's a shame.
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.
lopex
Paul Battley
2006-07-10 16:34:55 UTC
Permalink
Post by gregarican
That narrows things down to Fox, GTK, and Qt.
Although it only works on OS X, RubyCocoa is pretty nice (possibly due
to the Smalltalk influence shared by Ruby and Objective-C). By
contrast, Wx, Fox, GTK and Qt are all pretty horrible on OS X from a
user's perspective.

Paul.
Marcelo
2006-07-10 17:30:10 UTC
Permalink
Very good summary. I'll take a look on Fx and Qt. Thanks.
Post by gregarican
After reviewing both sites in terms of their documentation it does
indeed appear that Ruby's Wx implementation lacks a considerable amount
of classes. That taken with your observation that the last release
update was almost two years ago, might place wxRuby down there is the
ranks of GUI toolkit consideration if you are looking for a current and
complete offering.
That narrows things down to Fox, GTK, and Qt. From what I have read and
experienced the Ruby Qt implementation is current and very active. As
in version 4.x. The original Ruby-GNOME project is obsolete and been
replaced with Ruby-GNOME2, which also appears to be current and active.
As in the last revision update being this month. Then as others have
posted, FXRuby is worthy of consideration. It's last revision update
was just a couple of months ago and it is gaining popularity from what
I have seen.
Personally, I haven't used FxRuby but have used Ruby implementations of
GTK and Qt. Of those two to me I felt more comfortable with Qt. Taking
all of the licensing bias aside it just seemed a better fit in terms of
Ruby's OO and mindset. The GTK option just felt more "jammed in" to
make it fit into Ruby's world. Just my feelings using them.
John Gabriele
2006-07-10 17:22:38 UTC
Permalink
Post by Marcelo
I would LOVE wxRuby when it is done.
Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004
Not as near as wxPython 2.6.3.
It's a shame.
wxRuby2 development was really cooking in May and early June. Work on
it seems to run hot and cold. Note the most recent news on the wxRuby
page:

| "June 12, 2006 Updated information about applications written using wxruby
| added to website. wxRuby2 is close to a release quality - please consider
| downloading from CVS and trying it out."

---John
Post by Marcelo
Post by Marcin Mielżyński
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
The most mature and the most feature-rich is FXRuby. I wrote my master
degree using it. It was quite complex application using opengl and swig
interfacing with c++. I had some minor problems with it. As can be seen
from wxruby homepage, it is also under active development.
lopex
Marcin Mielżyński
2006-07-10 22:35:11 UTC
Permalink
Post by Marcelo
I would LOVE wxRuby when it is done.
Development Status: 4 - Beta
wxRuby 0.6.0 November 21, 2004
Not as near as wxPython 2.6.3.
It's a shame.
The last message at wxruby site is from June 12, 2006 and says that
wxruby2 is close to release quality. So grab the sources and compile it! ;D

lopex
Lyle Johnson
2006-07-10 14:24:16 UTC
Permalink
Post by Marcelo
Oh, yes, I saw that page, but for what I saw, most of them are in early
development or dead. The only one apparently working is the Ruby/Gnome.
Then you've gotten some bad information. FXRuby is a little over five
years old, and FOX (the GUI toolkit it's based on) is at least eight
years old. Both FOX and FXRuby are being actively developed, with a
new major release in the last few months.

You mentioned Ruby/GNOME. There's also the Ruby/Qt bindings, which I
understand to be very good, and wxRuby seems to be coming along very
well.
Post by Marcelo
Am I wrong? Who is doing GUI development in Ruby and what are they
using? (please, Tk is awful both in Ruby and Python) I think that in
GUI development, Ruby is far behind Python, and that is something that
keeps me from stepping into Ruby.
I don't think there's one GUI toolkit that dominates the field. Other
than Ruby/Tk, I get the impression that the "big three" right now are
Ruby/GNOME, Ruby/Qt and FXRuby.
Tim Pease
2006-07-10 19:03:36 UTC
Permalink
1) Ruby groks better than Python ... at least for me.
2) Meta-programming is much, much easier in Ruby than in Python (this
is what makes Rails the dreamboat framework that it is) [did I just
type "dreamboat" - sheez!]
3) Principal of least surprise
3a) In Ruby, when you learn how "each" works for an array you know how
it is going to work for every other object
3b) In Python I find myself continually looking through the documentation
4) Matz answers questions on the ruby-talk mailing list -- I'm not
saying Guido does not answer questions on the Python mailing lists,
it's just cool that Matz takes the time to listen and help out the
community on top of everything else he does

What I do like about Python is how the documentation is built right
into the language. That is the biggest feature I wish Ruby had. That
and Python's speed -- long live YARV.

Blessings,
Tim Pease
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
John Gabriele
2006-07-10 19:14:19 UTC
Permalink
[snip]
What I do like about Python is how the documentation is built right
into the language. That is the biggest feature I wish Ruby had. That
and Python's speed -- long live YARV.
Well, we've got rdoc. What specific python doc feature do you miss?
Maybe being able to type "help( some_obj.some_method )" at the
interactive prompt?

Personally, I didn't like the Python way of putting doc strings
*below* the thing they were documenting... always seemed upside-down.
Tim Pease
2006-07-10 19:45:15 UTC
Permalink
Hi John,
Post by John Gabriele
Well, we've got rdoc. What specific python doc feature do you miss?
Maybe being able to type "help( some_obj.some_method )" at the
interactive prompt?
Personally, I didn't like the Python way of putting doc strings
*below* the thing they were documenting... always seemed upside-down.
Coming to Ruby from Python, that was the first thing I said to myself:
"I wish documentation were 'built in' like Python". Rdoc is great,
and I use it everywhere now, so my documentation desire is met. But I
had to say that I missed something from Python ;) No other Python
specific features come to mind that I miss.

I'm blessed right now to be coding Ruby full time for my job. We're
writing tools to test the avionics for the Kepler Space telescope --
this involves generating 110 mega-pixel test images, running them
through the avionics, and then verifying that none of the pixels got
lost or mangled.

The flexibility of Ruby has allowed me to
1) write C code for the parts that need to be fast
2) write Ruby code for the parts that the users want to change all the time
3) use meta-programming to write some DSL syntax so the test engineers
can write their own image generation and validation scripts
4) rake to deploy everything -- I'm amazed no one has mentioned rake yet
5) gems to distribute everything -- another one I'm amazed no one has mentioned

Oh, and the Ruby community is just awesome ... thanks to

Matz - for writing this thing
Guy Decoux - for the mmap library
Jim Weirich - for rake and gems
Ara Howard - for all the awesome answers about threads and numeric
coputing with Ruby
Mauricio - rcov makes our Software Quality Engineers happy
howachen - for this fun thread :)

Blessings,
Tim Pease

PS We should have an official "Thank Matz" day. Send him money, or
an Apple iCard, or write a Ruby program that is a haiku and actually
parses and runs -- hmmm ... Ruby Haiku day for Matz
Mat Schaffer
2006-07-10 20:07:36 UTC
Permalink
Post by Tim Pease
PS We should have an official "Thank Matz" day. Send him money, or
an Apple iCard, or write a Ruby program that is a haiku and actually
parses and runs -- hmmm ... Ruby Haiku day for Matz
You really caught me with that Ruby Haiku concept. I started working
on it, but the last line is really tricky to get up to five syllables
and still be meaningful. It's an odd downside to ruby's terse syntax.

Maybe I'll put a page for ruby Haiku on http://wiki.rubygarden.org/
Ruby/page/show/RubyFun once I come up with something :)
-Mat
a***@noaa.gov
2006-07-10 20:25:36 UTC
Permalink
Post by Tim Pease
PS We should have an official "Thank Matz" day. Send him money, or
an Apple iCard, or write a Ruby program that is a haiku and actually
parses and runs -- hmmm ... Ruby Haiku day for Matz
You really caught me with that Ruby Haiku concept. I started working on it,
but the last line is really tricky to get up to five syllables and still be
meaningful. It's an odd downside to ruby's terse syntax.
Maybe I'll put a page for ruby Haiku on http://wiki.rubygarden.org/
Ruby/page/show/RubyFun once I come up with something :)
harp:~ > cat a.rb

raise :the, :red_flag unless :weak

throw :fear while :people and not :truth

:dove and :hawk while :death

harp:~ > ruby a.rb
(infinite loop on last line)


-a
--
suffering increases your inner strength. also, the wishing for suffering
makes the suffering disappear.
- h.h. the 14th dali lama
Tim Pease
2006-07-10 20:38:09 UTC
Permalink
Okay, that made me smile :)
Post by a***@noaa.gov
You really caught me with that Ruby Haiku concept. I started working on it,
but the last line is really tricky to get up to five syllables and still be
meaningful. It's an odd downside to ruby's terse syntax.
Maybe I'll put a page for ruby Haiku on http://wiki.rubygarden.org/
Ruby/page/show/RubyFun once I come up with something :)
harp:~ > cat a.rb
raise :the, :red_flag unless :weak
throw :fear while :people and not :truth
:dove and :hawk while :death
harp:~ > ruby a.rb
(infinite loop on last line)
if :love == :pain
then raise ArgumentError
else print 'happy' end


And you have to read == and "equals" for the haiku to work

TwP
Mat Schaffer
2006-07-10 21:14:15 UTC
Permalink
Post by a***@noaa.gov
Post by Mat Schaffer
Post by Tim Pease
PS We should have an official "Thank Matz" day. Send him money, or
an Apple iCard, or write a Ruby program that is a haiku and actually
parses and runs -- hmmm ... Ruby Haiku day for Matz
You really caught me with that Ruby Haiku concept. I started
working on it,
but the last line is really tricky to get up to five syllables and still be
meaningful. It's an odd downside to ruby's terse syntax.
Maybe I'll put a page for ruby Haiku on http://
wiki.rubygarden.org/ Ruby/page/show/RubyFun once I come up with
something :)
harp:~ > cat a.rb
raise :the, :red_flag unless :weak
throw :fear while :people and not :truth
:dove and :hawk while :death
harp:~ > ruby a.rb
(infinite loop on last line)
That 'while' was the inspiration I needed. I was also trying to play
on the "Thank Matz day" idea and do something a little useful.

for i in "Matz" do
print "Thank you #{i}, ruby rocks."
end while :happiness

-Mat
Steve Martin
2006-07-12 09:23:55 UTC
Permalink
Post by Mat Schaffer
Post by a***@noaa.gov
Post by Mat Schaffer
meaningful. It's an odd downside to ruby's terse syntax.
:dove and :hawk while :death
harp:~ > ruby a.rb
(infinite loop on last line)
That 'while' was the inspiration I needed. I was also trying to play
on the "Thank Matz day" idea and do something a little useful.
for i in "Matz" do
print "Thank you #{i}, ruby rocks."
end while :happiness
-Mat
I had to add my own, > cat haiku.rb:

since = "Ruby is king"
puts "Perl and Python way down"
raise "Matz up" if 'agreed'

Yea, it throws a runtime error, but I liked the poetry.
--
Posted via http://www.ruby-forum.com/.
Mat Schaffer
2006-07-12 13:16:57 UTC
Permalink
Post by Steve Martin
since = "Ruby is king"
puts "Perl and Python way down"
raise "Matz up" if 'agreed'
Yea, it throws a runtime error, but I liked the poetry.
Looks like 6 syllables in the last line to me. You forgot to throw
it through Test::Unit::Haiku :)

Feel free to put it on: http://wiki.rubygarden.org/Ruby/page/show/
RubyHaiku
once you get that last line tweaked.

-Mat
Tim Hammerquist
2006-07-10 22:50:09 UTC
Permalink
The one thing that sticks in my craw about Ruby is that
File::Separator is a forward-slash ('/') on Windows. This is just
wrong, and it means I have to replace the slashes with back-slashes
manually before passing file paths to command-line programs. If you
pass a Windows program a path like /some/path, the program will try
to interpret path elements as switches. It's almost the equivalent
of having File::Separator be a hyphen ('-') on Unix.
Aside from the obvious argument that making filesep '\' in DOS was the
first mistake, I'm curious what command-line programs are useful
enough that you shell out from the language you're writing in?

Tim Hammerquist
gregarican
2006-07-11 00:40:11 UTC
Permalink
For me it's not so much the shelling out as it is invoking some Ruby
methods that deal with files, directories, etc. or trying to use a
setup.rb Ruby routine that is trying to parse through the Windows
directory structure. Unfortunately some Ruby projects are still
maintained with a Linux focus and the support for Windows is lacking. I
have tried to manually "rig" fixes so that they can work with my
Windows platform but after an hour or so of futile effort I just switch
over to a Python alternative that does the same thing. Examples are
LDAP, Qt, and a few others. This was about a year ago so things might
have improved since then. YMMV...
Post by Tim Hammerquist
The one thing that sticks in my craw about Ruby is that
File::Separator is a forward-slash ('/') on Windows. This is just
wrong, and it means I have to replace the slashes with back-slashes
manually before passing file paths to command-line programs. If you
pass a Windows program a path like /some/path, the program will try
to interpret path elements as switches. It's almost the equivalent
of having File::Separator be a hyphen ('-') on Unix.
Aside from the obvious argument that making filesep '\' in DOS was the
first mistake, I'm curious what command-line programs are useful
enough that you shell out from the language you're writing in?
Tim Hammerquist
brad tilley
2006-07-12 13:31:27 UTC
Permalink
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
This may be a trivial reason to most people, but it makes a huge
difference to me. I find it _much_ easier to turn .rb scripts into
standalone .exe executbales on Windows. I've used Python's py2exe and it
works OK, but Ruby's rubyscript2exe is far better and far easier to use.

I wish Ruby had more Win32 native libraries (like Python), but I can use
win32API and win32ole for most purposes. And, Ruby is catching up with
better library support.

Also, I've written a lot of py code and ruby code, and I can say that I
like them both, but in general ruby is more flexible and thus more
enjoyable for me personally.
--
Posted via http://www.ruby-forum.com/.
John Gabriele
2006-07-12 13:51:17 UTC
Permalink
Admin -
having trouble unsubscribing from this list,
where/how do I send unsubscribe message?
Thanks
If you have a question, send e-mail with the body
"help" (without quotes) to the address ruby-talk-***@ruby-lang.org;
help=<mailto:ruby-talk-***@ruby-lang.org?body=help>
David Mullet
2006-07-12 14:17:24 UTC
Permalink
Post by brad tilley
This may be a trivial reason to most people, but it makes a huge
difference to me. I find it _much_ easier to turn .rb scripts into
standalone .exe executbales on Windows. I've used Python's py2exe and it
works OK, but Ruby's rubyscript2exe is far better and far easier to use.
I absolutely agree! Erik Veenstra's done a fantastic job developing,
maintaining, documenting, and supporting Tar2Rubyscript and
Rubyscript2Exe, and that's a major reason why I am developing more apps
in Ruby than in Python (with which I have more experience).

Mully
--
Posted via http://www.ruby-forum.com/.
Jamal Mazrui
2006-07-12 14:45:04 UTC
Permalink
Post by brad tilley
This may be a trivial reason to most people, but it makes a huge
difference to me. I find it _much_ easier to turn .rb scripts into
standalone .exe executbales on Windows. I've used Python's py2exe and
it
Post by brad tilley
works OK, but Ruby's rubyscript2exe is far better and far easier to
use.

I beg to differ. py2exe can create stand-alone executables that run the
bundled files from memory, without having to extract them to disk. As
pre-compiled byte code, execution is also faster than with source code
that has to be initially interpreted. I appreciate the work that went
into rubyscript2exe, but was dismayed to discover how many temporary
files it extracted, some of them unnecessary to my program, and some
duplicated among themselves in deeper subfolders of my Windows temporary
folder. Also, since the Ruby interpreter is then run from a temporary
folder rather than the application folder, it makes managing
configuration information more difficult.

Jamal
b***@yahoo.com
2006-07-12 16:30:06 UTC
Permalink
newbie asks: is it true that python does NOT support containers simply
like ruby does?
ie.
a=[]<< an array container
a<<[0,1,2]
a<<{"me"=>"i think","you"=>"you think"}
and then use .each iterater to process this container....
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
gregarican
2006-07-12 17:50:06 UTC
Permalink
Python indeed doesn't have an #each method to iterate over a container
class and pass the elements into a block as is the case with Ruby. I
think this is because Ruby borrowed from Smalltalk with the do, block,
each, etc. aspects of the language. And Python did not.

There is a next( ) method in Python that will advance to the next
element of a container class. Here's a reference -->
http://docs.python.org/lib/typeiter.html. From there you could _sort
of_ create your own block using Python lambdas to mimic things to a
point...
Post by b***@yahoo.com
newbie asks: is it true that python does NOT support containers simply
like ruby does?
ie.
a=[]<< an array container
a<<[0,1,2]
a<<{"me"=>"i think","you"=>"you think"}
and then use .each iterater to process this container....
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Marcelo
2006-07-12 21:20:11 UTC
Permalink
I don't know what you mean "simply". Here goes the code:

a = []
a += [1, 2, 3]
# if you would append the list instead of three numbers,
# it would be a.append([1, 2, 3])
a.append({"me": "i think", "you": "you think"})

for i in a:
print i

That's all.

Marcelo
Post by b***@yahoo.com
newbie asks: is it true that python does NOT support containers simply
like ruby does?
ie.
a=[]<< an array container
a<<[0,1,2]
a<<{"me"=>"i think","you"=>"you think"}
and then use .each iterater to process this container....
Post by h***@gmail.com
Besides ROR, can you give me a reason why perfer ruby instead of
python?
seems to many users, they are very similar in nature...
such as
1. non C or Java style syntax
2. focus on codes readability, not like Perl
3. ..
Continue reading on narkive:
Loading...