Larry Wall on Perl 6
Nate writes "Linux Format magazine has an interview with Larry Wall, the eccentric linguist and coder behind Perl. Larry discusses some of the new Perl 6 features ready to rock the world, and if you're not planning to move from Perl 5.8, he has a few musings on that too."
Gentlemen, the time has come for a serious discussion on whether or
not to continue using Perl for serious programming projects. As I will
explain, I feel that Perl needs to be retired, much the same way that
Fortran, Cobol and C have been. Furthermore, allow me to be so bold
as to suggest a superior replacement to this outdated language.
To give you a little background on this subject, I was recently asked
to develop a client/server project on a Unix platform for a Fortune
500 company. While I've never coded in Perl before I have coded in VB for
fifteen years, and in Java for over ten, I was stunned to see how
poorly Perl fared compared to these two, more low-level languages.
Perl's biggest difficulty, as we all know, is the fact that it is by far
one of the slowest languages in existance, especially when compared to
more modern languages such as Java and C#. Although the reasons for
this are varied, the main reasons seems to be the way Perl requires a
programmer to laboriously work with chunks of memory.
Requiring a programmer to manipulate blocks of memory is a tedious way
to program. This was satisfactory back in the early days of coding,
but then again, so were punchcards. By using what are called
"pointers" a Perl programmer is basically requiring the computer to do
three sets of work rather than one. The first time requires the
computer to duplicate whatever is stored in the memory space "pointed
to" by the pointer. The second time requires it to perform the needed
operation on this space. Finally the computer must delete the
duplicate set and set the values of the original accordingly.
Clearly this is a horrendous use of resources and the chief reason why
Perl is so slow. When one looks at a more modern (and a more serious)
programming language like Java, C# or - even better - Visual Basic
that lacks such archaic coding styles, one will also note a serious
speed increase over Perl.
So what does this mean for the programming community? I think clearly
that Perl needs to be abandonded. There are two candidates that would be
a suitable replacement for it. Those are Java and Visual Basic.
Having programmed in both for many years, I believe that VB has the
edge. Not only is it slightly faster than Java its also much easier to
code in. I found Perl to be confusing, frightening and intimidating with
its non-GUI-based coding style. Furthermore, I like to see the source
code of the projects I work with. Java's source seems to be under the
monopolistic thumb of Sun much the way that GCC is obscured from us by
the marketing people at the FSF. Microsoft's "shared source" under
which Visual Basic is released definately seems to be the most fair
and reasonable of all the licenses in existance, with none of the
harsh restrictions of the BSD license. It also lacks the GPLs
requirement that anything coded with its tools becomes property of the
FSF.
I hope to see a switch from Perl to VB very soon. I've already spoken
with various luminaries in the Perl coding world and most are eager to
begin to transition. Having just gotten off the phone with Mr. Alan
Cox, I can say that he is quite thrilled with the speed increases that
will occur when the Linux kernel is completely rewritten in Visual
Basic. Richard Stallman plans to support this, and hopes that the
great Swede himself, Linux Torvaldis, won't object to renaming Linux
to VB/Linux. Although not a Perl coder himself, I'm told that Slashdot's
very own Admiral Taco will support this on his web site. Finally,
Dennis Ritchie is excited about the switch!
Thank you for your time. Happy coding.
The virtual machine that will run Perl 6 is Parrot, an innovative register-based JITed VM optimized for dynamic languages.
It can also run a subset of Python (compiled with Pirate), Ruby, Tcl, brainf*ck, Ook!, Common LISP, BASIC, Lua, m4 and a few others, all of which are more or less incomplete.
More details on the Parrot site and the Wikipedia page on the Parrot VM.
If you like that sort of things, you can help!
There's a hidden treasure in Python 3.x: __prepare__()
I like that.
The simple truth is that interstellar distances will not fit into the human imagination
- Douglas Adams
You sir, are a cretin.
Athletic Scholarships to universities make as much sense as academic scholarships to sports teams.
I'm not going to debate the fact that Perl is an immensely powerful language. It can do an amazing amount of stuff...but I'm worried about giving the programmer control over the actual grammar of the language itself. It seems that that will cause some of the same issues that C macros can cause (which is why Java doesn't include them), in terms of making the code just next to impossible to follow. Perl is hard enough to maintain with how obfuscated it can get. I'm not sure this is going to help.
O'Reilly had run into really tough times because of the plunge in book sales, which was already starting before 9/11 but very much accelerated at that point.
I remember on 9/11 thinking: That's it, I will never buy any more books! The terrorists have won.
He who knows best knows how little he knows. - Thomas Jefferson
For as long as I've been following Perl 6, I've felt Parrot is more interesting than Perl 6 itself. Parrot is in many ways like .net (obviously there are many internal differences, but the idea is the same). Compile to a common bytecode that a virtual machine understands. This is interesting because it already supports (albeit incompletely) more languages than .Net and is a whole hell of a lot newer. I think Parrot is going to get the attention of a great chunk of languages haven't really considered using a VM before. We could see the age of 3 common bytecodes in practice. Java VM (whatever it's called), .Net, and Parrot. Maybe one day instead of seeing "Ruby 1.8 or greater required" we'll see "Parrot X.X or greater required". It'd be nice if we actually saw the day of the Parrot VM browser plugin or (pipedream) Windows coming with the parrot VM.
If an officer ever threatens to taze you, say you have a pacemaker.
So much has now become clear about Perl!
Don't get me wrong though, Perl is my code of choice.
--Keeping the flame wars alive, one post at a time
Translation: "Perl 6 code will be the most unreadable Perl ever."
Rich And Stupid is not so bad as Working For Rich And Stupid.
The dead tree version had on the cover a very Larryish
quote - (roughly) We have 80% of Perl6 done and we are now working on the next 80%.
I do think you should take a look at the web pages your looking at. as far as i can tell, the .pl at the end of the page name means it's written in perl. So, is slashdot written in perl? i think so.
"In a world without walls and fences, who needs Windows and Gates?"
Larry is a God but Perl makes my head hurt just thinking about it...
Obfuscation by design?
XML is a known as a key material required to create SMD: Software of Mass Destruction
Now that would make a great O'Reilly title:
Application Development in Perl: Obfuscation by Design
Forgive me Larry... I must be grumpy today.
XML is a known as a key material required to create SMD: Software of Mass Destruction
I think one of the strength of Perl is a very active community and, dare I say it, they are nice bunch of people.
I have been to two Perl YAPC and found the people very helpful and very welcoming to people with limited programming background like myself.
The other big strength of Perl is CPAN, it's like a huge store for free. I used the CPAN shell a lot at one point and I was very pleased in the way it resolved dependencies. IN general I found the documentation for the CPAN Libraries I was using very good. Your mileage may vary. Sitll I found that creating your own Classes is a bit more work than in some other languages.
I worked on a big project that was pretty much all in Perl. How did they do it? Good old fashion project discipline. They set coding style rules (programming and indentation), Perl's Perldoc for documenting, good versioning, and object naming conventions.
Larry Wall has announced plans to hardwire Perl 6 into his brain to make it easier for him to do updates in the shower.
GetOuttaMySpace - The Anti-Social Network
And the George W. Bush award for using 9/11 as an explanation for something completely unrelated to 9/11 goes to .... Larry Wall.
I don't know about nationally, but there was a major recession in the NY area after 9/11 for a good year and a half. I was stuck workign at burger king at one point. Granted, I choose the worse time to drop out of college, it was even hard for a high school graduate with some college and a solid skillset at the time for entry level IT work to get a minimum wage service job.
The company I work for now is an ISP/developmenthouse. They are based out in eastern longisland 36.9 miles from my house in Queens according to google. There business core was out east. They had inroads and a solid plan to break into Manhattan, but they were, and still are a longisland company. Before september 11th they were looking at adding phone lines. Afterwards, the phones stopped ringing. There development work almost stopped. They had to lay off several people.
Anyway, claiming September 11th had a negative aspect on the business of computer book publishing is far from unbased.
--- Justin Dearing http://www.justaprogrammer.net/ We're just programmers.
It would be much better for the communities to have Larry talk about PHP and maybe Rasmus provide his thoughts about Perl.
At least we'd get an interesting cross-flame session!
Maybe Computers will never be as intelligent as Humans.
For sure they won't ever become so stupid. [VR-1988]
> I made it to page 149 where it says "Python uses the indentation of statements under a header to group the statements in a nested block."
> I stopped reading and tossed the book on my bookshelf on a shelf full of unused & unloved technical manuals.
One of the best things a programmer can do is try different languages. Try lisp, sql, haskell. Play with xml and yaml. Compare J2EE to Ruby on Rails. Try a language that doesn't use ALGOL-inherited code blocks. Just like an 80s ACM article said, the single best way to evaluate a programmer is by the number of languages they're fluent in.
At the end of the day Python's indentation causes a few programs, but seems to solve more. It makes it hard to share source code via email. It rules out the use of tabs. I can live with those limits. On the flip side it helps reinforce readable code. That's a very good thing - and consistent with the fundamental philosophy of the lanuage: the code must be easy to maintain.
But if you really can't get your head around that, then try Ruby. Like Python it's a well-designed, easily maintained language with a great community and future.
Perl is compiled every time you run a Perl program. It causes an annoying slowdown in my programs.
It doesn't have to be... you should look into SpeedyCGI/PersistentPerl or even PPerl. I use the former for various web cgi's that are hit constantly (including one framework where all hits are rewritten to execute a single index.pl script) as well as for various scripts that need to execute very quickly as part of a qmail/vpopmail shell chain.
As long as it's already use strict compliant, neither of these options require any changes to your code (unlike mod_perl), but should give you a significant increase in speed... for exactly the reason you specified.
In fact, when you remove compilation from the equation, I've seen well-written perl code that executes faster than almost any other language... (your opcodes are basically boiling down to C anyway).
Of course for CGI-only usage you can use mod_perl, but that does bring in some added complexity. The solutions above work from the command line as well, and require nothing more than a shebang line change.
Hire a Linux system administrator, systems engineer,
OK, I'm a computational biologist by profession, so it goes without saying that I use gobs of Perl. I also use gobs of PHP, Java, R, Python, and to a lesser extent C++ and C.
.Net has some serious competition) and the greatly improved performance, but more importantly the language features allow grammars and rules for natural language processing in a very clean and efficient style. I've a number of projects analyzing literature where this would be a boon and there's nothing comparable in other general purpose languages...
I end up using all of those languages of course, because all of them have their strengths and weaknesses. Perl is not the best performer, but much of my work is working ad hoc problems and Perl is very simple and concise for many common problems. It also is a great alternative to shell programming. I love it for those things.
However, I hate writing web-based stuff in Perl because the ease of use and clarity (basically speed of me getting somethign done tempered by the chance that I can figure out what I did later when I need to) are not as high as, say, when using PHP. It pains me to see awfully written Perl code when thigns could more clearly and easily be solved using something else -- in which case I hate it. I frequently get legacy stuff that is over engineered or fanatastically complicated because someone didn't recognize or didn't know how to use something that would have been simpler; doubly an issue since this also tends to produce more opportunities for bugs.
I could go on, but I've been doing this for some time now and have a very good feel for which language is the best tool for a specific aspect of my job and I use that (because the language used to implement a solution is NEVER a concern for those whom I'm providing solutions to).
I'm really interested in Perl6 -- the new VM (looks like
Perl 6 is currently a serious development project. But since you must ask, check out the first CMS written in Perl 6:
/ WWW/Kontent.pm
http://search.cpan.org/~brentdax/WWW-Kontent-0.01
Here's something I've been wondering about Parrot for a while. How will extensions work? How can I extend Parrot-based languages with C, either to optimize an algorithm, or to wrap a C library?
In my opinion, Parrot needs to get this right to be useful.
I made it to page 149 where it says "Python uses the indentation of statements under a header to group the statements in a nested block." I stopped reading and tossed the book on my bookshelf on a shelf full of unused & unloved technical manuals.
Hold on... it gets to page 149 before pointing out the most important thing to be aware of in the language's syntax? That's a terrible book. Get another one.
Seriously, though, I was put off Python for a long time for the same reason. I've used whitespace-significant languages before (COBOL, and a functional language called Miranda) and had no end of trouble with indentation issues. But when I tried Python, it just worked, flawlessly. I've never had an issue because of indentation. The language works, it's easy to write, and programs are easier to read due to the lack of excess symbols. The syntax is very clean and readable.
Fair enough. I've tried to learn Ruby so I'm not a dolt... but the syntax, to me, is downright offensive.
It's sad that people have trouble with Perl's syntax because hiding behind the scary surface is a brilliant sort of orderly chaos that's unlike any language I've ever used. In terms of Perl, as a language, I think I've begun to enter a class of 'Perl Mastery', and there are still things I find out about every now and then that the language does that are just utterly fantastic.
It is possible to write clean and understandable Perl code. What it takes is simply clean and understandable programming. A guy once told me, referring to Java, "You can take shitty programmers and put them in the language, and despite all of its efforts to stop them, they will write shitty code." Most people writing Perl are still basically writing C code... and that's when you really do miss what Perl has to offer.
An interesting post for those of us interested in your personal biases, but since you didn't actualy try it out, we have no idea whether you would actualy have found it useful or easy to adapt to. I have to admit I came across discussions and introductions to Python several years before I actualy tried it out and the whitespace issue did put me off. I immagined it would be awkward to use and would overly complicate code editing. I was wrong. In practice I found it wasn't. Instead it makes the code so much cleaner and easier to read. You might have found the same thing, and you might not, but we'll never know. Simon Hibbs
You know, if you're going to steal an article, verbatim, from wikipedia.org, the least you could do is cite a reference to it.
But in the future, maybe you should just post a link to the article instead.
-1, Plagiarised for you.
I currently have no clever signature witicism to add here.
Have you ever been in perl's guts? It shares a property of Perl that I find most interesting... when you first look at it and try to become comfortable with it, well, it makes grown men cry.
But then you have this moment where something in your head *clicks* and then you understand... and after that it is beautiful and logical and makes infinite sense.
It really was better than acid...
...but what about the ol' copy-paste from a block one level deeper that would throw everything off.
Any editor worth its salt has a python mode/plugin, and in that there are convenient functions for "shift left" and "shift right" which will move the selected text one indentation level left or right. Cut and paste your code, then just shift it to the indentation level required. It really isn't that hard.
Jedidiah.
Craft Beer Programming T-shirts
Are you having a Homer Simpson DUH!!! moment yet?
what?
Funny, I have working Perl 6 code.
Like the C programming language or Java or C++ or Python 3000 or Ruby or PHP or....
What does that even mean? Is Larry a committee now? (Yes, I know about @Larry. That doesn't make a meaningless cliche mean anything.)
Off the top of my head, cleaner syntax, better consistency, improved FFI, more powerful grammars, multi-methods, improved OO, a better VM, true garbage collection, better speed, currying, optional type inference, hyperoperators, junctions, improved reflection, integration of regular expressions and tree transformations, role-based typing, better distribution options, JIT, true macros, and built-in set operations matter. I probably missed a few.
how to invest, a novice's guide
I think you need to invest some time in learning block shifting commands. In Emacs under Python mode that would be python-shift-left and python-shift-right, conveniently bound to Ctrl-c < and Ctrl-c >; that will collectively shift the selected text one indent level left or right, preserving indentation within the selection. Any other editor worth using has similar commands. To move code around for refactoring just cut and paste then shift the whole block you cut and paste left or right to the appropriate indentation level. Simple, easy, and efficient.
Jedidiah.
Craft Beer Programming T-shirts