>===== Original Message From "Guy N. Hurst" <gnhurst / hurstlinks.com> =====
>Lloyd Zusman wrote:
[...]
>Since (unlike perl) variables are not typed, ruby has no way to
>auto-vivify the particular structure you have in mind.
[...]

I think that that is the first time I have seen Perl pulled up
as an example of a typed language. :-)

That said, I wouldn't say that Perl is better or worse as an
example of a typed language than Ruby.  Rather they are
*differently* typed languages.

Ruby has a very fine-grained type-system.  It draws a lot
more precise distinctions than Perl does, for instance
between strings, floating point numbers, integers, etc.  But
Ruby's type system is entirely in the types of the objects,
the syntax gives no hint what type you are dealing with.

By contrast Perl has a small number of generic types that
are intertwined with its syntax, but tries to transparently
cast between different internal representations at need.
This is certainly an interesting idea.  And it works well for
someone who uses the language a lot, particularly on routine
types of problems.  But it provides a barrier to casual users,
and it provides a barrier to people who are trying to create
new types that are sort of "semi-native".

Perl advocates like to talk about Perl being context sensitive.
What they mean by that, of course, is that the syntax gives
perl cues about how to interpret the code.  But Ruby is just
as - if not more - context sensitive.  It is sensitive to the
context of what the types of your objects are.

I would state the Ruby-Perl tradeoff as being less syntax, more
action at a distance, but a smoother transition to handling
inherent complexity.  But in both you have an initial barrier
where you need to learn to think like the interpreter does...

Cheers,
Ben