Slashdot Mirror


Perl 6: Apocalypse 6 Released

data64 writes "The latest Apocalypse talks about subroutines. Looks like we finally get type signatures which are way more powerful than the rudimentary prototypes available with Perl5."

40 of 247 comments (clear)

  1. Apocalypse Now by nizcolas · · Score: 3, Funny

    I love the smell of sub routines in the morning

    --
    If you get an error, type "OVERRIDE" or "SECURITY OVERRIDE" and then try the optimize command again.
    1. Re:Apocalypse Now by rob-fu · · Score: 4, Funny

      I love the smell of sub routines in the morning

      ...and it smells like unwashed, dirty programmers.

  2. More Information by Anonymous Coward · · Score: 3, Informative

    The Previous Apocolypses as well as some more info (who's who, list summaries). Read up!

    On another note, is Perl 6 even going to be relevant with next-generation languages like Ruby and Python already fairly mature? ;-)

    1. Re:More Information by Skald · · Score: 4, Interesting
      On another note, is Perl 6 even going to be relevant with next-generation languages like Ruby and Python already fairly mature? ;-)

      If Perl6 goes according to plan, absolutely. In fact, it'll be particularly relevant to Ruby and Python.

      More than any other thing, in my opinion, Perl has CPAN going for it. Other languages have tried similar code sharing projects, and none of them have come close to matching CPAN's breadth and (despite the occasional wonky module) usefulness.

      More than any other thing, in my opinion, Java has the JVM going for it. Not that it's the only virtual machine out there, but it's the only one which really has broad distribution. The ability to distribute compiled bytecode, and to run it in a "sandbox", are two of Java's biggest selling points.

      If Perl6 succeeds, neither of these languages will keep their greatest advantages. Perl6 is merely to be a Parrot compiler... and where Sun has actively tried to keep other languages off of the JVM, the Parrot developers want to entice other languages onto the Parrot. Any languages rewritten to target the Parrot, then, should (given some hooks, perhaps) be able to take advantage of the CPAN modules which are the wealth of the enormous Perl community.

      To the extent that Perl6 succeeds, Python, Ruby, Scheme, O'Caml, and who-knows-what other languages stand to find themselves able to "write once, and run anywhere". Potentially, this could lower the bar for new and interesting languages to compete, since they'd primarily be competing as languages, with the runtime environment issues (more or less) abstracted away. In the same way that Mozilla allowed for today's proliferation of browsers, Parrot could be a very good thing for languages.

      But while Perl6's progress will certainly be relevant, in the long term it risks obsolescence by virtue of its own ambitions. Frankly, if that were the case, I don't think it'd bother Larry all that much... however the Perl community doesn't seem to be ready to go gentle into that good night. A lot of Perl6's remarkably ambitious agenda seems to me an effort to stave off the possibility of the danger that Perl will become a victim of its own, and Parrot's, success.

      --

      "The best we can hope for concerning the people at large is that they be properly armed." - Alexander Hamilton

  3. Perl is turning into a completely new language by siewsk · · Score: 4, Interesting

    I remenber the days of perl 5.004 and boy was that good and compact! Then as time so pass, more and more "features" are added into perl 5.004 and the result is that now you have too many features spoils the broth. As perl 5.004 it is PERFECT for replacing bourne shell, sed and awk. But instead of being stable (and not changing), it kept on changing. This is bad from a system admin point of view because you want to be sure that the script you wrote in 1999 will work in 2019 without any changes (just like bourne shell).

    Instead if Perl kept on changing then you can't be sure and when you have literally thousands of little perl scripts everywhere this is intolerable.

    Perhaps they should have kept Perl 5 as /usr/bin/perl5 and make sure that it stays static for all eternity. There are values in things which do not change, things you can depend on year after year without fear.

    1. Re:Perl is turning into a completely new language by terraformer · · Score: 4, Interesting
      Then as time so pass, more and more "features" are added into perl 5.004 and the result is that now you have too many features spoils the broth.

      No, most of these "features" as you call them are not added into perl, they are added in as bundled modules. Perl's core is kept small for this very reason. As for Perl 6, that is going to be radically different but perl5 will be able to live on the same machine as perl 6 and I would imagine that a great deal of people will keep both around and maintain both for a great while.

      --
      Who are you? The new #2 Who is #1? You are #617565. I am not a number, I am a free man! Muhahaha.
    2. Re:Perl is turning into a completely new language by Enoch · · Score: 5, Funny

      Then as time so pass, more and more "features" are added into perl 5.004 and the result is that now you have too many features spoils the broth.

      I'm sorry. I think you are looking for this every-feature-is-in-the-core language.

      Glad to point you in the right direction!

      enoch

    3. Re:Perl is turning into a completely new language by antis0c · · Score: 3, Informative

      You obviously aren't aware of exactly what Perl 6 is. It's more than just a language, it's a whole runtime environment similar to .NET or Java. When Perl 6 comes out you can continue to use your Perl 5 scripts with it, or write scripts in Pascal, or in C, or in Java, or in BrainFuck. The compiler and runtime are completely separated.

      --

      ..There's a-dooin's a-transpirin'
    4. Re:Perl is turning into a completely new language by Istealmymusic · · Score: 4, Insightful
      I'm reminded of a quote:
      We biologists have a special word for stable. It is "dead".
      --
      "The lesson to be learned is not to take the comments on slashdot too literally." --Vinnie Falco, BearShare
    5. Re:Perl is turning into a completely new language by jbolden · · Score: 3, Informative

      The default on perl 6 is to use perl 5 compatability mode. So you won't need both.

    6. Re:Perl is turning into a completely new language by kisielk · · Score: 3, Funny

      I am so looking forward to Microsoft BrainFuck.

      It's called Visual Basic ;)

  4. ughgh by Anonymous Coward · · Score: 3, Interesting

    This is why I hate Perl

    multi *caller (?$where = &CALLER::_, Int +$skip = 0, Str +$label)

    my brain can't grok that

    1. Re:ughgh by Kaa · · Score: 3, Interesting

      But a higher level scripting language should be as close to english (or another human language) as possible

      No. That's conceptually wrong.

      A (programming) language should make it easy to construct solutions for problems it has been designed to solve. Natural languages, such as English, are good for certain sets of problems and quite bad for other sets of problems.

      Would you like to replace math notation with sentences in English?

      --

      Kaa
      Kaa's Law: In any sufficiently large group of people most are idiots.
    2. Re:ughgh by SuuSt · · Score: 3, Insightful

      Heres the thing though, sure I have no idea what that says, but that's just because somebody decided to be very clever/brief/or both. Half my job is to write Perl scripts and sure there are about a million neato tricks that I could use to make my code really short and impossible to read but I never learned them and have no intention to. If you want, Perl can look more or less exactly like C, or if you want it can look like the above. It's all a matter of what you want out of perl.

      When they say theres more than one way to do it, syntax is included in there too.

    3. Re:ughgh by vadim_t · · Score: 3, Insightful

      I think I have been trolled, but I'll reply anyway.

      Once I was bored and wrote one line of C code that iterated over an array, and printed its elements separating then with commas, and printed an "and" instead of a comma for the last element. The code consisted of a for, a printf, and ? :'s in it.

      Now, don't try to tell me it was readable. Every language can be used to write horrible code.

      Besides, that doesn't even look as Perl. "?$where" makes no syntactical sense, variables have names like $where and that's it, "Str + $label" makes no sense either, unless Str is a constant, and "Int +$skip = 0" makes about as much sense as in C, because supposing it's comparing an addition with 0 it should be using ==.

    4. Re:ughgh by kmellis · · Score: 3, Interesting
      "Actually from a grammer standpoint Perl is far closer to a real human language than almost any other language."
      And let's not forget that Wall's education is as a linguist, and not as a computer scientist.

      To my mind, the best computing language designer would be someone with extensive education and experience in: computer engineering, computer science, linguistics, mathematics, engineering and business processes, maybe psychology, and perhaps some other things I'm forgetting at the moment. My point is that a good designer would have a very strong comprehension of the problem space (the problems this tool is intended to solve), how the tool is likely to actually be used in the real world, how the problem space will evolve over time, all coupled with a very strong comprehension of the most efficient method of implementing this tool in the technology available. That's asking a lot.

      In Wall's case, I think that he has a fair amount of experience as a practical coder, which is the impetus for his extremely strong emphasis on pragmatism in his language design. This would be a disaster for most designers, probably, but Wall's education in linguistics probably tempers that pragmatism with some comprehension of higher-level abstraction and some imposition of rigor. You can most clearly see this aspect of Wall's world-view coming through in the Perl 6 design.

      However, even though in some sense the scientific view related to linguistics is an abstraction similar to the scientific view of computer science, they're fundamentally dissimilar. Linguistics is an attempt to comprehend and formalize a very complex and exquisitely functional system--human language. In contrast, Computer Science is not a descriptive science; it tends to be proscriptive--looking for the best way to do things, often from an ahistorical almost-Platonic perspective. As a result, it tends to be overly ideological. I chose the word "proscriptive" with some care, as in the realm of human language it identifies a fault line. Linguists tend to be notoriously relativist, asserting that what is "correct" is simple what exists. Proscriptivists, such as one's fourth grade English teacher, insist that there's truly "correct" and "incorrect" usage. In this sense, Wall's background in linguistics clearly has influenced his philosophy of computing language design; and, I think, computing language purists really are psychologically akin to the proscriptivist grammarians like the aforementioned fourth grade teacher.

      For my part, in the realm of tools, I prefer aesthetic purity or elegance only when it serves utility (or, at least, doesn't interfere with utility). Perl is well-matched to its problem space, and in this it actually does have, in my opinion, some beauty. I mean, from one perspective a Swiss Army knife is god-awful ugly; but from another, its compact and wide-ranging utility is attractive. Because Perl is intended to operate in such a large problem space, I believe that simplicity, and the form of beauty that is a function of simplicity, is largely denied to it. So? We can't have everything. Ideally, there'd be a wide range of computing languages each perfectly and exquisitely engineered for their respective problem spaces. But, right now, computing isn't even close to being mature enough to support such a thing. In other engineering and science disciplines, there are a variety of tools and methods and specializations each well-suited to the problem domain they serve. And it works because a civil engineer isn't expected to do nuclear engineering work, nor an astrophysicist to do nuclear physics. But programmers are still expected to be jack-of-all-trades, and thus their tools are required to be as versatile--but also as unoptimized--as they are.

  5. Don't forget Parrot by Ars-Fartsica · · Score: 5, Insightful

    The VM is showing 10x speed improvements in preliminary tests. Couple that in with Moore's law and Perl (or any languages that compiles to the Parrot VM) becomes a very attractive language for more types of problems.

    1. Re:Don't forget Parrot by evronm · · Score: 3, Interesting

      I agree. When parrot comes out, there will essentially be 4 development platforms:

      • JVM
      • MS.NET
      • Parrot
      • low level (I'm lumping C and ASM here for the sake of brevity)

      The fourth will be used for applications where speed is really key (real time, database engines, OS's, etc.)

      For all other apps, it will be a matter of choosing one of the other 3 environments, and a language.

      This choice will be particularly interesting given the fact that some languages (e.g. perl) will work with more than 1 of these environments (.NET and Parrot).

      It's going to be an interesting world...

  6. Perl, the new ADA by ajm · · Score: 5, Interesting

    I used to think that perl might become the new COBOL. Now it looks like it's going to be the new ADA. Lots of nice features but such complexity and cleverness that even the people who use it don't like it. ADA's a good language, but no one uses it. It would be a shame if perl 6 went the same way.

    Perhaps the cleverness of the ideas are not being tempered by real use at this point. A language does not become great by adding new syntax and semantics for each feature but by refining it to the essential units needed to express all the rest. We should not celebrate the fact that "will" and "is" are very similar ways to express traits in perl 6. We should ask instead why do we need both? Further, is it possible for me to define a new "wont" statement in perl, or are "will" and "is" special things only language designers can implement?

    1. Re:Perl, the new ADA by James+Lanfear · · Score: 3, Insightful

      Lots of nice features but such complexity and cleverness that even the people who use it don't like it.

      IME, Ada is exceptionally well-liked by the people who know it (note: use != know). I've seen far fewer complaints about it from Ada programmers than I've seen from, e.g., C++ or Perl programmers about those languages.

      ADA's a good language, but no one uses it.

      Right, just like how no one uses Linux on the desktop.

    2. Re:Perl, the new ADA by gse · · Score: 3, Insightful
      Ada is, in fact, a really great language. It's not really that complex (though Ada compilers are) or clever; in fact, it reads more naturally than most languages I've used. (and much more naturally than most perl -- talk about cleverness.)

      I attribute Ada's glorious failure to a few things, and none of them are the language itself:

      • It was developed by the gov't. Nobody likes the gov't.
      • The compilers are, like I said, really hard to write. So it took a long time for them to get implemented right, and there sure weren't any free (or even "affordable") ones for a long time.
      • And the big one: no standard set of class libraries. No Java-like API, no STL, nothing. If you wanted a linked list you had to write it yourself. The Java API is half the reason that Java is so great to work with, and IMO has a lot to do with the language's success.
      I really liked programming in Ada. I hated it at first (coming from being a C hacker in college) but in hindsight, it's the only language I've used that left me a better programmer.
      --
      wordclock records :: flailing since 2000
  7. Perl 6: Replacing old cruft with new cruft! by wackybrit · · Score: 3, Insightful

    I am a Perl fanatic. I love Perl. But what is going on with Perl 6? The guys working on the Parrot VM for Perl 6 are doing such an amazing job, but I'm pretty dismayed about the language development on Perl 6 itself.

    Perl 6 was meant to be a total rewrite. Nothing was meant to be sacred, cruft could disappear, and we'd be left with a mean language, true to its roots, and working on a hot new VM.

    Instead we get stuff like this:

    sub *print (*@list)

    Talk about confusing! * signifies a glob, but in the above example the first * signifies a sort of 'package wildcard' meaning that the subroutine is global! The second *, however, is a glob, as in Perl 5. WTF? Perl 6 looks almost as inconsistent as PHP already, and it's only in draft!

    Each page of this Apocalypse presented me with a new piece of cruft to look horrified about. Slurpy arrays!? Oh my god. Wall even goes on about 'psychological reasons' for syntax! 'Default values' and 'Rules' are things that are easily done with existing code.. it's not even as if they result in particularly crufty code in Perl 5.

    I'm still looking forward to Perl 6, but it really does seem as if Parrot is where the true action is. Perl 6 really does look as if it is being designed by committee.

    1. Re:Perl 6: Replacing old cruft with new cruft! by gmuslera · · Score: 3, Interesting
      Instead we get stuff like this:
      sub *print (*@list)
      Talk about confusing! * signifies a glob, but in the above example the first * signifies a sort of 'package wildcard' meaning that the subroutine is global! The second *, however, is a glob, as in Perl 5. WTF? Perl 6 looks almost as inconsistent as PHP already, and it's only in draft!

      Perl is more based in natural languages than in "traditional" programming languages. In natural languages, what you are saying depend on the context, the same words say different things if they are used in diffeerent situations or positions inside a phrase.

      Well, in perl that also happens (in perl 5 you'll find a lot more examples of this, starting with the "$" in $a, $a[1] and $a{"red"}).and I think that it was more common in the previous versions (at least in Perl 6 I believe you'll have $a, @a[1] and %a{"red"})

    2. Re:Perl 6: Replacing old cruft with new cruft! by angel'o'sphere · · Score: 3, Interesting

      The interesting thing about Larry Wall is: he is a linguist. That is a scientist researching how the human mind works with language, how language is structured and how language works.

      I have heared that he explained in his first books how perl works from natual language point of views.

      In the Apocalypses I saw also a lot of reasoning about how something is seen by a the human mind.

      I can not help myself. But PERL transforms even more into a unreadable language.

      I wrote a lot of perl scripts in Perl 4, about 300k LOC. After not looking at them after 1 or 2 years C++ coding, most of the tricks I used I did not understand anymore ... erm, thats 6 years ago, Perl4 is nealry 10 years ago.

      Every time when I see a post about a new language I jump on it as I was a language geek when I started programming.

      As soon as I see more than one $ or % or # sign in a sinlge line of code, I just trash the language.

      I simply can not get why this is needed. I fully agree with the one who said programming languages should approach english. (probably because I learned Pascal as first true programming language, after BASIC and assembler)

      I think a programmer should be able to read any program in any language. Or at least should be able to get a clue about what a program does, and how it does it.

      Thre are so few constructs: variables, declarations, definitions, statements, structures, arrays.

      Around that some programming concepts are woven .. imperative, declarative, functional ....

      Why to make that more complex by silly abreviated keywords? (sub in perl, def in python) By useless and meaningless (for a uneducated reader) $ and # and % signs?

      Perl is a language you an not learn by examining perl programs. You need a geek explaining it or time to read ALL docs. Thats a true draw back .... everybody who knows Pascal, C, C++, Ruby, Python, Ada can read Java.

      Thats basicly why I stopped using perl. When Perl4 emerged I thought, better than C-shell definitly ... now I write bash ...

      Well, and I left C++ and went to Java :-) With Java 1.5 I have all a language needs, except multiple inheritance :-/

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  8. perldocs already far beyond php.net docs by Ars-Fartsica · · Score: 3, Informative
    perldoc -f $FUNC

    Does php provide anything like this?

    What I typically hear and feel myself is that the php site documentation is sparse to a fault, with a great deal of useful information simply left out. Check out how many holes are filled in by contributors at the bottom of each page of the php.net site docs. These are glaring ommissions.

  9. Why perl will survive: by mcc · · Score: 3, Informative

    I dont see the inherent advantage in desinging a language thats hard to read.

    This is what's great about perl 6. Yes, it has so many insane features and rediculous complex rules and bizarre exceptions to its rules that when reading code with someone else's programming style, you may as well be reading a different programming language (Quick! What's the difference between "sub foo will do { something() }" and " { something() } " ?).

    But the real strength in perl 6 is that it's just about infinitely configurable. You can redefine the grammar to fit your needs or whims. This is going, naturally, to cause 17 year olds who load their grammars up so much with wierd macros that their programs will become literal line noise that ceases to function if you change one character, but it will also mean that in the "enterprise", you can be completely shielded from the messiness. All it takes is defining a specialized version of "use strict" that reduces the language down to what you need, and suddenly perl 6 is some very simple, simple, easy to understand language. As long as the speed's OK, people enforce standardized coding within an organization and the default -w is really careful to warn you if you say { 1, 2, 3 => "a" } and it looks like what you probably meant was hash { 1, 2, 3 => "a" } , i don't see it being a real problem. And from a compatibility stndpoint, having one language with EVERYTHING and the ability to cut out what you don't need in wide swaths is way better than recurring situations where people go "well.. i want to use java, but i need feature X" and wind up using some funky third-party jvm compiler that produces huge executables and requires funky tricks to incorporate into my build cycle."

    Perl 6 is as hairy as you want it to be, and no more.

    Perl 6 is going to be the bestest second system ever! ^_^

    1. Re:Why perl will survive: by mcc · · Score: 3, Insightful
      Yay lisp! er, I mean perl!

      As far as i can tell, perl 6 is supposed to evoke four main reactions:

      • Whoa.. It's Scheme, but I don't have to deal with the pervasive suffix notation and all those parenthesis!
      • Whoa.. It's Smalltalk, but less heavy on the Everythings-A-Message pounding and without all those wierd hard brackets!
      • Whoa.. It's K, but without the need to completely rethink how i program!
      • Whoa.. It's Perl, but the object system isn't an eyesore and the reference system doesn't make your head explode!
      Or, alternately:
      • Whoa.. It's a language with all the neat functional-flow-control bits of ML, but I don't actually have to write in ML!
      • Whoa.. it's Objective C, but everything's an object, and no need to muck about with C types and baggage unless i really want to! or Whoa.. It's Java, but everything's an object, and there aren't any rules!
      • Whoa.. It's APL, but without the need to completely rethink how i program and buy a new keyboard!
      • Whoa.. It's a programming language I can trick into acting exactly like Java/LISP/ML/K/APL/Smalltalk/Ruby/Python/Prolog/C# /Mercury, and still use the Perl string manipulation tools!
      Really.. it steals from everyone. I think it's even kind of the point. Of course, maybe I'm completely confused and wrong and have inserted Perl 6 here; but, well, these were the reactions i had :)
  10. When did obfuscated code kill a language? Never by Ars-Fartsica · · Score: 4, Interesting
    Gee, they hold an obfuscated C contest every year. You think C would vanish by now given the disgusting crap the coders write for the contest.

    The original poster simply pulled something similar. There is no requirement that your perl look anything like that, nor is "powerful" perl more obfuscated than plainish looking perl. This is total FUD drummed up by someone who has presented a corner case....which I can assure you can be done for any language. In fact, I wouldn't touch a language for which this didn't hold.

  11. Seeing the forest through the trees by RichDice · · Score: 5, Interesting
    On first glace, the P6 syntax looks... scary. And I'm even someone who's been into P6 (at least marginally) for a few years now.

    What I think though is important to remember is that if all you look at is the syntax, you won't appreciate the power -- and simplicity -- of the idioms. Taken out of context and put into cooked up examples meant to show off the new syntax, it looks bad... really bad. But once you actually start programming in it, you'll find that most of what you want and need to do will actually come quite simply.

    That vast majority of all this new syntax will be applied in the vast minority of programming cases. Much of it will get sucked up into modules, classes, etc., that you'll use without worrying about what's actually going on under the hood. And "the rest of us" will just have an incredibly powerful language that is actually easier to program.

    Cheers,
    Richard

  12. Use what you need by Ars-Fartsica · · Score: 4, Insightful
    Perl 5 already contains enough crap to confuse even perl "experts", yet this doesn't stop adoption. Take Bjarne's advice and only use the parts of a language you need, ignore the esoterica. Something else confuse you? Ignore it. Chances are you don't need it anyway.

    Perl has always had a lot of esoterica. Don't let it bog you down. You can be amazingly productive in perl without ever knowing what a typeglob is.

  13. Perl 6 is easier than Perl 5. Really. by ChaosDiscord · · Score: 5, Interesting
    But a higher level scripting language should be as close to english (or another human language) as possible.

    I certainly don't look forward to COBOLScript.

    Human languages are an ambigious mess. Computers only want unambigious constructs. Having programmed in COBOL and and a few so called "fourth generation languages", let me say that writing in something that is close to English is really irritating. It's never quire English enough to allow me to express myself. You end up having to learn a specialized language that isn't really quite English. If I'm going to learn a specialized language, I might as well learn something that is easy to type and easy to scan visually.

    Perl is a big, complex language, yes. But like real languages, you can learn it with very simple steps. You can get complex, productive things done with a just a quick introduction. If you want more power, it will take more learning, but it's available. Perl 6 aims to accomplish this evem better tham Perl 5.

    Yes, the example given in the article are a bit convoluted. The entire point of the article is to explore all of Perl 6, not just the commonly used bits. In fact, one of main goals of Perl 6 is to make the common case and the introductory case less confusing than in Perl 5. Really. And everything revealed so far has supported this, it's just that Larry doesn't make it too clear.

    Take for example expressing that a function takes three arguments in Perl 5. The best you can do is:

    sub my_function($$$) {
    ....my($arg1, $arg2, $arg3) = @_;
    }

    (The "...." represents spaces because Slashdot's code filter is crap.)

    In this example, Perl will not check that callers do the right thing. In Perl 6, you get this:

    sub my_fuction($arg1, $arg2, $arg3) {
    }

    A clear improvement, and Perl will actually verify that callers do the right thing when calling you, usually catching an error at compile time!

    In general Lary's Apocalypses have been a bit obscure. He's focusing on the big picture and the little details. Damien's Exegesis's is generally alot easier to read for people less interested in deep thought and more interested in concrete details. Wait a week or two for Exegesis 6 and give that a read. I think you'll find that the common case is slightly simplier and more obvious than in Perl 5, while the system also allows for more complex expressions that weren't well supported in the Perl 5.

  14. Forget the interpreter... by jkauzlar · · Score: 3, Insightful

    When does the book come out? Larry Wall's Perl 5 manual was the most fun I've had reading a computer book. Is he going to top it with the Perl 6 book?

  15. Re:Self-documenting subs? by nyamada · · Score: 3, Informative

    pod (plain old documentation) is what most perl hackers use. Easier to maintain than javadoc and the documentation stays with the code.

    $ perldoc perlpod

  16. Easy Fix by drivers · · Score: 3, Funny

    Just write a perl script to modify all your current perl scripts to use /usr/bin/perl5

  17. A completely different kettle of fish by ralphclark · · Score: 4, Insightful
    The Perl 6 feature lineup even as it was two apoocalypses ago made it clear that the goal this time is a mature and fully-featured object oriented language that also retains all the neat high level features of perl-as-we-know-it.

    This will make Perl an attractive contender for serious application development; something which it came reasonably close to in late Perl5 but didn't quite get there because while you could do most things in a consensually "proper" way, the roll-your-own methodology just wasn't convincing enough for pointy haired project managers.

    The primary difference with Perl6 is that it will have full support for strict(ish) typing and object orientation which makes it suitable for large projects where it's impractical to expect programmer A to know anything about how programmer Z's module is implemented internally and vice versa.

    The new feature set (together with Perl's availability on a wide range of platforms and the huge range of freely available interfaces on CPAN) means that Java and .NET will be facing some stiff competition in just about every conceivable application niche.

    If the speed improvements are genuine then (assuming that one were in a position to choose) for probably the first time ever we will be in a position where there is hardly any real need to maintain skills in multiple languages as Perl will be at least adequate for the vast majority of implementations. It's not unreasonable to suppose the list of exclusions being limited to CPU bound code in high-performance content servers (eg RDBMS, HTTP) and real-time and embedded apps requiring hand-coded assembler or at least tightly optimised C.

    Whether you agree with that or recoil in horror at the thought of your favourite language being marginalised, Perl is clearly not just a "glue" language any more. It's about to become a fully-fledged enterprise application development platform.

    I'm sure you've already guessed, but for the record I am very much looking forward to this.

    There is one fly in the ointment I guess. Perl, like C, is very free-form in terms of what it lets you do but the flip side of that coin is that such languages also let you write dangerously unstructured and unmaintainable code. They require good training and a degree of self discipline to use well. Self taught programmers who didn't have strict typing and nested scoping enforced on them at the beginning of their coding career almost inevitably tend to grow up writing code that is less secure and harder to read than do those who learned back in their college days to associate variable declaration at the wrong level of scope with lower assignment grades and some stern finger wagging from their tutor.

    The new Perl will continue to make the impossible possible and the merely hard very easy, but for the first time it will provide support for a more formal structure where that is considered a good thing.

    Remember though that Perl is still very much a grassroots phenomenon. Whether this hits anybody's radar screen out in the real world has to depend on how well and how rapidly it is taken up by the Perl community. i.e. upon the willingness of existing Perl code monkeys to grab the inevitable (presumably three-humped) Camel Book, learn the new features and use them deliberately to adopt a more structured and more scalable coding style.

    It's on this point I think that Perl6 will succeed or fail. We will need plenty of real world examples out there so that new users have something from which to learn righteous coding principles, and so that sceptical project managers will see successful implentations from which to draw confidence and inspiration.

  18. Perl is a Write-Only language by Yossarian45793 · · Score: 4, Insightful

    One problem with Perl, is that it's very hard to read somebody else's Perl code. Most Perl hackers can write scripts that do amazing things in much less space/time than a traditional compiled language, but their code is indecipherable to even other skilled Perl hackers. If you've ever maintained a large Perl program written by someone other than yourself, you know what I'm talking about.

    Adding more features to the language will only make this problem worse. Very few Perl programmers know more than a fraction of Perl's syntax. More syntax means more stuff that your average Perl programmer doesn't understand! This is a huge impediment to writing a large project in Perl.

    Languages like C and Java stay alive precisely because they're not very expressive. You can write huge behemoth-sized projects and still have some hope of maintaining them, because there just aren't that many ways to obfuscate the code.

    1. Re:Perl is a Write-Only language by thoughtstream · · Score: 4, Informative
      That's exactly why we made it possible to modify Perl 6's grammar. As paradoxical as it sounds, adding that flexibility gives us a way of overcoming the downsides of Perl's TMTOWTDI philosophy.

      It will be comparatively simply for a coding team to create a "policy" module (say, Policy/Our/Preferred/Style.pm) that restricts coders to an agreed-upon subset of the language's syntax and features. Thereafter, so long as every module begins with use Policy::Our::Preferred::Style, the rest of the module simply won't compile unless it conforms to the team's coding standards.

      And I suspect that enough groups will want to do this that it will make sense for someone to write a front-end module that simplifies the creation of such policies. So all your team will need to write will be something like:
      module Policy::Our::Preferred::Style;

      use Policy::Specification
      blocks => 'K&R',
      elses => 'cuddled',
      disallow => << unless until statement_modifiers junctions>>,
      # etc.
      ;
    2. Re:Perl is a Write-Only language by thoughtstream · · Score: 3, Insightful

      The proposed solution doesn't deal with maintainability. It only addresses project organization.


      Huh? The only way to deal with maintainability is via project organization.

      Even the most B&D, only-one-way-to-do-it language will permit obfuscated programming. The simplest way is by the (in)judicious use of De Morgan's laws on conditionals. For the more advanced obfuscator, just write a "subtract and branch if negative" function and code the entire algorithm using nothing but that. Every programming language, no matter how strict, provides an unlimited range of choices -- of identifiers, of data structures, of algorithms.

      Coding is fundamentally about making such choices, and syntax is just the very lowest level at which they can be made. Human beings make (and disagree on) these choices, which inevitably means that maintainability is a social issue, not a technical one. So technical fixes alone can never solve the problem.

      What we're proposing instead is a tool that can support in the necessary social processes by allowing you to reward adherence to, and punish transgressions of, your preferred syntactic style. But that's still ultimately a social solution because you have to convince your team to use the tool in the first place and ensure that they don't quietly turn it off when you're not watching.

      And it still won't address the problem of getting them to choose meaningful variable names, or a sane data structure, or an algorithm that mortals can understand. No tool -- except possibly a big stick -- will do that.

      Of course, we are also offering a complete parser for Perl, written in Perl. So if you do want to grab the parse tree of a program and reformat it (applying whatever artificially intelligent refactoring you can muster), the necessary support structures for that will be there too.
    3. Re:Perl is a Write-Only language by Fastolfe · · Score: 4, Insightful

      Most Perl hackers can write scripts that do amazing things in much less space/time than a traditional compiled language, but their code is indecipherable to even other skilled Perl hackers.

      Concede the likelyhood that this is due to one of two things:

      1. "Most Perl hackers" are incapable of reliably writing readable, maintainable Perl code.
      2. "other skilled Perl hackers" are not very good at reading Perl code.

      Try reading through some of the modules in the Perl core some time. More often than not, they are exceptionally well-written, documented very nicely and easily maintained.

      In my experience, given a pool of developers in any language, it is usually very rare to find one that can write truly elegant, readable code. Perl's flexibility just makes it so that those that write unreadable code can write some really unreadable Perl. Perl's low barrier of entry is part of the problem, and generally companies don't know what to look for when selecting a Perl developer, so you get a lot of novices out there in these positions pumping out utter shit, but it runs, so it must be OK.

  19. Designing by committee of one by guardian-ct · · Score: 3, Informative

    Larry Wall does seem to have taken seriously the "Nothing is sacred" bit. Earlier in Apocalypse 5, he wrote (about the earlier (?...) regex syntax decision) "It's not correct now, since the Perl 6 approach is to break everything that needs breaking all at once."

    So, I wouldn't worry too much about it. Perl 6 will be different from 5. It appears that it should be better when you look at it from certain directions, and worse from others. Paradigm shift? Sure. I think lwall just got bored with where Perl 5 was going, and wanted to do something different.

    Anyway "* signifies a glob" is one of those sacred things that was to be examined carefully. I'm guessing that most useful existing Perl 5 code doesn't use "*" that way except for filehandles. Several other 'modern' languages use "*" for type definitions, so it might make sense from the point of making it easier for a new Perl6 programmer to learn.