Perl 6: every concept known to computers is in there

W

Wayne Folta

I hadn't really followed the state of perl for quite a few years. When
Irecently found python, it just suited me and now I've switched. (And
am contributing to an open-source python project. Great fun!)

Someone here mentioned perl 6, so I decided to look in on it and all I
can say is it looks like every concept from every computer course,
article, and book is now included.

I usually like enormous languages, but it looks to me like there's so
much in v6 that language practitioners will separate into
mutually-incomprehensible dialects. For example, subroutine calls have
added 6 or 8 new symbols and feature every possible combination of
subroutine argument variants (positional, keyword, optional, mandatory,
variable-length, etc). Regular expressions have a class-like mechanism
for defining grammars. Regular expressions have been jerked all around
symbol-wise in what looks like a game of musical chairs. (See refs at
end.)

Lots of good ideas that might be interesting to consider for python
(translated into pythonic pentameter, of course). But v6 also reminds
me of the US television standard, NTSC, which some say stands for
"Never Twice The Same Color".

Actually, they've also overhauled their OO model and it looks like
operator overloading is quite nicely done. As an aside, I'm not a fan
of how python maps symbols to names for such things. If you want to
redefine, say, "-" for a set-like operation, you have to either
remember or lookup to see if it's __sub__ or __subtract__ or __minus__
or...

I'd love to see something like:

def "aa - bb":
return [a for a in aa if a not in bb]

(the body may or may not be correct, it's the def that I'm talking
about). This would handle infix, prefix, and suffix all with the same
notation. (Maybe even "circumfix" which I'd never heard used until I
read perl v6's docs.)

http://dev.perl.org/perl6/synopsis/S05.html
http://dev.perl.org/perl6/synopsis/S06.html
 
N

Nicolas Fleury

Wayne said:
I usually like enormous languages, but it looks to me like there's so
much in v6 that language practitioners will separate into
mutually-incomprehensible dialects. For example, subroutine calls have
added 6 or 8 new symbols and feature every possible combination of
subroutine argument variants (positional, keyword, optional, mandatory,
variable-length, etc). Regular expressions have a class-like mechanism
for defining grammars. Regular expressions have been jerked all around
symbol-wise in what looks like a game of musical chairs. (See refs at
end.)

I think gramar definitions is a big plus. I program mainly in Python,
but Perl is still my choice for heavy parsing. The fact that regexp are
now named rules is a fact that Perl6 is focusing on what Perl is doing
better: parsing. Personally, I would prefer Perl to Lex/Yacc.
I'd love to see something like:

def "aa - bb":
return [a for a in aa if a not in bb]

(the body may or may not be correct, it's the def that I'm talking
about). This would handle infix, prefix, and suffix all with the same
notation. (Maybe even "circumfix" which I'd never heard used until I
read perl v6's docs.)

I prefer the statu quo. It's an even more flexible syntax since you can
do more that syntax overloading. An how would you get a reference to
that function without a name?

Regards,

Nicolas
 
L

Lothar Scholz

Wayne Folta said:
I hadn't really followed the state of perl for quite a few years. When
Irecently found python, it just suited me and now I've switched. (And
am contributing to an open-source python project. Great fun!)

Someone here mentioned perl 6, so I decided to look in on it and all I
can say is it looks like every concept from every computer course,
article, and book is now included.

But this is not a positive thing.
For example i love eiffel because it only has one loop construct.
You can write a song with 10000 notes but normally it will not sound good.
 
W

Wayne Folta

Someone here mentioned perl 6, so I decided to look in on it and all I
But this is not a positive thing.

I agree mostly.
For example i love eiffel because it only has one loop construct.
You can write a song with 10000 notes but normally it will not sound
good.

But a song with only one note isn't much to listen to, either. (A song
with two chords, however, is called a heavy metal hit.)

Eiffel may only have one loop construct, but I'm sure you will find
many idioms that people use to create the kinds of loops they need in
practice. Things can be too simple or too complex.

I do think that perl 6 has so much stuff in it that skilled perl
programmers will not be able to understand each other's code because
they can only use subset of the language. Still, it's certainly
fascinating to watch. Even inspiring in some sense, though I'll
continue with python.
 

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

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top