Larry Wall's comments on Ruby

Albert Wagner wrote:

precludes the principles from applying to a complex program. I suppose
that
there is either another “complexity theory” or the one that you pointed
me to
has been bastardized in the pop science community.

I am a (discrete) mathematician. My brother happens to be a
professor of complexity theory at the Rutgers University.
The complexity theory, I pointed to, has its origin in the 1970-s.
It started with the recognition of the clear distinction between the NP
and exponential complexity classes. It is a very serious and highly
fruitful branch of computer science. One could say that this is
where the main focus of computer science lies. There is nothing
“bastardized” about it.

You have misunderstood Albert. He meant that perhaps the
widespread conception of complexity theory was a
bastardization of the real one.

My perceptions were the same as Albert’s. Assuming what
you say is true, perhaps you are so close to the reality
that you do not ever see the pseudo-realities that other
people are propounding.

For a related example, people blather a lot about chaos
theory nowadays – people who have never seen a differential
equation. Many of these people learned about chaos theory
by watching Jurassic Park and they always go around
babbling about butterflies and hurricanes.

In much the same way, I have seen relativity and quantum
mechanics brought up in literature courses. In every case,
the professor did not really understand what he was saying.

Somewhat related: I saw a graph some years ago that impacted on me.
The y
axis was randomicity and x was complexity. It was to illustrate that
(a) if
randomicity was sufficiently high then statistical methods were useful
and
(b) if randomicity was very low and complexity was low then standard
mechanical methods were useful. What I found startling was the large
area in
the middle and to the right that were not random enough for statistics
to be
reliable and too complex for mechanical methods. Yet, it was just in
this
area, where no reliable tools currently existed that most of the
interesting
and important problems of our time existed.

Sound like pseudoscience to me…

Could be pseudoscience, or just someone painting
with a very broad brush.

Hal

···

----- Original Message -----
From: “Christian Szegedy” szegedy@t-online.de
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, September 07, 2002 2:31 PM
Subject: Re: Larry Wall’s comments on Ruby

One idea I’ve wondered about is making the parser “smart”
enough to (at least) speculate about where an error really
happened, based on indentation.

This would be a small tip of the hat to Python, I suppose.
If an ‘end’ was indented differently from its corresponding
beginning, a warning would be generated. But then it would
interfere with people’s styles, and there would always be
some people who would mix spaces and tabs in creative and
irritating ways and set the tabstops to some setting that
the interpreter could never hope to guess.

It would work for me, though. :slight_smile: Maybe I should create a
Ruby version of lint (rint?).

Please, please do! (I’m sure it would be useful to 99% of Ruby programmers.)

Hal

Gavin

PS. The interpreter could still have this logic but only warn you if the "end"s
don’t match up /in toto/. That sort of warning would at least stay out of
people’s way until they need it.

···

----- Original Message -----
From: “Hal E. Fulton” hal9000@hypermetrics.com

[Note: In my examples I’m going to use ‘n+’ to indicate that the
parser has pushed a block open on a stack for line ‘n’ and ‘n-’ to
pop it off the stack because it’s closed at line ‘n’.]

Granted, I’m not a parser writer or a language designer, but why not
have the parser backtrack to the last matching block open? I mean,
in some cases, you’ll give the wrong error anyway, but in the
general case:

1 def fun
2 if foo then
3 end

The parser would push the block open/close locations as 1+:2+:3-.
The assumption should be that the error is at the second push (2+),
because in reality, the programmer isn’t likely to have been stupid
enough to not close the function definition, but the “if” statement.
The error would be reported, therefore, at line two, not line one.
As I understand it now, the parser assumes that it is the first push
(line one) that is at error.

In a more complex case, as:

        A                   B

1 begin | begin
2 if foo then | if foo then
3 end | end
4 |
5 begin | begin
6 | do
7 do |
8 begin | begin
9 end | end
10 end | end
11 end | end

The parser would push that as 1+:2+:3-:5+:7+:8+:9-:10-:11-.
Depending on how the tracking of “last block open” is done, the
parser would report either line five or eight as the offending line;
line five is obviously correct in case A, eight is obviously correct
in case B. In either case, reporting either five or eight would be
more correct than reporting line one … right?

I’d personally prefer in most cases that line five be reported, even
in case B, but line eight may to be more consistent. Am I completely
off-base here?

-austin
– Austin Ziegler, austin@halostatue.ca on 2002.09.08 at 01.26.25

···

On Sun, 8 Sep 2002 14:03:05 +0900, Hal E. Fulton wrote:

One idea I’ve wondered about is making the parser “smart” enough
to (at least) speculate about where an error really happened,
based on indentation.

Having a plethora of end tokens in the language seems quite heavy and,
as Hal points out in a snipped part, likely to interfere with extending
the language in other ways. Having a toggle in the editor to simply
insert the “inane comments” would provide an easy way the catch the
mistake where an end is left out.

···

On Saturday, September 7, 2002, at 10:03 PM, Hal E. Fulton wrote:

I even rather like the way some languages “modify”
the end token: end def, end while, end if, etc.

This certainly prevents the inane comments to the same
effect that people put in, and even gives an additional
hint to the interpreter. (It would prevent the mistake
that I often make where I leave out an ‘end’ and the
parser isn’t able to catch it until 50 lines later.)


C++: The power, elegance and simplicity of a hand grenade.

> > Somewhat related: I saw a graph some years ago that impacted on me. The > > y axis was randomicity and x was complexity. It was to illustrate that > > (a) if randomicity was sufficiently high then statistical methods were > > useful and (b) if randomicity was very low and complexity was low then > > standard mechanical methods were useful. What I found startling was the > > large area in the middle and to the right that were not random enough for > > statistics to be reliable and too complex for mechanical methods. Yet, > > it was just in this area, where no reliable tools currently existed that > > most of the interesting and important problems of our time existed. > > Sound like pseudoscience to me...

Sorry, Christian. I have brooded on this response for several days now and
just cannot get it out of my head. In what way is this story "pseudoscience"
and what am I to imply that your statement says about me for posting it?

Albert

···

On Saturday 07 September 2002 02:31 pm, Christian Szegedy wrote:

def fun(foo)

end

to me seems to be much cleaner than

fun(foo):

or

sub fun(foo)
{

}

whereas the latter will come up again with blocks.
(Haven’t you ever seen this in Ruby? :

       }
     }
   }
 }

}
)

I have. (And in C, Java, C++, etc.) And in almost every case, it is
a “bad code smell”. If nothing else, it’s a place I’d look to
refactor.

This is also why I hate the “} // end for …” comments and also
specific end tokens (“end for”, “end if”, etc.). If you need them to
see what’s going on in the code, there’s something wrong with the
code.

That doesn’t make {} vs. indentation any better or worse, mind you,
I’m simply pointing out that the “uglyness” you list here is not an
argument for one style over the other, but an argument of bad code
that isn’t the language’s fault.

···

=====

Use your computer to help find a cure for cancer: http://members.ud.com/projects/cancer/

Yahoo IM: michael_s_campbell


Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

Ha… ha… ha…, very well said, Hal, very well said :slight_smile: I knew it! I knew
it! To me Python smelled like a “pseudo-OO” since the first time I used
it.

Ruby, on the other hand, is the reverse. It looked like a procedural
language in the beginning when I learned it, but then later it reveals
itself as a pure OO language. How wonderful it is!

Regards,

Bill

···

============================================================================
Hal E. Fulton hal9000@hypermetrics.com wrote:

Python was always OO insofar as its implementation of OO can be
called OO.

Would that this were so. However, it’s not; and no amount of claiming
that it was will change history. In the words of the Python FAQ:

(snip)

I agree with you to the extent that I’m able. (I know
little about Python.)

I wonder if we could paraphrase the above quote by
saying, “A horse is a flying animal insofar as its
implementation of flying can be called flying.” :slight_smile:

Hal

Newsgroups: comp.lang.ruby

Actually I don’t really mind so much writing abs(x) or sin(x)
but I just cannot get over the ``Math’’ prefixes Math.cos(x),
Math.sin(x) … they are reaaally tacky.

In the absence of Namespaces (which are a much better
solution then the proposed Numeric mixins) things would
not be that bad if Math was at least a class (with disabled
new/allocate) - at least I could write

class MyMathNameSpace < Math; end

class << MyMathNameSpace
def sin_squared(x)
sin(x) * sin(x)
end
end

Pardon my ignorance, but I don’t see what the alternative to Match.cos(x) is,
nor do I understand the talk of namespaces. The only alternative to
Math.cos(x) is Kernel::cos(x), isn’t it? That would eventually lead to name
clashes. Is namespaces a solution here?

/Christoph

Gavin

···

----- Original Message -----
From: “Christoph” chr_news@gmx.net

Hal E. Fulton wrote:

You have misunderstood Albert. He meant that perhaps the
widespread conception of complexity theory was a
bastardization of the real one.

Yes, you are right, and I already said in the followup mail
that I was sorry about my sloppyness.

In much the same way, I have seen relativity and quantum
mechanics brought up in literature courses. In every case,
the professor did not really understand what he was saying.

A hilarious (but true) story can be found here:

http://physics.nyu.edu/faculty/sokal

Particularly interesting is the paper:
“Transgressing the Boundaries: Toward a Transformative Hermeneutics of
Quantum Gravity”

and its afterword.

Best regards, Christian

···

----- Original Message -----

GOTO Kentaro wrote:

Really? Turing machines don’t focus interactions with its environment
but Ruby does that (I don’t know malbolge case :). For example, how
can I implement a http server (or echo server) in TM?

Of course the TM needs an HTTP oracle… :slight_smile:

sorry for off topic,

So do I…

Best regards, Christian

Yes, Please do.

Most Ruby programmers try to indent intelligently. Use this as a heuristic to
determine the programmer’s intent. Simply pushing/popping a stack leaves too
much in suspicion.

···

On Sunday 08 September 2002 12:44 am, Gavin Sinclair wrote:

Please, please do! (I'm sure it would be useful to 99% of Ruby programmers.)

Hal

Gavin

PS. The interpreter could still have this logic but only warn you if the
"end"s don’t match up /in toto/. That sort of warning would at least stay
out of people’s way until they need it.

> > Somewhat related: I saw a graph some years ago that impacted on me.

The

y axis was randomicity and x was complexity. It was to illustrate
that
(a) if randomicity was sufficiently high then statistical methods were
useful and (b) if randomicity was very low and complexity was low then
standard mechanical methods were useful. What I found startling was
the
large area in the middle and to the right that were not random enough
for
statistics to be reliable and too complex for mechanical methods.
Yet,
it was just in this area, where no reliable tools currently existed
that
most of the interesting and important problems of our time existed.

Sound like pseudoscience to me…

Sorry, Christian. I have brooded on this response for several days now
and
just cannot get it out of my head. In what way is this story
“pseudoscience”
and what am I to imply that your statement says about me for posting it?

:slight_smile: Not my business, but I’ll comment.

First of all, you’ve spent two days brooding over a
statement that must have taken a very few seconds to
type. I’d estimate a 40,000-to-1 ratio there… :slight_smile:

I’ll certainly give you the benefit of the doubt
as to the “meaningfulness” of this graph. So any
comments here do not reflect on your veracity or
intelligence. Nor do I think that C. S. was trying
to disparage you either. There’s a lot of nonsense
out there, and programmers often swallow it as
readily as anyone else.

First of all, my default assumption for any assertion
is: False until proven true. Agree or disagree as you
choose. That’s just my personality and my philosophy.
(Of course, that’s weighted by many factors. Often I
just don’t care whether something is true. If someone
tells me that Fooville, Indiana, has a population of
4,000 – I’m fine with that. But if I repeat the
figure, I state it as hearsay.)

Now, here’s why this sounds like pseudoscience to
me personally.

  1. We can’t see the graph. For me, this immediately
    calls into question any comments made about it.
  2. Likewise, we don’t know the publication or the
    authors or their credentials. If it’s Murray Gell-Mann
    in American Physical Review, I’d give it weight. If
    it’s Douglas Hofstadter in Scientific American, I’d
    give it less. And if it’s an unknown writer in Infinite
    Energy magazine, which investigates cold fusion…
  3. It’s very, very general. No mention is made of the
    specific areas of research, nor investigative techniques,
    nor even which (presumably scientific) fields we are
    discussing.
  4. We’re not told what “randomicity” really means in this
    context, and we’re certainly not told what “complexity”
    means.
  5. How on earth do you measure randomicity and complexity?
    With what tools, and in what units?

Having said all that (and I could say more): I’m not saying
that the graph is invalid. I’m just saying that it’s far
from clear
that it’s valid.

This sounds a little like the kind of stuff that James
Gleick writes. It’s not exactly wrong, it’s just so
popularized that it becomes difficult to assign a
meaningful truth or falsehood value to it. Disclaimer:
There are large portions of his writing where I’m not
qualified to have an opinion at all.

Gary Zukav is a notch worse, I think. Just my opinion.

As for the notion of “pseduoscience”… well, there must
be a million definitions of that. I’m experiencing deja vu
here. Wasn’t this an OT thread here several weeks back,
where I said that I considered sociology and psychology
pseudosciences or at least borderline? But that’s coming
from someone who has always loved physics. I majored in it
for 2.5 years until I chickened out. (Found I was taking
comp sci “for fun”).

Always liked the Ernest Rutherford quote: “All science is
either physics or stamp collecting.” OK, so he’s
exaggerating… :wink:

Cheers,
Hal

···

----- Original Message -----
From: “Albert Wagner” alwagner@tcac.net
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, September 09, 2002 7:52 PM
Subject: Re: Larry Wall’s comments on Ruby

On Saturday 07 September 2002 02:31 pm, Christian Szegedy wrote:

> Ruby, on the other hand, is the reverse. It looked like a procedural > language in the beginning when I learned it, but then later it reveals > itself as a pure OO language. How wonderful it is! >

Interesting. When I was looking for an alternative to Smalltalk, I had the
same first impression of Ruby: just another procedural language. I actually
set it aside for several months based on that first impression.

···

On Tuesday 10 September 2002 08:33 am, William Djaja Tjokroaminata wrote:

Regards,

Bill

=

Hal E. Fulton hal9000@hypermetrics.com wrote:

Python was always OO insofar as its implementation of OO can be
called OO.

Would that this were so. However, it’s not; and no amount of claiming
that it was will change history. In the words of the Python FAQ:

(snip)

I agree with you to the extent that I’m able. (I know
little about Python.)

I wonder if we could paraphrase the above quote by
saying, “A horse is a flying animal insofar as its
implementation of flying can be called flying.” :slight_smile:

Hal

Hi,

I think in Ruby, if you are sure that in your script there are no others
with names such as “cos” and “sin”, you could simply put

include Math

and then you can simply write

z = cos(x) * sin(y)

Regards,

Bill

···

============================================================================
Gavin Sinclair gsinclair@soyabean.com.au wrote:

----- Original Message -----
From: “Christoph” chr_news@gmx.net
Newsgroups: comp.lang.ruby

Actually I don’t really mind so much writing abs(x) or sin(x)
but I just cannot get over the ``Math’’ prefixes Math.cos(x),
Math.sin(x) … they are reaaally tacky.

Pardon my ignorance, but I don’t see what the alternative to Match.cos(x) is,
nor do I understand the talk of namespaces. The only alternative to
Math.cos(x) is Kernel::cos(x), isn’t it? That would eventually lead to name
clashes. Is namespaces a solution here?

/Christoph

Gavin

In much the same way, I have seen relativity and quantum
mechanics brought up in literature courses. In every case,
the professor did not really understand what he was saying.

A hilarious (but true) story can be found here:

http://physics.nyu.edu/faculty/sokal

Particularly interesting is the paper:
“Transgressing the Boundaries: Toward a Transformative Hermeneutics of
Quantum Gravity”

and its afterword.

Yes, I saw this first about three years ago.
A truly wonderful story.

It is a shame that Richard Feynman did not
live to see it.

Hal

···

----- Original Message -----
From: “Christian Szegedy” szegedy@t-online.de
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, September 07, 2002 9:52 PM
Subject: OT: pseudoscience.

Thanks, Hal. I felt like a fool the instant I hit the send key.

I guess it really depends on how far one goes the first time he/she learns
Ruby. That’s why I thing, the pickaxe book has stated that “Let’s say it
again. Ruby is a genuine object-oriented language…” in the beginning,
to “catch” people before they go away… :slight_smile:

Regards,

Bill

···

===========================================================================
Albert Wagner alwagner@tcac.net wrote:

Interesting. When I was looking for an alternative to Smalltalk, I had the
same first impression of Ruby: just another procedural language. I actually
set it aside for several months based on that first impression.

I suppose that most math calculations would be isolated to a couple of classes.
These could all “include Math”, thus simplifying the call.

Is this good style? Is it the Ruby way? Is there any performance hit by
including the same module in two classes?

BTW my question remains unanswered. Christoph mentioned namespaces as if they
were different from modules, and I don’t know what he was talking about.

–Gavin

Hi,

I think in Ruby, if you are sure that in your script there are no others
with names such as “cos” and “sin”, you could simply put

include Math

and then you can simply write

z = cos(x) * sin(y)

Regards,

Bill

From: “Christoph” chr_news@gmx.net
Newsgroups: comp.lang.ruby

Actually I don’t really mind so much writing abs(x) or sin(x)
but I just cannot get over the ``Math’’ prefixes Math.cos(x),
Math.sin(x) … they are reaaally tacky.

Pardon my ignorance, but I don’t see what the alternative to Match.cos(x)
is,
nor do I understand the talk of namespaces. The only alternative to
Math.cos(x) is Kernel::cos(x), isn’t it? That would eventually lead to
name

···

----- Original Message -----
From: “William Djaja Tjokroaminata” billtj@z.glue.umd.edu

Gavin Sinclair gsinclair@soyabean.com.au wrote:

----- Original Message -----
clashes. Is namespaces a solution here?

/Christoph

Gavin

From: “Christian Szegedy” szegedy@t-online.de
Newsgroups: comp.lang.ruby
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Saturday, September 07, 2002 9:52 PM
Subject: OT: pseudoscience.

In much the same way, I have seen relativity and quantum
mechanics brought up in literature courses. In every case,
the professor did not really understand what he was saying.

A hilarious (but true) story can be found here:

http://physics.nyu.edu/faculty/sokal

Particularly interesting is the paper:
“Transgressing the Boundaries: Toward a Transformative Hermeneutics of
Quantum Gravity”

and its afterword.

Yes, I saw this first about three years ago.
A truly wonderful story.

It is a shame that Richard Feynman did not
live to see it.

I wish like hell that my Literary Criticism professor had seen it.

···

On Saturday 07 September 2002 10:54 pm, Hal E. Fulton wrote:

----- Original Message -----

Hal

Ha!

That's never happened to any of the rest of us.

Are you going to the Ruby Conference, by any chance?

Hal

···

----- Original Message -----
From: “Albert Wagner” alwagner@tcac.net
To: “ruby-talk ML” ruby-talk@ruby-lang.org
Sent: Monday, September 09, 2002 9:16 PM
Subject: Re: Larry Wall’s comments on Ruby

Thanks, Hal. I felt like a fool the instant I hit the send key.