You are viewing a plain text version of this content. The canonical link for it is here.
Posted to community@apache.org by Greg Stein <gs...@lyra.org> on 2003/01/10 09:34:59 UTC

Re: python foo

On Thu, Jan 09, 2003 at 05:39:42PM -0500, Rich Bowen wrote:
>...
> > (and don't ask me about the time I tried to do a hash of hashes of hashes in
> >  Perl... even with Perl hacker help, I gave up; Perl just wouldn't do it)
> 
> Oh, come on. I do hashes of hashes of hashes frequently in Perl. And
> hashes of hashes of arrays of hashes of arrays. And ... well, other
> permutations.

Sure, I know it is possible, but really. At the time, it just didn't work.
Really. Not some kind of lamer-fu.

> And the syntax for a multi-dimensional array is almost
> indistinguishable from the example you gave in Python.
> 
> $matrix = [
>            [1, 2, 3],
>            [4, 5, 6],
>            [7, 8, 9] ];
> print $matrix->[1][2];

Very cool. Man, I wish that woulda worked when I tried it.

> A little more punctuation, but, then, you'd expect that from Perl.
> 
> You must have a very lame Perl hacker at your disposal. ;-)

This was sometime around 1996, I believe. Perl 4, if I recall. Is it
possible that it wasn't so easy in Perl 4?

And yah... if the two guys that I was getting help from didn't get it, then
I'd be surprised (I respect the guys, quite a bit)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: python foo

Posted by Rich Bowen <rb...@rcbowen.com>.
On Fri, 10 Jan 2003, Greg Stein wrote:

> > $matrix = [
> >            [1, 2, 3],
> >            [4, 5, 6],
> >            [7, 8, 9] ];
> > print $matrix->[1][2];
>
> Very cool. Man, I wish that woulda worked when I tried it.
>
> > A little more punctuation, but, then, you'd expect that from Perl.
> >
> > You must have a very lame Perl hacker at your disposal. ;-)
>
> This was sometime around 1996, I believe. Perl 4, if I recall. Is it
> possible that it wasn't so easy in Perl 4?

Ah. No. Not possible in Perl 4. That was back in the dark ages! ;-) I
guess I did not realize that Python was already around back then.
References (aka pointers, only not) appeared in Perl 5, and are what
makes this syntax posibble.

-- 
Nothing is perfekt. Certainly not me.
Success to failure. Just a matter of degrees.


fu

Posted by Ben Hyde <bh...@pobox.com>.
>>
>>> ... Perl ...
>> ... Python ...
>>

I can't say as I recall one of these my-language/your-language 
discussions ending well at any point in the last 35 years.  It's very 
close to arguing if my life philosophy is better than yours.  I think 
it might be better, if people want to go down that path, to broaden the 
discussion into one closer to comparative religion.

I very much enjoyed, and still do, in depth comparative language study. 
  When the computer science community was much less tightly connected - 
so that the opportunities for network effects were much weaker - there 
were dozens and dozens of really fascinating programming languages 
micro-lanaguages for specific domains.

Some of my favorites...

SETL (NY University) was pretty amazing.  It pretty much only had hash 
tables.  After a while they managed to get's compiler so elegant that 
it started to automatically optimize programs into algorithms that a 
few years before had seemed to be serious inventions - for example it 
could discover spanning tree based algorithms.  As far as I know this 
branch of elegance has died out.  There was a very amusing moment when 
the SETL folks wrote an Ada compiler years before anybody else managed 
to get one written.

Simula ( which was cira 1968, had all the modern tools for writing 
object oriented multi-threaded programs.  Almost all the neat ideas in 
Simula were reinvented every 2-3 years till today.  This tradition is 
probably still alive in ELang (which takes a light dose of Prolog-fu as 
well).  I can't too highly recommend a study of the ELang light-wieght 
threading model to people working on distributed systems.

The SNOBOL .. ICON (University of Arizona) had some very nice ideas 
about how to manage the control stack of a program to get search, 
iteration, pattern-matching.  There was a very interesting language in 
this line that broke the act of calling a function into it's component 
parts (binding, dispatching, returning etc.) and then managed to let 
you compose those to create iteration generators etc.

I enjoyed working on a number of graphic layout languages.  DOT is one 
of the modern examples.

I bet some other people here know of some sweet historical examples.

Etc. etc. etc.