What is Perl 6?
chromatic writes "Perl.com has a new article entitled What is Perl 6?. It analyzes the changes to the language in light of the good and bad points of Perl 5 and provides new information about the current state of the project: Perl 6 exists, you can write code in it today, and it's more consistent and easier to use than Perl 5."
Yeah, I know I'm late to get on this but
My work here is dung.
You can never be told what Perl is.
You just have to see it for yourself.
sorry, i just had to.
An old-timer with old-timey ideas.
Baby don't hurt me,
Don't hurt me
No more
Well that will teach me to RTFA. One of things that got me interested in programming, and perl specifically, was the magnificent writing in the Camel and Llama books. It made it seem fun, relaxed and reduced the shock of the sometimes difficult syntax of the language. Hopefully this deadly boring article is not a sign of what Perl 6 documentation will be like.
I never really understood Data Structures until I learned Perl. I was consistently and thoroughly confused in my DS class. The language used there was C++. There was simply too much baggage in the language that obfuscated the very points we were being taught. If you can't get past the template syntax, how in the world are you going to be able to understand the data structure concepts?
Then I met Perl (5.003). What a difference it made! The data structures were built in, and on top of that, it was EASY to nest structures to build complex data types. It was like having a semester of Data Structures immediately made clear.
Then I found myself back with C++ again. First I wrote my own List classes. However I soon realized that STL made available exactly the types of data structures that Perl has. Maps, Lists, Vectors. And since I understood what I was doing in Perl, it was so much easier to catch on with C++.
Perl taught me C++. Who would have thought?
Java, Python, Ruby ... but who cares about Perl now but for regexp ;-)
I can't define it, but I know it when I see it.
Rob
What makes Perl strong, in my opinion, is the community's interest in maintaining a large and well-tested library of useful code in CPAN. Without CPAN, it's not clear that Perl would be as alive and healthy as it is today.
What Perl 6 offers is a rejuvenation of the language. Perl 5 still works great (better than ever due to new efforts to stamp out even the most obscure bugs) but this new revision is attracting some *really* smart people who are bringing interesting new ideas to the language. Audrey Tang and Luke Palmer come to mind right away.
My greatest hope, however, is not that a revitalized Perl will squash the other dynamic languages (Python, Ruby, PHP, ECMAScript, etc) but will instead bring them into a state of interoperability. I really, really want Parrot to succeed so well that the other languages decide to target it as a backend so I can trivially call Python or C libraries from Perl and vice versa.
I used Perl in a Programming Language Concepts course. You can do some neat stuff with it, but it isn't really the easiest thing to understand (at least not with maybe a week or two of going over it). My professor likened it to duct tape. It is a quick fix, that others aren't supposed to see. It works, but isn't pretty, and isn't something you should expect to build a whole program (so to speak for a scripting language) with....
In undeveloped countries, the consumer controls the market. In capitalist America, the market controls you.
The problem I see with a language like perl6 and mant others, is that it seems they all started from the bottom.
They add features, which already exists in some other language, only they maybe improve the interface, or add any sort of incremental improvement to it.
My problem I see, they didn't start with a dream, which became a vision, which became a mission, which transalted to goals, and then a solid implementation.
If you are already familiar with strategic management, you will noticed I borrowed some terms, from that field. Strategic management suggest that for an organization to succeed, it must have a clear vision (based on a dream a good cause or whatever), a mission (a more realistic translation of the vision/dream) , and finally goals and objective (implementation detail)
So I ask, what's perl6 vision, I think perl6 started with details, this is why me and many others are not existed about it, sure it will better (maybe), but it won't be new, and probably it won't add much to the technology arena.
One thing that perl is good for that I hope it continues to be good for in the future in command line scripting.
~tuxmaster
My compilers professor has nothing but bad things to say about a language whose syntax is inelegant and tricky. After all, if a language is inelegant, it will be hard to read and understand, as well as hard to create a proper grammar for, or parse.
"(Perl 5 overloaded curly braces in six different ways. If you can list four, you're doing well.)" ! Java has something like 22 levels of precedence. Most people will use the bare minimum of that, lest they tread upon a dragon's tail.
And, one of my favourite points: "Why is the method call operator two characters (one shifted), not a single dot? "
Perl 6 means a simpler, better parser, while keeping all the language strengths. This means it won't be such a bitch to deal with mod_perl's weird gleeps once it's Perl 6. This means smaller process overhead. This means quicker development of web applications that are cool (although I must admit, Ruby on Rails is also pretty neat looking).
The new regex syntax alone is reason to switch!
--
Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
It's what clueless people who haven't already migrated to Ruby will be using soon.
http://www.ruby-lang.org/en/
Ruby's ugly second cousin, twice removed.
A.Two Kiwi oysters going at it.
..now that we got Ruby.
Mark Kretschmann - Amarok Developer, KDE Member
From TFA:
Whipituptitude?!
That is awesome. Made up words a--
Whats this? Manipulexity?
How much awesome can you cram into a single sentence?
A horrific obscenity that must be destroyed!!
j/k
Three years ago, I could program in C, but had never used a scripting language (except bash, for very basic stuff). I needed to do some non-trivial manipulation of text files and figured that this was a good time to learn. Since others in the group were using perl, I tried perl.
I knew what I wanted to do, but needed to learn the language. I struggled with the awful syntax for three days. The breaking point came when I wanted a list of lists and realised that Perl "flattens" nested lists. How do you write nested lists such as [[1,2],[3,4],5,[6,7,8]]? In Python, it's trivial (that's how you'd write it), but in perl, nobody I talked to could give me an answer. It flattens it, unasked, to [1,2,3,4,5,6,7,8] and, try as I might, I can't see the point. (It turns out it's possible to have nested lists, but it's yet another example of perl's horrendous syntax).
Finally, I decided to give python a try. I spent an hour reading the python tutorial, and in another three hours, I had reimplemented everything I'd done in the last three days in perl, and an hour after that I'd finished the job. Python syntax was, and still is, the cleanest I've ever seen. It's an amazing language. And it changed the way I think about programming: it gave me an appreciation of functional methods (I now use ocaml a lot) and also changed the way I write C (vastly for the better).
That was it. No more perl for me.
yet another Virtual Machine nobody needs, that's supposed to be well at executing lots of different languages, but probably won't really.
It's a new language built by rewriting an ugly, old hack, that only fans of the old version will probably ever use. Everybody who didn't like Perl already moved on.
I heard Perl 6 was going to be merged with Python. ;)
http://outcampaign.org/
People in the mid-1990s spoke of "overnight obsolescence", that Perl 6 would replace everything in a few weeks, and that you had better learn a new programming language every month. Over 10 years later, perl 6 is still in beta mode.
Hello.
We need 5 years experience Perl 6 programmers for 3D game. Reference: P6DNF.
-Woof woof woof!
If you were ever frustrated by perl's lack of a sane threading mobel, messy syntax, or lack of clean OO extensions, or needed tighter SQL integration, or TIBCO AE or XML integration (at the expense of a lot of other functionality :-)), you might want to check out a new language called qore.
n t.q/
:-) )
david
Even compared to perl6, qore has cleaner object support (IMHO), also features exception handling, embedded logic support, and more. Qore has a syntax superficially similar to perl's (except for the OO parts), but less scripty and more like C++ or Java's syntax in some ways.
It's even possible to write pure OO programs in qore (the program is a class), like:
http://qore.sourceforge.net/examples/xml-rpc-clie
Anyway of course if has drawbacks compared to perl as well (it is a realtively new language), but, as it was designed to write interfaces in and to be fun and efficient to program in, some perl fans may still like it, as it also addresses some of the shortcomings of perl5 at least from my point of view, and, after reading this article, I believe it has advantages over perl6 still as well in some areas (can't comment on the threading model, because I couldn't find any reference to it in the article, but qore has a clean shared-everything threading model and the whole language is thread-safe - also qore data structures are very simple and powerful and it's very easy to serialize and deserialize data to and from XML strings, SQL queries, TIBCO AE messages, etc which makes it a good tool for interface development).
Anyway, here are some links:
http://qore.sourceforge.net/
http://sourceforge.net/projects/qore/
(disclaimer: I am the author of the language
The article talks about some of the defining features for perl. Well, one of the defining features in my perl experience has been Perl Data Language, pdl. PDL _is_ whipitupitude. Its a wonderful wonderful matrix library. And it comes with the best perl shell I know.
I had to break down a equation into a sequence of linear equations. So I hacked up some PDL in like 2 hours to do that. Couldn't have been easier, even though I'd never used PDL or its perldl perl shell; I just started typing in the interactive shell until it worked as expected and until I knew what I was doing. Then I needed the results in interger, so I rounded everything down, built a permuter and sorted the permuted results for each individual segment. That took three hours, but only because I kept botching the matrix multiplication. Even with huge datasets, generating hundreds of thousands of linear equations, each spanning dozens of datapoints, permuting the linear equations, sorting them and selecting the optimal, PDL would run it all my slow arse 800mhz crusoe laptop in seconds. Matlab couldnt touch it.
Thats the other really truly thing about PDL; the performance. If someone else would chime in and do it better justice, but my crude understanding is that it generates some kind of extremely optimized machine code on first use and runs whatever equations you've thrown at it like silk from that point on.
Little late and a little off topic, but PDL really is just a masterpiece of perl hackability. The PDL perl shell is truly spectacular; get some symbolic integrators and differential equation solving packages in there and I wouldn't need to break open Mathematica or Matlab ever again. Ok, long way away, pdl is really just about matricies, but it is really really sweet, and its shell is good for anyone who just wants to try something out really quickly in fully interactive perl.
That being said, I really cant wait to see where the perl6 VM is going.
G'night!
Myren
I switched from Perl to Python 8 years ago. Haven't looked back since. Of course, perl has some pretty good modules which Python still doesn't, but for 80% of the jobs, Python more than lives up to expectations. Of the remaining 20% tasks it's much easier to implement them yourself in Python, in 80% of the cases.
Python still has nothing close to what is available at CPAN. There are cheap imitations but nothing too great yet (in terms of quality of modules).
On the other hand, 80% of the modules you typically need are included with the standard distribution. (Batteries included)
Barney
** Flame war begins **
As for Linux, well, Linux didn't really succeed alone, it succeeded as being part of the GNU thing, and RMS obvioulsy had a vision, so (even thought it doesn't have to be true) I can argue that if it weren't for RMS's vision, Linux would have stayed a just for fun thingie. RMS gave linux caliber.
As for what someone else said, that this vision->mission->goals, is a strict system, well, there are several arguments against that.
- First many people do have visions and missions, but they don't state it, maybe they are shy afraid or don't think its important, but no, communication your ideas and goals are importnat so if you got them, plz, say em.
- The hierarchy is exactly how the strictness is removed, a goals is specific and precise, its one clear thing, that you either achieve it or not, a vision is less specific and more liberal, take Bill Gates vision for example, it didn't say, that a proprietary OS had to be the solution, it was just one way to achieve it. Take RMS vision, people still argue about the definition of free software, what's free what isn't, so you see
So you see, the strategic system only help people create direction, and decide whether or not they achieved progressThe article mentions blocks being closures and the fact that Perl 6 -- much like the new regex system -- is itself really a programmable grammar. It sounds like we now have real macros.
The question is: is Perl becoming a LISP implementation?
Here http://www.pugscode.org/ is something on the PUGS project, which is making an implementation of Perl 6 in Haskell, conformant to the spec.
Apparently they are having a lot of fun.
http://www.thebricktestament.com/the_law/when_to_
I do scientific computing (astronomy). I never met the task that was too cumbersome to write in C, while at the same time too complex to write in awk.
I keep waiting for a task where it would make sense for me to learn perl... it's never come along.
Normally you wait until a language is actually released before learning it. Traditionally, you let a couple early adopters build something with it first too. Most smart organizations wait to make sure the langauge actually is somewhat stable before buying into the list of benefits. They wait for books to be released.
Perl6 is not really here yet. Read the last page. Author doesnt come out and state it directly, but the current best implementation runs on Haskell.
I dunno, somehow I dont think the take-away was supposed to be "learn this or get fired, parrot is the one vm to rulezor them all!!11," I think it was more "perl6 is still coming and has some really cool new features, as well as being built around a much more solid core." There's mainstream technologies worth reading up on if you feel the heat to stay up to date for your job. Then there's things like Perl6/Parrot; cool technologies to read up on if you're actually fucking interested in computer languages or vm's. Forgive me, I realize you simply werent aware of the status of perl6, but perhaps you should see how many band members are actually on the bandwagon before hoping aboard yourself.
Myren
If the release of Perl 5 was any indication, Perl 6 is the single magic bullet that will kill all of my (Perl) code.
.NET.
Perl 6 may be more akin to a divine programming language, which makes the implimentation of complex data structures simple and sublime. Then again, it could all be a nasty trick to lead us away from the true path of enlightenment.
Perl 6 is not
Perl 6 is not controlled by any major corporation; I haven't decided whether this is advantageous or not yet.
If I were to have a child, would it be written in Perl 6?
Can Perl 6 be used to unlock the secret mysteries of the Bible code to reveal the end times?
Is Perl 6 really being developed by the descendants of Jesus Christ? Is the Pope trying to cover it up? Does the Pope know what Perl is? If so, is using Perl 5 a sin? How about Perl 6?
I bought a preview book on Perl 6 a few years ago. Is it still useful? Can I have my money back?
If Ruby was an upgrade to Perl, and Perl 6 is a an upgrade to Perl and Ruby, will Ruby need to changes their name in such a way as to play off of Ruby Tuesdays?
If I enter the Perl 6, can I change my mind later?
If Perl 6 is brillian, but no one uses it, is it still brilliant? What if it's awful and everyone uses it?
So very tired....
No wonder it needed a re-write, its outdated and crufty, compared to more modern scripting languages. Perl has lost its identity, razzle and dazzle from then it was first introduced..
With hacked on OO, CGI that is painful - there is little reason to revisit, because looking at Perl 5, and Perl 6 - they look completely different.
Thank god for new things like this to keep one amused.
My latest web development platform, is Ruby on Rails. I was a sworn Perl, PHP guru until I started using this puppy - its absolutely amazing. Everything else is just too tiring..
Oh my god, let the flame wars begin!
offtopic i know, but is anyone else able to load the article link? my firefox goes nuts and freezes when i try..
-- lol pwned
Interoperbility is a great idea. I'm not sure if I buy unification though. Parrot might make a wonderful VM, but I simply cannot imagine it'll be able to stand alone. dotnet's virtual machine is fine, but it was clearly limited in scope and for all they the alternative dotnet languages just cannot overcome many of the static (v. dynamic) language limits built into the VM. Everything I read about parrot seems to indicate that it'll be a hundred times more dynamic, but I just cant picture anyone making a VM, what was the articles stupid word, oh yes, manipulexitious enough to be everything to everyone. Either the VM is abstract and the languages running on top of it have to start defining additional limitations to build functionality and we loose interopability, or the VM is overly rigid and people have to build something else.
Look at the modern langauges. Python is wonderful because its a wonderful scripting engine for C code, complete with eight hundred types of glue. Classpath is interoperable java. Dotnet can PInvoke normal libraries. Languages arent converging, they're interacting. Best of luck, please, oh please do your best to try, but I just cant imagine any being, god or man, making a VM so flawlessly unconstrained and yet utterly unifying that it can become everyone to everything.
More scripting languages built around an interoperable core would be delightful. But already there are far far too many libraries which have to be rewritten for each platform. How many SAX parsers need to be written, how many SOAP libraries, how many SAML parsers? Every language needs it own, and thats a crying shame.
What now? Do we go web services crazy and a SAML parser in Java as a web service for a dotnet application? Doesnt that seem a bit batty? Or do we break open IKVM and wholesave import the couple dozen of java libraries opensaml requires into dotnet? Every single protocol and xml-namespace faces this same barrier; what language do we build the interpreter in? how many times will we rebuild it?
My plea? Make Parrot truly interoperable. Not just by trying to bring the joyous miracle of parrot to every existing langauge concievable, but by interopting with the existing language ecosystems.
Myren
- In TFA1: whipituptitude
- In TFA2 referenced from TFA1: whipuptitude
There must be some disagreement on the conceptMay Peace Prevail On Earth
What is the best book to learn Perl starting from Perl 6? I notice that the latest (3rd) edition of O'Reilly's Programming Perl is from over five years ago, and the latest (4th) edition of Learning Perl seems to still be about Perl 5.
Ok, Perl6 does indeed look cool. Lots of interesting things there. Sure, you can apparently write Perl6 code today and run it on PUGS (a Haskell implementation of Perl 6; that's gotta be speedy, eh?). But as is mentioned in the article, Perl6 was announced at OSCON 2000; that's 5.5 years ago. It's now become the posterchild for vaporware in the open source world, hence this article to keep the faithful hopeful (and to keep'em from sneaking off to Ruby, Python or even Io). Really, it just looks like the purpose of the article is to say "yes, we're still here working on Perl 6. We're working hard, we really are. Please, don't lose hope. This is hard work. It'll be here one day and it'll be great", while a lot of Perl folks who yearned for something better have already moved on to Ruby or Python.
I really hope that Perl 6 arrives one day. I'm pretty deep into using Ruby these days having left Perl 5 behind long ago (the part of the article about what's wrong with Perl 5 was really superfluous; maybe it was intended to convince the remainingn Perl folks who are happy with 5 to check out 6), but I'll give Perl 6 a look when it arrives. The grammar support alone looks pretty awesome; it'd be great to have a viable lex/yacc alternative. In the meantime I want to learn some languages that have a bit more immediate promise like Io. It seems that maybe the plans for Perl 6 were just too ambitious. Yes, it's great to start with a clean slate and try to revolutionize, but often it's evolution that wins out.
In other words, the spec still isn't nailed down. I may have only been been loosely following Perl 6's progress, but having seen the concatention operator change from . to ~ to _ during Perl 6's development, I'll wait until the final spec comes out, thanks.
GLaDOS for President 2016! "Well here we are again. It's always such a pleasure." -- GLaDOS, 2011
Just checked my new, freshly installed, CentOS 4.2 X86/64 Opteron server to see what flavor of PERL it's running - and....
perl 5.8.
Come on now, how long as Perl 6 been in beta? According to this page, it's been an ongoing effort for at least 3 years, and the oldest link on that page talks about how long it's been since a Perl 6 update!
It's like waiting for the next release of Debian - don't hold your breath, don't delay your shower. Check back when your grandson has his first kid.
I have no problem with your religion until you decide it's reason to deprive others of the truth.
I hear Duke Nukem Forever is being rewritten in Perl 6.
Love many, trust a few, do harm to none.
...it's more consistent and easier to use than Perl 5
Some thing are just so easy there's no pride in it. Now make something more wich is harder to read then Perl 5 and you've achieved something. It may be better, but is it good?
I hope you're sitting down since this might come as a shock but ... theres
more to C++ than the STL! Yes , I know , its amazing isn't it that a language
thats only been around 20 years and is based on C which has been around for
over 30 is more complex than this , but, well son , its true. Until you
understand not just all the cool trendy OO and generic side but also understand
pointer arithmetic, indirection , word boundary alignment issues and 101 other
low level topics inherited from C then you DO NOT "know" C++ at all.
"My problem I see"
Your problem is you talk bullshit. Period. Go and relearn to speak
english like a human and not a marketing droid and we might listen to you.
I heard Duke Nukem Forever is written in Perl 6 and runs on Parrot
It doesn't say anything about me. :-)
Maybe it says something about /., since he both posted the story -- and wrote the article it comments on. And what I comments on is both true and informative (-: I don't care for the dig at lisp :-).
Karma: Excellent (My Karma? I wish...:-( )
I've still never understood the popularity of perl: it's a horrible looking and very obfuscated language which sits in the middle of the programming arena, i.e. where it servers no purpose. If you want fast complicated code, use C; if you want a script use ksh, awk or python - faster and cleaner.
Then, we have CPAN - the mangled mess of packages which makes fedora's rpm system look well managed.
And the worst bit: the perl zealots who insist of using this language for everything, even when they have to jump through hoops to get it working.
If perl was wiped of the face of the universe tomorrow, I for one would cheer!
if rateMe(points=-1, reason=troll): whoCares()
You hate perl because you don't know it very well...
The right answer is:
$ perl -l -MData::Dumper
$a = [[1,2],[3,4],5,[6,7,8]];
print Dumper $a
which yields:
$VAR1 = [ [ 1, 2 ], [ 3, 4 ], 5, [ 6, 7, 8 ] ];
(spaces trimmed to please slash's "postercomment" compression filter.)
It's better to be the foot on the boot than the face on the pavement. ~~ tkx Kadin2048
* In TFA1: whipituptitude
* In TFA2 referenced from TFA1: whipuptitude
With Perl, there is always more than one way to spell it.
Being bitter is drinking poison and hoping someone else will die
From the examples I've seen, I'm worried. Perl5 already has too much syntax for my liking (see the subthread on nested refs. yuck), and Perl6 seems to be going much, much furthur in that direction. Will it be powerful? You bet! The problem is that Larry thinks power is the sort of subtle change of inflection that can alter your meaning from "Greetings!" to "Greetings, shithead!", but only when the moon is in the third house. I'll hold off my judgement until it ships; I certainly owe Larry that much for how much use I get out of 5. In the meantime, though, I will be using Ruby as much as I can and wondering how anything else can be more fun to write in.
The question is "What is Perl 6"?
The Question is "Who Cares"
Does it have its own CPAN equivalent?
If it doesn't, it isn't a replacement for Perl. It might be a replacement for PHP or Python or Ruby, but not Perl.
Perl's biggest advantage over everything else is that it has one huge repository of 99.9% of the modules you'll ever need. In fact, it's probably most useful to define Perl's domains of competence by listing what the modules in CPAN are capable of doing.
Perl has some interesting semantic and syntactic features. It probably brought regexes out of obscurity and neglect. But CPAN is its single killer feature.
Without CPAN, Perl isn't Perl. Without a CPAN equivalent, your language isn't a Perl alternative.
How can you use my intestines as a gift? -Actual Hong Kong subtitle.
Thanks for your interest in Amber. I'm the author of Amber for Parrot which, although in the early stages of development, will hopefully become sufficiently complete to be really useful, sometime this year.
Although Perl 6 is a nice cleanup and enhancement, the Parrot Virtual Machine is going to be far more important to the computing world than Perl 6. Parrot will do for scripting languages what the JVM and .NET are doing for compiled languages.
Parrot is not yet functionally complete, but it's genuinely usable. It has been a delight to to target Parrot, because most things just work - and when they don't, the Parrot developers have gone out of their way to help.
Parrot development has been pretty rapid recently - although you can't always tell from the documentation which often lags behind.
Paid Q&A/Research
No, there's just more than one way to do it.
Perl 6 reminds me of the super-revamped, object-oriented COBOL that came out in the 90s -- by the time this perfect language was created (and it was a decent upgrade, although the OO stuff was so verbose it wasn't funny), COBOL 85 had such a huge installed base that COBOL 9x was irrelevant. The amount of code written to the COBOL 85 standard was immense, and most new development had moved on to other languages. Maybe Perl 6 can escape the Fortran 9x and COBOL 9x trap of being really great languages about a decade too late. The biggest hurdle Perl 6 is going to face is its own installed base. It will have to be 100% compatible with Perl 5 to get people with a code base of Perl 5 code to even think about using it. Plus, it needs to have a compelling story to tell. I was excited about Perl 6 five or six years ago.
...there you go, that's perl 6. Next...
Patriotism is a virtue of the vicious
Then I found myself back with C++ again. First I wrote my own List classes. However I soon realized that STL made available exactly the types of data structures that Perl has. Maps, Lists, Vectors. And since I understood what I was doing in Perl, it was so much easier to catch on with C++.
You should give scheme a try. It has builtin lists, association lists (maps), vectors, tuples, complex numbers, and much more. You'll wonder what all of the fuss about C++ templates and STL is. As for Perl, it is useful to process text files, but I wouldn't use it for much else. The syntax is somewhat baroque and gets in the way.
an ill wind that blows no good
Late.
Read my blog.
The developers made the classic mistake with Perl 6: they threw out what they had and started over. And they started over on too many levels: do-it-all VM, regular expressions, core language. At the same time, the language designers have been throwing in every feature under the sun, to where experienced Perl 5 programmers get dizzy reading the apocalypses. This is the language that makes C++ seem straightforward. In fact, we wouldn't even have a Perl 6 prototype at all--even after five years of work--if it hadn't been for a plucky programmer who took it upon himself to write one (Pugs) in Haskell. To a great extent that saved the P6 project.
The developers honestly should have started with the P5 code and incrementally made changes, eventually making sweeping changes.
Even after saying all of that, I'm still looking forward to P6, but I fear it may be a long wait. Long enough that I'm using Ruby and Python more and more.
Perl6 is late. No wait, it's vaporware!
Don't argue kids- It's both!!!!!!
Thanks Taco for yet another pre pre pre release announcement. Any news on my Mr. Fusion powered flying Delorean yet?
The Applachians will wash into the Atlantic by the time Perl6 is released. Unfortunately, Windows will still be insecure, however.
Uh wasn't it "Make easy things easy, and hard things possible"?
That's as close to "management speak" as possible without losing meaning and usefulness.
And to me that statement shows a great insight in the part of the Perl people.
Just as you can't compress everything well, you can't make everything easy.
You would like to make the easy and common stuff easy. But not make the hard things impossible (gzip works on everything even though it makes some files bigger).
So far Perl has been a good match to solving very many problems.
In contrast Python's favourite motto appears to be "one obvious way". I suppose if the one obvious way is rarely hard then it'll be fine, but I don't find that concept as reassuring.
PHP seems to be "Make it extremely easy to do common things, even if not correctly" (examples: addslashes, magic quotes, track vars etc).
A better question would be: WHY is Perl 6?
(and don't say "because 7 8 9", because that's the wrong answer.)
...welcome our new hash overloads!
BTM
That was the turning point of my life--I went from negative zero to positive zero.
The problem here isn't that Perl defines arrays or lists funny. The problem is in evaluation. In perl, ((1,2),(3,4)) isn't really equivalent to (1,2,3,4); but when the first is evaluated it becomes the second.
It was done to simplify passing arguments. If a function takes a variable number of arguments (like join or for the C folks, printf) you can pass a list and the members of the list will be expanded automatically as parameters.
Is it a good idea? Well, like many things in Perl that were done as convenience in one spot, it comes back to get you in other places sometimes.
As to it being intuitive, that's a strange argument. Computer programming isn't intuitive in any case.
http://lkml.org/lkml/2005/8/20/95
Once, I used Perl regularly for little scripting tasks, things that were too much for Bash but too simple to require a C++ program. Then I discovered Python, which was so powerful that it replaced not only Bash and Perl, but also C and C++. It did the same thing as Perl, but without quirky syntax, and soon turned out to be even more powerful. Perl appears to have been designed to replace Bash, and then hackers have added more features to try to make it more powerful (e.g. OO support). Whereas Python appears to have been designed as a general-purpose OO language, that just happens to be lightweight enough to be used as a scripting language. I think that anyone who has tried both Perl and Python will be left in no doubt about which language is superior. Good design speaks for itself.
You're an immobile computer, remember?
A recruiting tool for the Python and Ruby communities.
GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
Will Perl 6 finally end the sheer madness of allowing a function to use loop control statements like next and last to meddle with the loops in their calling functions?
Some of us have predecessor's code to use and maintain that do the darnedest things, you know. A bit of protection from the madness of others, that's all I'm asking for.
Perl 6 is so late that, unless they do something to really make the language attractive (and language features on their own won't do it), nobody is going to use it. What I would do if I were them would be to target the .NET/Mono CLR instead of their own proprietary VM. That would instantly give it interoperability with (almost) every language that actually matters, a high-performance and well-tested runtime environment, and a very complete and well thought-out class library (not to mention the piles of 3rd party libraries that are built on .NET).
Yeah, yeah, Microsoft bad, and so on. Fuck that. They need to be practical instead of dogmatic if they want to get this language accepted and used, and targetting the CLR would be a perfect way to do that.
-Matt (who was excited about Perl 6 half a decade ago)
This works out to use arrays of pointers to arrays for all but the last dimension. So the code actually creates @A as an array of pointers to the other arrays (which perl calls references) The [ tell perl to return a reference. The ( tells perl to return a list. For a 3 dimensional array so prints "Help"
The first index tells it to select the array containing references to the arrays containing "Help" and "I'm". The second index selects the array containing "Help". The final dimension selects the string "Help" from the array. For me at least it helps to visualize it as a tree: With the first letter of each entry showing where it is on the tree. (^ added to preserve formatting through slashdot lameness filter...) So in summary you have the list @D = ("Help", "Me");. you grab a pointer to it and put it in another array as the first entry $C[0] = \@D;. Then you take a pointer to that and put it in the main array as the first entry $B[0] = \@C;. Then you repeat this for each element you want to add, putting them in the appropriate entry in each array. Voila you have a multidimensional array.
(Note that I have not tested any of this with perl5 since I don't have it on my work PC, so I may have some small typos, but the theory is correct)
Of course statically dimensioned arrays (in C anyway) are usually optimized by the compiler into a single array that use an index calculated by multiplying one of the dimensions size by the other dimensions index and then adding this result to the other index. This is actually faster in some cases (especially on x86 machines which support this via a single instruction) and avoids keeping the extra arrays of pointers.
Wow. You must be a Pythonista, with that kind of pedantry.
...any day. /disclaimer: quit my job to do ruby/rails after looking at the competition out there, needed a switch from ASP/SQL Server, very happy so far
Imperfect lexical scoping is hardly a showstopper. Definitely a nice-to-have, though.
You know what? I'll take this (known, and will possibly be fixed) oversight, over looking at fugly code (all day, every day)
I believe that this is what you are slandering on about, and this is one possible workaround.
;) The readability alone is a huge win over other languages (IMHO).
I asked around in #ruby-lang about this, and this is not only the #1 bug in Ruby, it will be fixed in 2.0.
If you had a more concrete broken-lexical-scoping example, please feel free to provide.
In the meantime, if this is the biggest Ruby bug, I'm planning on sticking around for sure
Perl is between awk and C? By what strange measure? Some spectrum where "complex" is on one end and "cumbersome" is on the other? A strange measure indeed.
Perl is hardly "lower level" than awk. Indeed, Perl comes with a richer language, piles of useful support libraries, and the CPAN archive for even more useful libraries. All of these taken as a whole should make Perl a good fit for problems that are "too cumbersome to write in C" while being even more efficient to write than awk.
If awk's solving your problems, great. There is always more than one way to do it, and awk's a fine way. Indeed, I occasionally run into places where Perl seems overkill and break out awk myself. But for anything but simple tools I can whip up Perl solutions faster that I can write an awk or awk-and-other-shell-programs solution.
Search 2010 Gen Con events
Ruby's ugly second cousin, twice removed.
See Nitro web framework for a better framework than RubyonRails. Also see the Og project on the page, a competitor to ActiveRecord.
Long live opensource!
PHP is just too perfectly adapted. Perl 6's dialect programming flexibility could match PHP's specialized design, but not its simplicity. It might displace Java which was always a bit of an expedient rough fit (as witness the innumerable layers of Struts/Hibernate/servlets/blah that basically amount to smoothing the corners).
On the other hand, Perl 6 is likely to take some other niches nobody might have expected. It's probably the first language to surpass Lisp in the ability to be metaprogrammed.
P 6 seems to have every single feature it's implementors could think of. I wonder if this will end like PL/I. They'll have a language that never gets fully implemented.
It's not only that, it's the fact that there's no way of explicitly declaring local variables in Ruby. So if I declare a variable i within some scope, I have no way of knowing whether or not I'm overwriting a variable 'i' in a higher scope, or creating a new variable. In Perl all local variables are declared with 'my', so this problem doesn't arise.
Freedom is not increased by mere diminuation of government. Anarchy is freedom for the strong and slavery for the weak.
I guess it depends what you mean by "large scale" programs. If you're talking about web development then maybe the Slash codebase is large. In general, it's pretty small. It seems common to define a large codebase as one with over a million lines of code, and tens of millions aren't unusual.
In fact, if you look at the history of Slashdot and the comments by the guys who developed and maintain the code, it's quite an interesting catalogue of the good and the bad of Perl. The devs took some neat ideas, and have implemented them effectively and from what I can tell reasonably quickly. OTOH, any non-trivial changes seem to be rather hard work for the dev team, and there have been some apparently simple (to the user) bugs that have gone unfixed for months.
If we take this as representative of Perl code in general (which may or may not be fair) then it seems Perl is good for quick prototyping jobs and mostly write-only code, but not so good for long-term maintenance of larger developments. But I guess most people here already knew that. :-)
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.