perspective on ruby

R

RK

I apologize if this is a stupid question, I'm asking Python group for
perspective on Ruby, but I don't see how the alternative of going to a
ruby group for a perspective on Ruby is going to do me any good...

I just unpacked and tried out InstantRails, after turning off the
local Plone stack.

Looking over the IR stack, making the required hacks to the examples,
looking at all it's pieces(including some of the more powerful PHP
support mixed in), looking at the shipped examples, I had to marvel
again at how far behind these folks are compared to something like
Zope. They are 10 years behind an integrated platform like that.

I just don't get it. The scripted object-oriented clean programming
language is done.

I'm more than willing to supprt RoR if it's being sold as the popular
alternative to .NET programming, which it is in some CS curriculum
(where Java being thrown out).

But, all those "END"s are getting on my nerves.

Thx
 
B

BartlebyScrivener

RK,

I always liked this Martelli post, which I found by searching on Ruby
early on when I was still trying to decide to learn Python or Ruby. For
a mere hobbyist doing both is out of the question:

http://groups.google.com/group/comp.lang.python/msg/28422d707512283

If you want more just search on "ruby" in comp.lang.python or "python"
in comp.lang.ruby

That should cover it.

rick

"A language is a dialect with an army and navy." --Max Weinrich
 
E

Edward Elliott

RK said:
I just don't get it. The scripted object-oriented clean programming
language is done.

Nothing's ever done except LISP. There's always room for experimentation
and improvement.
I'm more than willing to supprt RoR if it's being sold as the popular
alternative to .NET programming, which it is in some CS curriculum
(where Java being thrown out).

Switching to Java for CS was a tremendous blunder. Students need to
understand low-level resource management. They need to learn to think in
more than 1 programming paradigm that shoehorns everything into objects
(ok, java has generics now. if you squint really hard. sort of). One
course in C++ doesn't cut it, the curriculum should either use different
languages fitted to each task or emphasize a single language with broad
abilities (picking the best programming model for each task). Java is
piss-poor for most undergraduate classes (I've taught several). C++ isn't
perfect but it is pretty good, warts and all (some warts make good learning
experiences).

Note that I'm talking about teaching languages. Outside the classroom my
choices would be completely different.

Sorry, I don't know anything about Ruby on Rails. :) The fact that even
numeric literals are objects make me suspicious of Ruby as a
general-purpose language though.
 
P

Peter Otten

Edward said:
The fact that even numeric literals are objects make me suspicious of Ruby
as a general-purpose language though.
43

Just in case you didn't know...

Peter
 
E

Edward Elliott

Peter said:
Just in case you didn't know...

True enough, but I don't often see Python code treating numbers as objects.
In Ruby it's right in the tutorials. Which may be fine; I'm not
discounting Ruby, I'm just cautious.
 
A

Alex Martelli

Edward Elliott said:
course in C++ doesn't cut it, the curriculum should either use different
languages fitted to each task or emphasize a single language with broad
abilities (picking the best programming model for each task). Java is

The only "single language" I could see fitting that role is Mozart,
deliberately designed to be SUPER-multi-paradigm -- not even Lisp and
Scheme (the only real competition) can compare.

While Mozart appears cool, I really think that a wider variety of
languages would help -- some machine code (possibly abstract a la
Mixal), C (a must, *SO* much is written in it!), at least one of C++, D,
or ObjectiveC, either Scheme or Lisp, either *ML or Haskell, either
Python or Ruby, and at least one "OOP-only" language such as Java, C#,
Eiffel, or Smalltalk. For a tipycal CS bachelor course, a set of over
half a dozen languages might be overkill, admittedly (particularly
because these are just the "general purpose" languages -- you no doubt
also want to present XML and friends, possibly XSLT, definitely SQL, and
several other *special*-purpose language classes, too....!!!); too much
time would end up devoted to semirelevant syntax differences...
Note that I'm talking about teaching languages. Outside the classroom my
choices would be completely different.

Absolutely, I'm thinking about CS courses specifically -- for science
and engineering courses, I'd have much different sets (yes, Virginia,
there ARE fields where you still absolutely need to know Fortran!-), for
humanities and soft-sciences other ones yet, and the real world is a
different (and frightening;-) sort of place!-)


Alex
 
E

Edward Elliott

Alex said:
The only "single language" I could see fitting that role is Mozart,
deliberately designed to be SUPER-multi-paradigm -- not even Lisp and
Scheme (the only real competition) can compare.

Don't know Mozart. After 5 minutes of googling, it looks like strictly a
high-level language. Features like network transparency are jumping the
gun for undergrads. But it has potential.
While Mozart appears cool, I really think that a wider variety of
languages would help -- some machine code (possibly abstract a la
Mixal), C (a must, *SO* much is written in it!), at least one of C++, D,
or ObjectiveC, either Scheme or Lisp, either *ML or Haskell, either
Python or Ruby, and at least one "OOP-only" language such as Java, C#,
Eiffel, or Smalltalk.

Yeah I agree that more is better. The problem is using a new language
every couple courses without bogging down in implementation details.
Personally I'd just say "Here's a book, learn it yourself". It's what they
gotta do on the job anyway.
> For a tipycal CS bachelor course, a set of over
half a dozen languages might be overkill, admittedly (particularly
because these are just the "general purpose" languages -- you no doubt
also want to present XML and friends, possibly XSLT, definitely SQL, and
several other *special*-purpose language classes, too....!!!); too much
time would end up devoted to semirelevant syntax differences...

Here's where I disagree. XML? Conceptually (and more elegantly) covered
as LISP s-expressions. XSLT? Just a bastardized spawn of Prolog. SQL
will be covered in databases. My problem with most domain-specific
languages is 1) they're usually too applied for a teaching environment and
2) they're easy to pick up once you master general programming concepts.
The one exception that's really invaluable is regular expressions, but
those are universal enough they get covered elsewhere.
Absolutely, I'm thinking about CS courses specifically -- for science
and engineering courses, I'd have much different sets (yes, Virginia,
there ARE fields where you still absolutely need to know Fortran!-), for
humanities and soft-sciences other ones yet, and the real world is a
different (and frightening;-) sort of place!-)

Yep, I hate how schools lump the CS majors and science majors into one
intro programming course. They both need to learn basic programming
concepts, but the majors need to understand implementation while the
non-majors need productivity. I'd put the majors on something like C and
the non-majors on Python (or Fortran if need be). But that won't fly
because non-majors who convert would have to retake the class. So maybe
put them both on Python and switch languages for the second course.
Rougher for the majors, but there's little reason for non-majors to know
C/C++/Java/Pascal. Scheme is an interesting option, I'm not sure how that
would work out.
 
L

Lawrence D'Oliveiro

Edward Elliott said:
The fact that even
numeric literals are objects make me suspicious of Ruby as a
general-purpose language though.

Isn't Python going that way?
 
D

Dave Benjamin

The only "single language" I could see fitting that role is Mozart,
deliberately designed to be SUPER-multi-paradigm -- not even Lisp and
Scheme (the only real competition) can compare.

I agree that Mozart/Oz is probably the most ambitiously multi-paradigm
language out there, and anyone interested in some real mind expansion
should really check out the excellent book, "Concepts, Techniques, and
Models of Computer Programming" by Peter Van Roy and Seif Haridi.

However, my impression of Mozart/Oz so far can be summed up like this:
"You can have any paradigm you want, as long as it's concurrent". The
degree to which out-parameters are used (in the form of "dataflow
variables") is very unusual for OO or FP, and this is a source of both
amazement and confusion for me. It's clearly possible to program in many
styles, but you still need to adapt your thinking to the Mozart way.

Also worth a mention is Alice ML, which runs on the Mozart system but is
statically typed, type-inferred, very similar to SML but with concurrency
support (lazies and futures), typesafe marshalling, and "packages", which
allow for dynamically-typed interfaces between modules.
 
L

Lawrence D'Oliveiro

Edward Elliott said:
XML? Conceptually (and more elegantly) covered
as LISP s-expressions.

"...Lisp is still #1 for key algorithmic techniques such as recursion
and condescension."
-- Verity Stob
XSLT? Just a bastardized spawn of Prolog.

As is any kind of pattern matching, including everyone's favourite
regular expressions. Prolog did it all.
 
R

robert

Edward said:
Yeah I agree that more is better. The problem is using a new language
every couple courses without bogging down in implementation details.
Personally I'd just say "Here's a book, learn it yourself". It's what
they gotta do on the job anyway.

Yes - start them explore. I'd not want to be "teached" a specific
_language_ in a course longer that one day. A language cannot be teached.
Who of the posters in this thread want themselves to be _teached_ more
than one day on a language?

I've seen many graduates who "know" Java, C, this and that words and
patterns, but hardly can write a loop and evolve things. Those, who can
write loops are mostly self-educated and can do all things quickly in
any language.

Isn't the fun, finding the right tools for certain purposes one-self?

The job of (CS) courses more to provide a map ( "what fun to explore
yourself" ) and display extremes (ASM and Lisp) to prevent from
identification ?

-robert
 
E

Edward Elliott

robert said:
> Yes - start them explore. I'd not want to be "teached" a specific
> _language_ in a course longer that one day. A language cannot be teached.
> Who of the posters in this thread want themselves to be _teached_ more
> than one day on a language?
>
Isn't the fun, finding the right tools for certain purposes one-self?

That holds for bright, motivated students. The problem is the others.
Some people are totally lost when you throw them a book and say "learn
this". So the choices are:

1. Do it and watch the rank-and-file students abandon the major
2. Provide more language-specific instruction

Now places like Berkeley and MIT can afford to take route 1. They already
have a surplus of bright, motivated students. But at many (most?) schools,
route 2 is in the dept's best interest. Number of majors affects prestige,
influence, and at many state schools funding. Telling the rank-and-file to
shove off is shooting themselves in the foot, and ultimately hurts the good
students as well with a lesser dept. These depts are walking a tightrope
as they try hard to maintain minimum standards. It's not a binary choice
really, it's a spectrum.

So while route 1 may be better for the profession as a whole, the current
educational system has some pretty strong pressures for route 2.
 
K

Kenneth McDonald

Lawrence said:
"...Lisp is still #1 for key algorithmic techniques such as recursion
and condescension."
-- Verity Stob


As is any kind of pattern matching, including everyone's favourite
regular expressions. Prolog did it all.
I'm assuming you're kidding--there is a lot of difference between an RE
that produces a highly optimized finite state machine to quickly match a
string, and a language that uses brute-force depth-first recursion, plus
some nonobvious tricks, to do the same thing. Like many orders of
magnitude in execution time :)

That said, it'd be nice if there were some easy way to access a Prolog
engine from Python. When Prolog is appropriate, it's _really_ appropriate.


Cheers,
Ken
 
H

Harry George

Kenneth McDonald said:
That said, it'd be nice if there were some easy way to access a Prolog
engine from Python. When Prolog is appropriate, it's _really_
appropriate.


Cheers,
Ken

http://christophe.delord.free.fr/en/pylog/
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303057
http://www.ibiblio.org/obp/py4fun/prolog/prolog2.html
http://sourceforge.net/projects/pyprolog/

Also, before these showed up, we locally did prolog-calls-python and
python-calls-prolog (all from a C++ CAD engine) by using the embedding
libraries and bindings.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top