Run Perl 6 Today: Pugs 6.0.11 released
autrijus writes "I am delighted to announce that Pugs 6.0.11 is released, with experimental pugscc support to turn Perl 6 programs into stand-alone executables, as well as many new features. Pugs is an implementation of Perl 6, written in Haskell. For more information, see Pugs Apocryphon 1 and this perl.com interview."
I have been following this with interest. My only concern about this excellent project however is if using Haskell limits the potential developer base that might contribute.
Bush and Blair ate my sig!
I mean is there already a full specification for the language? If so what are people waiting for, Parrot?
Your CPU is not doing anything else, at least do something.
I thought Perl6 had a language-independant runtime called Parrot. What happened to that?
An implementation of Perl 6.. in Haskell?
There is something that feels.. oddly.. wrong about that. I can't put my finger on it.
It's kind of like the feeling I got when I watched a porno with a hot girl and a really hairy guy.
Hrm... I'll have to download this.
-Laxitive
See this journal: Perl 6 Implemented ... in Haskell for more info and links.
The Pugs implementation effort is test-driven. In many cases, a few hours pass between the arrival of a new test and the implementation of a feature. So, anyone who knows (or would like to try) Perl 6 can contribute tests to Pugs. No knowledge of Haskell is required at all.
One of the goals of Perl 6 is to make non-trivial projects possible. That's good. The way it's being done is bad. Perl was once a lightweight, extremely flexible language. Now it's become a huge ugly monster. People wanted OO, so a nasty hack was bolted on top to allow some semblance of it. Now this nasty hack is being expanded. Sure, the code's different, but the basic form is the same. Kludge upon kludge upon kludge; I'd much rather have a nice, clean, pure language (and not one with loads of irritating whitespace thank you very much).
The same goes for the syntax. All the switching between $, @ and % is really irritating (ask a newbie how to get at the length of the keys array of a hash inside a hash, for example), and the changes proposed for 6 are just making this worse -- it seems that Larry, in his infinite wisdom, wants to prefix every data type with a different hard-to-type character. Perl was only designed for the three data types, and adding more is a mess.
Perl 6 is a complete rewrite, but it keeps all the mess which has accumulated over the previous versions. This is not good. Sure, my const int $var = 27; may look neat (in the same way that, say, Pascal does), but $var isn't entirely constant, or entirely an integer, it's just a hack which makes it sort of behave like one. It's like Ada all over again! The whole thing is an exercise in pseudo-computer science masturbation with little real purpose except to please the managers who dislike the one thing that makes Perl special.
On a similar note is regexes. I'm an avid fan of regular expressions simply because a nondeterministic finite automata is far more flexible than linear code. However, Larry must have been smoking that cheap $2 crack when he wrote this. Does he want Perl 6 to be flex or something?
I won't be going on to use 6. It's a nice idea, but it's completely unnecessary. It won't make large projects any easier to manage (the language is still, at heart, an almighty hack -- an impressive one, but still a hack). It won't make OO any cleaner. It won't make development any faster. I'd prefer to use a language which has always been pure synthesis of science and engineering, not some half-baked imposter.
Perl 6 will be nice, but I'm guessing it will be the end of Perl. It can't do what it wants to do whilst still being based upon a nasty mess. There are now other options, which provide all of Perl's power and none of the mess. Sorry, but *BSD^H^H^H^H Perl is dying.
1) Think up Pugs
2) Write it in Haskell
3) Get an implementation of Perl 6
4) ???
5) Profit
"Play is the only way the highest intelligence of humankind can unfold." -- Joseph Chilton Pearce
Well, I can tell you have some pretty strong feelings on this subject. I'd just like to add a few comments from my perspective as another long time Perl user...
Let me start by saying that I've read all of the perl6 documents with great interest and have almost universally been pleased with the changes that are being made. In all cases, I appreciate how most of the decisions are being made and that the concepts of useability and clarity are taken as important overarching goals. As an example, if you actually read apoc 5 which you linked to as an example of "smoking crack", you'll see that one of the main goals is "better huffman coding" - ie: making frequent tasks easier to express than infrequent tasks and that another is to make regular expressions more readable and maintainable and less like line noise. These, to me, are eminantly admirable goals in a scripting language.
On OO, Note that Perl6, unlike Perl5, is being rewritten with OO at its core, not as an expansion to the previous "nasty hack".
Note also that the perl6 team shares many of your issues with perl5's OO implementation and wants perl6 to be better: Apocalypse 12.
Similarly, when you complain about $,@,% and how confusing they are, you seem to be complaining about perl5isms that perl6 is dedicated to addressing...
In answer to your length of the keys array of a hash question, just use (keys %hash) in a scalar context, or (keys %hash).length. In your specific case, because the hash in inside another hash, you're looking at something like (keys $hash{"key"}).length; ... which doesn't seem particularly brain melting to me, especially compared to perl5. I also don't see this threatened horde of new datatypes you seem so angry about. I really recommend that people interested in what these differences will bring read the Exegesises, where equivalent perl5 and perl6 code is usually compared.
"const int $var = 27;" ? Did you mean something like "my int $var is constant = 27;"? What specifically do you mean when you say that it isn't entirely constant or entirely an integer, and why does it matter?
I completely have no understanding of why perl6 would please "the managers" or what this "one thing that makes perl5 special" is that you think is being lost. As far as I can tell, perl6 keeps everything that I thought made perl5 special and aims to clean up many of the things that make it a PITA.
"It can't do what it wants to do whilst still being based upon a nasty mess." Isn't that why perl6 is a complete rewrite? What unholy mess are you referring to? From your post, I don't believe that you're one to be swayed from your beliefs, but many of your arguments appear on the surface to be based more on emotional response than factual backing...
Well, at least some of them.
I created a small Win32 project in Perl for my previous job (which I still maintain on occasion) to help IT people manage groups of machines more effectively (by storing hardware/software/license key information in a central MySQL database using an extremely simple but powerful program. If anyone's interested, the project homepage is here).
.exes to a single stand-alone exe. I see that GHC has support for the same ability according to the article. I was curious what practical experience anyone had using it on the Win32 platform and how its feature set/compatibility compares to Perl2exe.
I tried to use freely available software to create my program, but I didn't want have to install Perl on all the machines. So, I used a IndigoStar's Perl2Exe to convert the script and some dependent
-- Political fascism requires a Fuhrer.
Autrijus has accomplished more for Perl6 in one month of development than the two dozen people working on Parrot did in the past 3 years. It certainly proves that one individual can be 100 times as productive as their peers in the programming field. The big difference appears to be that Autrijus actually has a plan and a logical design. I do find it puzzling that the initial Perl6 interpreter is not being written in Perl5, though. Obviously speed is not a concern at this stage - only correctness. One hundred times as many developers know Perl5 than do Haskell. But, who can complain - Autrijus gets results. Eventually he plans to recode the P6 interpreter in P6 anyway. At his current pace perhaps it will only be in a month or two.
Tabs are not that bad; you just have to be more careful. If you can handle tabs consistently, then tabs are fine. (I happen to use spaces because I've gotten used to it, but spaces do have their disadvantages...)
Well, I'm not sure that it's entirely accurate to say that Perl 6 has objects at its core. That is because the concept of "core" is itself only a loosely defined concept.
The fact that the object system is defined in S12 shows that they are not exactly "core" to the language, but they are definitely deeply ingrained, and widely employed. And consistent. And inflectable. And flexible. And not conforming to rigid ideas about what they should be.
Yes, this is the point where you should get worried. Some guy has just started rambling vaguely about benefits of a system that is still very much vapourware, and promises so much that you have to wonder how it will *ever* be implemented, let alone be implemented in such a fashion that we will ever get to the point where a single Perl command might end up as a single CPU cycle.
What I've seen so far has led me to think that it might just be possible, so I have to satisfy my curiosity...
As Larry said in Apocalypse 12, "The length() function is gone" because "[it] has been deemed to be an insufficiently specified concept, because it doesn't specify the units."
In other words, is $x.length the length of $x in characters and @x.length the number of elements in @x? What if $x is an array reference? What if we want to know the number of characters in @x, as is often useful when the array in question is the output of other program, or stdin? We could use a hyper version of the length method or junctions, or map, or loop, or...
But simple things should be easy, and the length method would be ambiguous. So there is no %hash.keys.length in Perl 6. There is %hash.keys.chars and %hash.keys.elems, or just %hash.elems. The references to container data types are automatically dereferenced, so $hashref.elems does what you need without the need to explicitly dereference anything.
Summarising, the correct version of (keys %hash).length in grandparent post should be %hash.elems and (keys $hash{"key"}).length should be %hash{"key"}.elems which seems quite straightforward if you ask me.
If it makes too much sense then you certainly shouldn't read the rest of Apocalypses, Exegeses and Synopses. You have been warned.
Sincerely,
Pan Tarhei Hosé, PhD.
"Homo sum et cogito ergo odi profanum vulgus et libido."