Perl 6 Synopsis 5 203
XaXXon writes: "perl.com has Synopsis 5 for Perl 6 up. It's a brief overview of all the changes made in Larry Wall's Apocalypse 5. Lots of stuff about the new regex syntax. I must admit, however, that I'm getting tired of reading about perl 6 -- I want to start using it." We posted Larry Wall's 5th Apocalypse in May.
Does this mean... (Score:2, Funny)
~geogeek
Re:Does this mean... (Score:5, Funny)
Re:Does this mean... (Score:1)
I may be misremembering this, but my favorite new tool for perl obfuscation has got to be user-defined operators...in Unicode!
"Well of course 'object1 [seated scribe] object2' means copy. It's a scribe..."
Re:Does this mean... (Score:1)
Ever seen APL [umich.edu]?
Re:Does this mean... (Score:2)
but, just as one does not expect to read Chinese without learning the language, one cannot read APL
without learning the language - APL is a language based on familiar mathematical symbols, so it's not that hard (it's made much harder by (a) misguided attempts to ASCIIfy it and (b) non-APL keyboards)
Similarly, most perl is actually quite readable once you have learned the language
If one where to replace every $foo %bar @baz with scalar_foo, hash_bar, array_baz, it might be initially more readable for english speakers - but for the few minutes it takes you to learn the meaning of the symbols, you can save a lot of typing and increase the brevity of your work. A few things did annoy me about perl syntax - I dislike -> instead of . for member access, but guess what?, it's
being fixed in perl 6.0...
Re:Perl 5 was nice (Score:4, Insightful)
One has to wonder about the relative success of Java, given its horrific performance and obscene installation complexity. However, ultimately Java's success comes down to the lack of choices in the language syntax and a strong networking library.
Of course Java syntax is a simplification of C++, while Perl's roots are in shell scripts.
I wish there was a shell with the simple grace of C, the libraries and idiot proof installing packages of Perl, and the portability of bash.
Re:Perl 5 was nice (Score:1)
I wish there was a shell with the simple grace of C, the libraries and idiot proof installing packages of Perl, and the portability of bash.
Would you like fries with that?
Re:Perl 5 was nice (Score:1)
Damn, funny shit, I wish I had the mod points. :-))))
Re:Perl 5 was nice (Score:2)
Java performance is excellent--very close to C and C++. What gives Java a reputation for being slow is that it takes a long time to start up.
Java is also one of the easiest systems to install: all you need to do is untar the archive somewhere, or run the installer (on Windows). Perhaps what you mean is that the Java runtime is big--but it isn't really if you compare it to other runtimes.
However, ultimately Java's success comes down to the lack of choices in the language syntax and a strong networking library
Initially, Java succeeded because it was simple and promised that people could deliver software as applets. Today, Java is widely used because it is well-supported, runs fast, has a huge library, and because it beats the alternatives for server applications.
I wish there was a shell with the simple grace of C, the libraries and idiot proof installing packages of Perl, and the portability of bash.
Seeing how given you are to snap judgements, I doubt you would recognize such a shell if it bit you in the behind.
Re:Perl 5 was nice (Score:2)
Installation and running of java as compared to perl is no contest (on unix). Java requires extensive and neverending twiddling aroung with your path.
Java runs fast relative to the other super-high-level script languages used for web server.
Don't get me wrong. I love Java. It's no C. Find me one high performance enterprize embedded appliance (router, switch, etc) with anything other than the mgmt software written in Java (if that).
Re:Perl 5 was nice (Score:2)
Re:Perl 5 was nice (Score:2)
Java requires array bounds checking, some null pointer checking, and a very small number of runtime type checks, roughly the same as most other high level languages. That does not impose a lot of overhead, in particular with dynamic compilation and optimization techniques. And, in practice, Java code written for efficiency runs close to C/C++ performance.
What is true is that writing efficient Java code is cumbersome--the language does not make it easy, and most people don't know how to do it.
Java requires extensive and neverending twiddling aroung with your path.
So does Perl, and so do most other languages that load libraries at runtime. The only reason why you don't see it in Perl is because people usually put all libraries into the system directory.
Re:Perl 5 was nice (Score:1)
Re:Perl 5 was nice (Score:2)
I didn't claim Java was free, merely that Sun's compiler produces good code.
performs equally on memory and speed to a myriad of equal C and C++ programs
On microbenchmarks (which is what you are thinking of), Java is a little slower than C/C++ because of mandatory error checking, but not significantly. Properly written, large systems are orders of magnitude faster and smaller in Java than in C/C++ because they don't need separate processes or IPC.
If this sort of retardation wants to adopt Java, all the power to them.
It is your sort of retardation that keeps people developing open source 300M desktops in C or C++ and live in the blissfully ignorant belief that it is "efficient".
Re:Perl 5 was nice (Score:1)
Re:Perl 5 was nice (Score:2)
Re:Perl 5 was nice (Score:1)
Re:Perl 5 was nice (Score:2)
Java gets translated into byte code, and the byte code gets translated into machine code. The machine code is then executed. C++ isn't involved in the execution at all.
Think of it this way: the JIT compiler is like someone who gives you directions. How fast you get to your destination doesn't depend on what kind of car the guy giving you directions has, but it depends on how fast your car is and how good the directions are.
Re:Perl 5 was nice (Score:2)
In any case, the reason why systems written in languages like Java are often much more efficient than systems written in C/C++ is not because Java can be compiled well (which it can) but because Java is safe. In something like Gnome or KDE, every single desk accessory is its own process, using some inefficient IPC or DO mechanism for communicating with the rest of the system. In something like Java, all those can run in the same process and just pass data structures. Using C++ for such applications is penny-wise and pound-foolish; the resulting software systems are ridiculously inefficient.
C and C++ have their uses and they are great languages for some problems. But 95% of all C/C++ applications would be faster, smaller, and work better if they were written in something else.
Re:Perl 5 was nice (Score:2)
This is the discussion.
You have to quantify what you mean by efficient. Ease of installation, learning, use, debugging, memory footprint, hard drive footprint, boot time, exception handling, integration, portability, what?
While I've done no Java work, I begin to suspect that a large chunk of the people on
Re:Perl 5 was nice (Score:2)
No, it isn't. I made a specific claim about execution speed.
While I've done no Java work
So, what do you base your opinions on, then? I use both Java and C++ for my work.
more than edify the reader...
Your edification is your own responsibility; you can hardly expect a free education from Slashdot. What you can get, however, is people challenging your assumptions and sharing their own experience. And my experience is that, properly used, Java can be nearly as fast as C++ for compute-intensive stuff, and it can be a lot more responsive and a lot less resource intensive than a C++ GUI environment. Think for yourself. Think about why Windows and Gnome/KDE are so huge. Try to find some fast Java apps and pick them apart. Etc.
Re:Perl 5 was nice (Score:2)
Java is nice if you want to pick up a programming language for the first time. It has the corners filed off and you won't poke your eye out with it. But, when you need the ultimate in flexibility it falls short. You can drop down to C (or C++) or latteral to Perl or Python. But, Java just doesn't give you the control over the environment that you need to cover the ground other languages do. For example, Perl is used for everything from OS installers to data modeling languages to graphics manipulation plugins for The Gimp. These are all areas in which Java is simply the wrong tool for the job.
Now, if I were hiring a bunch of junior programmers to crank out a database app, I'd turn to Java without glancing over my shoulder!
Re:Perl 5 was nice (Score:2)
"I" am the author of numerous Perl modules and a contributor to various Perl-related publications and a professional Perl hacker. Not that it matters.
Perl is not the language of choice for anything. The reasons are almost too numerous to count.
The reasons that every language is not ideal are almost too numerous to count. Perl just happens to have a lot more going in its favor than most.
Hope you didn't need to edit that program of yours, fella!
I have no problem editing my Perl. In fact, my co-workers have no problem (except where I use features like the C-library interface or complex process control that would be difficult for others no matter what language you were using). Modules are a huge advantage for programming in the large.
Perl does not offer strong typing
Very true. Also a benefit. I would suggest that only LISP rivals Perl for the availability of truely generic data types.
It depends on how you mean that. It does not offer a strong OO model, in the sense that Perl5's object model is fairly loose. This reflects the state of OO when Perl5 was written. C++ was young and seemed to be a poor model, but it was the one most people were paying attention to. Java did not exist. Smalltalk was nice, but no one wanted to think that way any more.
Now, Java has had its impact (I think Java's OO model is rather nice, though it has many problems that stem from its typing model) and other high-level languages like Ruby, Python, Eiffel, etc have changed the way we think about OO programming. It is now time for Perl to come in and do what it does best: deconstruct the best practices and adopt them as its own. This is one of the many things you have to look forward to in Perl6!
Hope you didn't need to write more than 100 lines... because it will turn into mush.
Counter-examples: LWP, PDL and many, many... MANY projects I have worked on alone or with others. PDL (Perl Data Language) is a prime example as it shows Perls ability to bring other components together. PDL is made up of Perl, Fortran and C. It offers one of the most complete scientific data languages available with high-performance transformations on low-level data such as binary streams, images, etc.
Also keep in mind that because of very-high-level complex datastructure handling, Perl makes it possible to write LESS code than most other languages.
The one thing that perl does reasonably well is operate on text files.
Spoken like someone who doesn't use Perl in the large. The one thing Perl does well is just about everything. Check out CPAN (the other MAJOR reason to use Perl).
But there are many other languages (awk, sed, Python, and bash scripting spring to mind)
If you think of Perl as being on the same level of usefulness as Bash, then I'm not suprised you've never made use of it. I'm sorry.
And anyway, who would consider scripting on the same level as programming anyway?
And who would consider Perl to be a language only capable of "scripting"? Scripts are traditionally run-time interpreted (Perl is compiled into a syntax tree, optimized and then exectued just like many other high-level languages). They also lack complex data types (Perl programs routinely create very complex arbitrarily deep datastructures casually; lists of hashes of lists of objects are quite common and easy to create in a couple of lines of code). Scripts are also hard to debug; Perl comes with a built-in symbolic debugger.
Learn the language; you may be suprised.
Re:Perl 5 was nice (Score:1)
Perhaps it was the multimillion dollar advertising campaign. Or the army of salespeople. Or the inflated consulting fees as a result of such.
Almost any product can be successful if you throw enough money behind it.
So why don't you? (Score:3, Informative)
Well, go right ahead. From the Parrot VM, the Perl6 engine, page [parrotcode.org]:
Use Perl6--Write some Parrot assembly, and help out!Re:So why don't you? (Score:1)
--Tom
Re:So why don't you? (Score:1)
Perl's had it's day - It's become like COBOL (Score:2, Insightful)
Perl was great, it introduced many people to programming, just like COBOL did. But now it's time to move on. To move on to languages that learnt from perl, that improved on it, that don't have to drag around a syntax and culture that values neat tricks and trying to guess what the programmer really meant over providing the needed building blocks and letting you build code that does what you say, not what it thinks it heard you say. Or even, dare I say it, to move on to languages outside the perl family for some programming and choose the right tool for the job for a change.
I'd prefer to think of this as provocative rather than a flame, there is a difference you know.
Re:Perl's had it's day - It's become like COBOL (Score:1, Insightful)
Your article is nothing but vague hand-waving. I am a professional programmer, I want specifics if you want me to take you seriously.
Re:Perl's had it's day - It's become like COBOL (Score:2)
Read the old edition 1 camel book - it's clear and concise, easily readable and makes you want to go out and code. I have the latest edition... it's 4 times the size, rambling, and doesn't seem to ever get to the point. There's only 3 pages on the reporting side of perl now - it's like they're ashamed of it or something.
Perl should have been left at what it was good at - there are other languages for large scale programming.
I agree with this post (Score:1)
Good stuff (Score:2, Interesting)
For all of the hub bub and brouhahah, I think after it is released and people start to explore all the new (and old) features, folks are going to find Perl 6 an amazing tool that improves on an already amazing tool set.
With all of the flame wars regarding Perl/Python/Ruby (like triplets calling each other ugly), it's good to see Perl continuing to innovate, improve and set a brisk pace for others to follow.
Rename it, it isn't Perl anymore (Score:4, Insightful)
Re:Rename it, it isn't Perl anymore (Score:2, Informative)
If in doubt go and read article ...And Now for Something Completely Similar [samag.com] by Damian Conway.
Re:Rename it, it isn't Perl anymore (Score:2)
Their compiler is still referred to all over their documentation as Object Pascal. Delphi is the name of the IDE, not the compiler; just as Visual Studio is the name of Microsoft's IDE, but not their compiler.
Re:Rename it, it isn't Perl anymore (Score:1)
Yeah..more RegEx fragmentation (Score:5, Insightful)
Honestly, RegEx hasn't changed much since awk and when it did, Perl usually led the way. The changes though usually just added features or tweaks, my RegEx still basically looked the same though whether I used VIM, Python, ASP, C++, Perl,
Shortly after reading the changes, I was aghast. Sure some of the changes make sense but some are going completely against RegEx as we know them now (getting rid of character classes for one []) . Sure you can use the p5 modifier or do the funky syntax to use [] but the issue is its a radical change.
This is a bad thing(tm). This is going to force all us RegEx people who currently using 4 or 5 different RegEx tools to not only learn minor differences based on each app, but we will be forcec to learn a COMPLETE DIFFERENT subset of RegEx syntax incompatible with anything else.
Now wait you say, Perl has always led the way and other tools seem to use perl compatable RegEx libraries. Not so with Perl6. Have floated this question out on a couple developer lists (PHP for one) and everybody is saying, Perl 6 RegEx support isn't going to happen. They are all happy with the current state of RegEx's. This is especially go to cause hell with PHP's perl_regex functions. PHP has stated they are not going to support Perl6 RegEx. Real perl_regex compatible then huh.
Some the Perl6 changes are pretty good for RegEx, but the complete drop of support for character clases just isn't a good thing (tm).
My 2cents (who is glad at least Larry added the P5 modifier)
Re:Yeah..more RegEx fragmentation (Score:1)
Re:Yeah..more RegEx fragmentation (Score:1)
Never said they are going away. I said you now have to do some completely odd funky syntax to do character classes as we know them.
(well not really, because it soon starts looking completely unlike RegEx... [^a-b] compared to BUT character classes have alway as long as I have know been []
Now here is my fun Perl6 question.
Before I could do [^[:alpha:][:num:].*]
isn't correct since that is not ONE character class.
> maybe? (though it also doesnt' look right)
more RegEx fragmentation (corrected with Extrans) (Score:1)
Never said they are going away. I said you now have to do some completely odd funky syntax to do character classes as we know them.
<[a-z_]> <--sure its only the addition of <> (well not really, because it soon starts looking completely unlike RegEx... [^a-b] compared to <-[a-b]> BUT character classes have alway as long as I have know been []
Now here is my fun Perl6 question.
Before I could do [^[:alpha:][:num:].*]
<-alpha><-num><-[.*]> isn't correct since that is not ONE character class.
<<-alpha><-num><-[.*]>> maybe? (though it also doesnt' look right)
Re:more RegEx fragmentation (corrected with Extran (Score:2)
Re:Yeah..more RegEx fragmentation (Score:1)
Character classes have changed to <[]> which isn't that big a deal. bare [] are used for non-capturing grouping. It's a reasonable choice--most people use non-capturing groups more than character classes.
Re:Yeah..more RegEx fragmentation (Score:4, Insightful)
Perl 6 is now more of a concise parser builder. As Jaime Zawinski has pointed out,
regexes are not enough for real parsing, though people used Perl ones for ad-hoc parsing all the time.
The sweeping syntax changes are an indicator of the Perl folk mutating Perl to be better at what people actually use if for - by the looks of things, they'll even stop calling them
regexes soon, preferirng the term "rule"
just wait (Score:2)
If the perl 6 regex's have real benefits over the old style of regex's, then everyone else will switch over. Sure it will take a while, but then what improvements in life ever happened instantly?
Code-names (Score:1, Funny)
Re:Code-names (Score:2)
Re:Code-names (Score:2)
Apocalypse is the English transliteration of hapokalu[psi]is [3] . hApo [3] is a very common preposition meaning something like away from or off; and kalu[psi]is [3] is formed from the root, kaluptw [6] [3] , meaning cover, or veil. So, "unveiling" is acceptable. The only problem is that "unveil" is a term not used very generically in English, it has strong literal connotations. That makes it good for poetic imagery; but the original Koine Greek was probably not intended to specifically evoke that particular image.
Herodotus used hapokaluptw as uncover; Plato as disclose or reveal; and Plutarch as reveal one's whole mind, which I think is closer to what we're looking for here.
As to your two points....
The first is a bit strange. It's trivially true, as Revelations says as much in the first verse. As to Mark 13:32, it only indicates that Christ was unaware of the exact date, not the events. Indeed, Christ seems to be aware of some of the events in Mark 13:32. Also, of course, it's contestable that what Christ is describing in Mark 13 is the same thing as what is being described in Revelations. At any rate, yes, the revelation is to Christ, who then passes it along to John; and so in that sense it's quite correct to say that the revelation is to John. Your insistence that the revelations is "really" to Christ is either niggling or important. If it's important, then it's only important in your contestable interpretation of Revelations and the NT as a whole. Similarly, your second point is also quite dubious, as hev taxei [3] is in most cases in the NT unambiguously translated as "soon" rather than "fast". Here are all the incidents of hev taxei in the New Testament [tufts.edu]. It's also quite a stretch to claim that the writer of this book is keen on specifically mentioning that the events described take place quickly right there in the first sentence. It's far more sensible to interpret this as "revelation of events to come soon"; and, furthermore, the narrative that follows describes a sequence of events that are not particularly brief. In other words, pushing the "rapidly" translation is a function of an interpretation which attempts to reconcile this with the historical fact that these events did not seem to happen "soon". Which brings me to another point.As someone who studied Homeric and Attic Greek before Koine Greek [5] , I have a greater familiarity with Greek than the average layperson or non-academic who has studied the NT in Greek as a part of their bible studies. My sister, for example, is an evangelical minister and missionary; and although her understanding of Greek has improved over time, it is still enormously tainted by doctrinal teachings of Koine Greek biased towards a particular interpretation of the NT. As a result, I am very skeptical of many fundamentalist's "translations" of the NT.
Finally, I am not at all offended by your post or the fact that you're Christian - as I noted, Larry Wall is a devout Christian and your post is marginally on-topic. But please don't assume that the sets of people that are offended by Christians and atheists are mutually exhaustive. They are not. I am an atheist. I also know a great deal more about Christianity than most Christians I've met. Stereotypes are not helpful.
[1] Here is the beginning of Revelations in Greek [tufts.edu].
[2] There used to be a second footnote. Now it's gone. It involved how to display the Greek characters I originally tried to use that I eventually discovered that /.'s preview would accept, but that the submit would not. Sigh. (Addendum: it was a different problem.)
[3] These are Latin character transliteration. We don't have a psi. Upsilon typically changes to "y" in English rather than "u" because the vowel "y" is actually closer to the presumed pronunciation. Kappa often becomes "c". Nu ["v" in my transliterations] becomes the English "n". The "w" is an omega, a long "o".)
[4] Wish I could force Unicode in this post, somehow. Ironic since one of the biggest justifications for Wall's mods to regex is that 8-bit character classes are now archaic.
[5] Koine Greek is much simpler than Homeric or Attic Greek. The New Testament was actually written in Koine Greek because it was the common language of the region. The original words, however, were probably mostly spoken in Hebrew and Aramaic. I should make it clear that I studied Greek more than ten years ago and sadly now all of my facility with it has completely evaporated. This post was constructed with frequent consultations with my Liddell & Scott. YMMV. It's also worth noting that Wall is a trained linguist as well as a studious Christian, so he means exactly what he's saying when he uses the word apocalypse.
[6] Thus, Homer's "Calypso", the nymph who hid.
makes me glad I'm cutting back on Perl (Score:5, Insightful)
I prefer command-line PHP to Perl these days (Score:1, Flamebait)
Is it just me, or have other's found this? Also, the performance of command-line PHP is quite acceptable.
Perl Rocks (Score:4, Interesting)
First - the myths, untruths etc that have sprung up so far.
Perl6 is not backwards-compatible with Perl5 - uhm, yes it is. All your perl5 scripts will compile.
Why not contribute to phython or [insert other language here] well, python will compile through Parrot too, so who cares? If you like Python, write in Python. I prefer $%&? syntax to whitespace-as-syntax, but each to their own, but that is the joy of Parrot. Think .Net CLR without the so-far unfounded feeling that M$ are doing something underhand and nasty that you can't put your finger on. Before someone replies with "Why not just use the CLR instead of Parrot"? bear in mind this has been done to death already. It's in the FAQ, read first, flame later.
But why Perl? Okay, so it can be write-only. But this is only because of the flexibility, There Is More Than One Way To Do It. This includes obfuscated code, and plain unreadable alien transmissions. However - if you're writing code only you will ever see, then use the short-cuts. If you are writing code that needs to be maintained, then YOU the developer have the responsibility to ensure it is readable.
Heck, you could always use english; - but this is perl, you can also code in Latin, or, uhm, Klingon.
Perl is simply the most flexible language out there IMHO. If you're a sysadmin, you will have the Camel and the cookbook on your desk. Our entire environment is held together with Perl. Half the Internet is running on Perl. A dead language? Sheesh, Perl is dead, long live Perl.
If there is anything that does worry me about perl6, it is that it is becomiung too powerful, and too encompassing - it is important that the balance is maintained whereby it remains the Swiss Army Knife of languages, that it remains as easy for the casual Perl programmer to keep getting their job done with simple scripts as it is to create large projects.
Careful, Parrot != CLR (Score:4, Interesting)
He also goes on to note that the CLR could be a pluggable backend for Parrot to export to.
Re:Careful, Parrot != CLR (Score:1)
If you do choose to not trust your bytecode, you can run it in a safe interpreter, which will check to make sure everything is proper. You'll pay the corresponding performance penalty, but that's fine as you've asked for it at that point.
Most of the code that most people execute is trusted code, and for that there's just no win in double-checking it at runtime. And for those rare (relatively) cases where you do care, you can be paranoid and run safely.
(The CLR's certainly not safe either. Use some unchecked code, of which there's likely to be a lot, and you're just as unsafe)
Re:Careful, Parrot != CLR (Score:1)
Not yet, at least. Remember, Parrot is still under development. We'll implement the safe interpreter stuff eventually, but it's not a priority right now. We still have more fundamental issues to handle, like subroutines and symbol tables. :^)
Re:Perl Rocks (Score:2)
from the perlvar POD: So that might be a good idea for Perl 6, but not for Perl 5.
Re:Perl Rocks (Score:2, Interesting)
Re:Perl Rocks (Score:2)
The other answer, even if you can't "use English;", is to comment your code properly, especially complex regexes. Of course no-one should need to be reminded of this, the same way no-one should need to be reminded to keep backups... right?
Re:Perl Rocks (Score:1)
(Incidentally, Mastering Regular Expressions, 2nd edition, is out sometime this month.)
Comic book guy dislikes the new regex format... (Score:1)
Pros and cons of the /x regex modifier (Score:1)
I must admit to only just having gained a handle on some of the more esoteric features of Perl 5 regex. But I have a definite opinion on the use of the /x modifier on regex - contrary to (what seems like) popular belief, I find it makes regex harder to read, not easier.
Having to mentally scroll a line after each token impairs my parsing of the regex as a whole. It seems much easier to me to compare a sample of the input to the regex, and see how it looks. I realise it won't be mandatory to lay regexes out like this in Perl 6, but it worries me that this is seen as good programming practise. Don't even get me started on people who comment after every token...
Still, there's hope that the introduction of this modifer as the default will work against this mindset, rather than for it. Perhaps with its common usage will come enlightenment amongst the Perl posse. I also notice that Larry doesn't use the monstrously verbose regex form during his Apocalypse. So I'm not really sure whether this is a good or a bad thing - but I'm certain that people in the Perl community need to stop preaching that excessive commenting of regexes makes for maintainable code.
(This probably should have been posted in response to the original Apocalypse 5 thread. Tough titty. BTW, I thought Slashdot would wait for the Exegesis, and how come this is a few days late. Bah, humbug.)
Out of control (Score:2)
I'm not a big Python fan, but now I'm wondering why I shouldn't just switch to Python now and save myself the grief of having to switch to a completely new Perl-like language later.
Re:Out of control (Score:2)
The only thing that concerns me, really, is the scale of what the Apocalypes have proposed. Yes, the Parrot VM is moving nicely along, but the actual implementation of all of Larry's new design decisions seems to be lagging well behind their creation. I have a lot of faith in the core Perl hackers' abilities, but the climb from here to Perl 6 is not going to be an easy one.
Personally, I've started looking a lot more closely at Parrot and the Apocalypses (Apocrapha?) since I saw the regex article, and am hoping to be able to get up to speed to get involved in the project over the next few months. I recommend that anyone else who shares my interest (and has any background in parsing and compilation, test case management, VM tuning, etc.) do the same.
(Note: I'm already a fairly dedicated Python user, but as a language geek, have grown pretty seriously tired of some of the limitation of the language, like one-expression lambdas, weird "special" variable names like '__init__' and '__name__', etc. Plus, if you're trying to do code generation, the whitespace-delimited syntax is a bitch.)
You can switch but it will not help (Score:1)
I don't get why people whine about obvious improvment in regexp engine. First of all: there always p5 modifier to turn on compatibility mode. Moreover do not afraid of complexity of new regexps. You don't have to use all features! Simple things are still easy to do (and even easier). The best thing about new regexps is that they make previously impossible possible.
Re:Out of control (Score:2)
For instance, a series of 'if' constructs in a row that all do a very simple thing (function call) are sometimes cleanest if they are all on one line
example: if (foo) { bar(); }
instead of spread across three. It makes the relationship between the condition and the action very clear, and also makes it easier to see more of the overall structure by providing more context for the same ammount of lines.
Similarly, Perl will loop through an array with an implicit bounds check [foreach $var(@array) { }] which lets you do a common task very easily. Python is much more strict about making you check the array size and loop through, making sure not to test past the end. It's a good teaching function, to let people know what goes on behind the scenes in a high-level language so that they understand it better, but it's just as safe either way. Why make the programmer do it?
I like C, and even enjoy the odd bit of ASM, but when I need to code a text handling application, quickly, I don't reach for those, I go for Perl. Python seems like a good cross between C and Perl, but I don't think it's a replacement for either.
And, as for as having to switch to a new perl goes... Larry's realized that there's so much P5 code out there that will never be updated that P6 will be backward compatible. If you don't want to change, don't. Any Turing-complete language is capable of any task, there's nothing P6 does that P5 can't. If it's not worth learning, don't bother.
Perl Bashers (Score:2, Insightful)
Where I work Perl helps us with System Integration, fast scripting, production reports, database connectivity where speed of writing the application and flexibility in changing that application quickly are important, web sites for change control systems, bug reporting systems, etc. and much much more.
If speed of creating the application and flexibility of changing that application need to be blazingling fast Perl is the choice. If Perl is not going to provide the application speed you need then use C or C++. That is why Perl is written in C
If the Perl code you are reading isn't readible it probably had to be written too fast for the programmer to accout for that or else the programmer simply didn't care. Perl is the most flexible language ever and it can be the most readible if some care is taken. Especially in a smaller size applications.
I' also getting tired of reading about Perl6 (Score:2, Informative)
Perl is beautiful (Score:4, Insightful)
Many people say Perl is too big, has too many features, is too complicated, etc. This is simply false. Perl has tons of features, but, more than any other language I have ever used, you can use as little or as much of it as you want. You can pick up a Perl book and start writing Perl code in 15 minutes.
Perl is ugly, hard to read, "write only", etc. This is complete horseshit, probably stemming from lack of experience with using Perl. Perl is very easy to write and read. Where I work, I have a co-worker who is not a programer. He learned Pascal years ago, but did not do any real coding until recently. Despite this, he can fairly easily read and modify my code. Yet, he can't read or modify my C/C++ code at all, and it's usually very readable, very clean, simple and concise.
PHP/Python is better. A lot of people like to compare Perl to PHP and Python. Neither are "better", there really is no such thing. PHP is for web developers, and Perl can do everything PHP can do in nearly the exact same ways. Take a look at CPAN, there are so many Perl modules for use with Apache and web development in general that Perl is far, far more capable of a web programming language than PHP(IMO anyway). And Python, I've seen some absolutely fantastic stuff written in Python, but I hate Python, because it gives me a frickin headache. I cannot read/write Python, the lack of braces, indentation as syntax is just horrible on my eyes. Perhaps I'm slightly dyslexic or something, but when I'm looking at a page of Python code it all starts to swim and I cannot tell where each code block begins and ends.
Now don't get me wrong, Perl isn't perfect. There are some things that bother me about Perl 5. # for comments, not bad but I really wish I could use C and C++ style comments in my Perl code. A bunch of #'s just look rather ugly. Threads, Perl 6 will have decent thread support from what I understand, I wish Perl 5 did, luckily for me everything I use Perl for I can fairly easily use multiple proceses instead, still would be nice though.
I for one am looking forward to Perl 6. There will definately be a learning curve, but at least it will run most scripts without modification, will make upgrading much easier.
Oh wait... this is /., it's easier to get modded up for bashing something... ok... Microsoft sucks! ;-)
Re:Perl is beautiful (Score:2)
gotta agree with you there. most people objecting to perl are straight programmers looking at code written by BOFHs who couldn't care less if you can read their code. But I've seen the code those programmers are writing in a variety of languages and it's no fucking better. And often it's just worse and less concise because of the straitjackets the language puts you in. One would have thought, for instance, that Java would have done better than to repeat all the tired design of the umpteenth homegrown C++ string class, but no such luck; no one else has anything to be proud of (object-oriented shouln't be a synonym for verb-deficient).
I could go on and on but I expect to find Perl in 2023 (Perl 6.20936, btw), I have doubts about any other current language but C. Perl allows for elegance that other languages simply can't (e.g. "next if $foo;" at the beginning of a loop): bad programmers suck no matter what their language.
I also have to agree that a block comment, say /# blah blah #/ is overdue.
Re:Perl is beautiful (Score:2)
And what do you think is going to happen to Fortran? Millions of lines of code don't go away over night, and engineers and physicists who only know Fortran aren't going to bother learning anything else.
Re:Perl is beautiful (Score:1)
Re:Perl is beautiful (Score:2)
My cousin, who got his PhD a few years back in Chemical Engineering, wrote his thesis in Fortran, I assume because he was most familiar with the language. Intro to Engineering Programming at OSU teaches Fortran 90. There are no other Engineering Programming classes at OSU. So there's both new writing in Fortran, and a body of new users.
Re:Perl is beautiful (Score:1)
It's not elegance unless Perl allows you to add constructs such as "next if $foo;" to the language yourself, via the language.
Lisp does. Lisp has been around for 40 years. And I guarantee you that a Lisp will still be here 40 years from now. Languages like Perl, Python, and Ruby continually try to measure up to it, XML tries to imitate its data structure, and most people could learn a few lessons from it. Dynamic semantics and structured data/code aren't going to vanish on a whim, unlike certain other languages tied to a particular creator's looniness (not naming names, but you know who I mean).
Re:Perl is beautiful (Score:1)
Perl 5, the new COBOL, Perl 6, the new ADA (Score:2)
"My name is Ozymandias, king of kings: [yoga.com]
Look on my works, ye Mighty, and despair!"
Nothing beside remains. Round the decay
Of that colossal wreck, boundless and bare
The lone and level sands stretch far away.
Re:Perl 5, the new COBOL, Perl 6, the new ADA (Score:2)
You may be completely satisfied with Perl 5, though many others aren't. Perl 6 may keep some of them from migrating to Ruby or Python, as well as attracting new programmers. I did my first "web" programming in Perl (4 actually), though I'd never suggest Perl to a newbie now.
To all the whiners (Score:2)
The reason that perl is successful is because it's useful. Only time will tell if people think perl6 is useful. If they do, they'll use it; if not, they'll stick to perl5.
Ob regex troll: I think the new regex handling kicks major ass. The new regexes have been promoted to true first-class variables, cleaning up a lot of messy syntactical issues. In addition, everyone who says it's not backwards compatible, well you're right. That's because the current regex libraries SUCK in comparison to the features offered by perl6. That's right, they SUCK, and it would be impossible to be backwards compatible with all the new (useful) features that have been added. If you don't believe the new syntax useful, try backtracking a 100,000 character repetitive string only to discover that the 15th matched number is too large or too small. Now think <{ ... }>.
Actually, I like it! (Score:2)
Frankly, I'm looking forward to it. Parrot is nice, and if it weren't for the memory management issues from string-scalar registers, I'd be seriously looking into implementing it in hardware, but its still not too impressive without the Perl6 parser. So I'm waiting patiently, but I feel it'll be well worth it.
The changes may seem like a lot, but far more will actually be staying the same. Perl's already by far the easiest language for me to implement things in (and I've given basically everything a good try), and it seems as if this batch of changes will solve the few remaining rough areas. Except the learning curve - I think BASIC (for initial concepts) and Pike (for C syntax and functional structure) still have it beaten in that area. Still, it's kinda funny how many apparent perl-haters (old perl and new perl) there are, posting to a forum thats, err, written in Perl =)
Re:Actually, I like it! (Score:2)
PHP better than Perl (Score:3, Interesting)
Re:PHP better than Perl (Score:2)
Until you got to the Pascal rocks part, I was right with you. Pascal was a teaching language with arbitrary restrictions that should have never made it out of the classroom. If you want a nice language along that line, try ALGOL/68.
Re:PHP better than Perl (Score:1)
Pascal, as extended in Delphi and Kylix, rocks...
maru
Re:PHP better than Perl (Score:2)
Re:PHP better than Perl (Score:2)
being forced to use begin and end instead of brackets didn't help me much either.
You can use extensions, but then you lose the portability. At that point, what's the real purpose of using a high-level language? Pascal is fine for teaching, but it's not designed as a production language, and it shouldn't generally be used as one.
Re:PHP better than Perl (Score:1)
Re:PHP better than Perl (Score:2)
All languages are NOT equally good (Score:2)
What a wussy response. So what you're saying is that those languages are all good, except when they're not.
I love Intercal because it destroys all the "they're all very nice" language relativity arguments. Here's a language that's specifically designed to be as annoying as possible. I dare you to advocate Intercal in the same way you did above.
Both the PHP language and its implementation have significant problems. Regular users of PHP already have their own list of language design annoyances ("it has to be a global??") and you can see some of the implementation problems here [bagley.org]. You will note PHP's implementation getting beaten by Tcl, gawk, xemacs, and njs. :-(
PHP would have been better off if the implementors had used an existing language like Lua [lua.org] (80k of x86 code for standalone interpreter+core libraries!) and focused on the embedding features unique to the application area.
Re:All languages are NOT equally good (Score:2)
Perhaps if you read Doug's testing methodology you'll notice he doesn't configure PHP for performance.
The suggested performance config changes Doug cites are:
"If you have much memory and are using gcc, you might try this."
This does work, although you have to read to the end of the ./configure --help options to find it. It speeds up the Shootout tests by around 15%.
Unfortunately, 15-20% isn't very much. PHP's ranking relative to other language implementations doesn't change, even with this improvement.
FWIW, Debian doesn't configure with --enable-inline-optimization.
Re:PHP better than Perl (Score:1)
Re:Perl Sucks (Score:1)
Re:Perl Sucks (Score:2)
If you must script a GUI use somthing that's been designed for it like TCL (another language I hate but it has its uses).
Re:Perl Sucks (Score:2)
Tk was spawned out of his frustration with Apple's HyperCard system and his belief that a "shared scripting language" could provide the glue to tie together components that a small group such as a university research team could build up over time. Plus, I personally suspect, his desire to reuse Tcl for more than its original design.
Pick up "Tcl and the TK Toolkit" by John K. Ousterhout published by Addison-Wesley. The info above is gleaned from page xvii, the first page of the preface...
Re:Perl Sucks (Score:1)
Re:Both Perl and PHP Suck (Score:1)
If you hate Java as unscalable proprietary lang then use either Python or CLOS/Lisp.
For those who argue about security of object attribute access - that has nothing to do with OOP and with security either. It's just a marketing blob and nothing useful. Hence, Python and CLOS/Lisp are still the choice.
Finally, CLOS/Lisp has not enough portable GUI libraries. Scheme is not OOP lang either. Thus we've left alone with Python. Portable open-source scalable stable-as-old and modern-as improved good OOP (and some FP!) lang Pyhton.
Re:Perl 6 Synopsis 5, 5th Apocalypse (Score:3, Funny)
Are you on the dope, son? (Score:1, Funny)
Re:C++ should be the only programming language (Score:1, Funny)
Re:C++ should be the only programming language (Score:1)
Re:Call me ignorant if you like... (Score:2)
Uh, Perl 6 IS backwards-compatible with Perl 5--at least to the point that your Perl 5 scripts will compile under Perl 6.
I think its a ridiculous thing to say that Larry should have just contributed to Python or whatever instead of implementing the features in Perl itself. There are tons of things that can be done better, faster, or easier in Perl than in Python or Ruby, and ditching Perl just because someone else already came up with a particular feature is, IMHO, ludicrous.
Re:Call me ignorant if you like... (Score:1)
Having a pro-perl argument with that sig kind of defeats the purpose.
Re:Call me ignorant if you like... (Score:1)