Exegesis 2: Damian Conway On Perl6
sumengen writes: "Damian's writing a series of articles parallel to Larry's Apocalypses.
These 'Exegesis' articles will show full perl6 programs, with
commentary exlaining the new features.
The first Exegesis (numbered 2, to keep in sync with Larry) shows a
perl6 version of a binary tree program from the Perl Cookbook.
Get excited to see things like:
my int ($pre, $in, $post) are constant = (0..2);"
my int ($pre, $in, $post) are constant = (0..2);"
I had a really nice response to this that would have been extremely helpful, but the guys at slashdot seem to think perl code is random characters:
:)
Lameness filter encountered. Post aborted.
Reason: Junk character post.
Kind of funny, since it's all written in perl. Kudos, rob- you've managed to stifle any discussion about perl code.
How about:
$*ARGS is chomped;
Maby it's just me, but I fear that setting properties to variables that affect how fuctions work on them, will greatly decrease the quality of code, available.
Let's just face it, not everybody has even heard of Dijkstra, let alone know how to write 'proofable' programs.2 C3AF4F2snlbxq'|dc
--
echo '[q]sa[ln0=aln80~Psnlbx]16isb15CB32EF3AF9C0E5D727
echo '[q]sa[ln0=aln80~Psnlbx]16isb572CCB9AE9DB03273snlbxq' |dc
Urrr.. I tend to use Perl a lot.
Ya know, it's quite easy to pick up (I got up and running in an afternoon on the basics).
The prefixed identifier is pretty useful as a memory aid, so that you are ALWAYS aware of what type you're dealing with (scalar, array, hash, sub, or typeglob).
To learn what these are, you read one page in a book, and all is clear. Now, how difficult is that??
If you're having trouble extracting values out of variables, then I think you have a weird view of 'difficult'. Pulling a value out of a deep struct in C can be difficult, but using $_ being difficult? Bah.
Still, if you don't like it, fine. Your choice. But, please don't keep saying it's so difficult.
I taught my Girlfriend to use Perl in a day (at the basics), and she's never learned a programming language in her life prior to this. She's now sailing away in it happily.
Cheers,
Malk
Perl may look confusing, but there's nothing like having to work in VB for a week to make you miss the raw power Perl provides.
Some of these language changes disturb me too, but I trust Larry to ultimately make it fairly simple to transition from perl5-think to perl6-think. The transition will break a few things but it sounds like it will increase the power of the language by about as much as perl4 to perl5 did.
Caution: contents may be quarrelsome and meticulous!
Your right to not believe: Americans United for Separation of Church and
I was also happy to see Basic's "dim" recycled.
Really guys, haven't we learned anything since oh, I don't know, 1965?
Now in Perl 6, one can have such syntax as: my int ($pre, $in, $post) is constant = (0..2);
and: $ARGS is prompts("Search? ");
With the advent of this new "is" construction and the use of passive voice in the code, I think that the following should also be added:
This would allow for such conventions as:
$*ARGS be chomping;
"LibCGI.pl" is being required;
(or if one wants to be smart:)
recognize $foo!;
Just a thought.
Try comp.lang.ada. It's swarming with Ada fans, many of whom would be happy to explain why they love the language so. Ada Home and AdaPower both have quite a bit of information and evangelism (the former is a bit of a 'classic', though).
Does Perl still support GOTO?
God, I love that command.
Feed the need: Digitaladdiction.net
Wash, rinse, repeat.
C went through this evolution, taking about 25 years to do so. Originally, everything in C was basically a 16-bit int. Structs were just a set of offsets. There was no type-checking; any struct field could be used with any pointer. Then came K&R C, which added a type system but made the syntax context-dependent, because the original language hadn't contemplated user-defined types. ANSI C made the type system consistent. C++ added objects. ISO C++ added templates, collections, and lots of other stuff. Now the language and its manuals are huge.
LISP also went through this cycle, again taking about 20-25 years to go from LISP 1.5 to Common LISP. So did FORTRAN and BASIC. Perl is now well along into this cycle.
If you put in the type system first, as Java, Python, Pascal, Ada, and Smalltalk did, the end result is cleaner, but the language gets an initial reputation of being complicated. Perl, though, has now grown to be more complex than any of those languages, so it's on the downslope of the cycle.
For those of you in Victoria, Australia, You can go see Damien Conway talk about some of the things he is doing for perl at the moment.
More details are at http://programmers.luv.asn.au/
There is a theory that if anyone ever discovers exactly what Perl is for and why it is here, it will immediately disappear and be replaced by something even more bizarrely inexplicable.
There is another theory which states that this has already happened...
There is yet a third theory which states that both the first two theories were concocted by a wily editor of the Camel Book in order to increase the universal level of uncertainty and paranoia, and so boost sales of the book.
siener's youtube channel
This is so confusing. Just the sight of @_[0] to mean a scalar, the second argument to a sub, makes me feel dizzy, and the little hairs on the back of my neck stand up. Please, find Damian and Larry and wake them up somehow. Cold water, dope slap, whatever it takes!
Whew. I hate those early-morning nightmares. Both Larry Wall and Damian Conway were in this dream, wearing dark suits and Ray-Bans, and, and....
Perl is an interpreted language that lets you quickly hack big jobs with small effort.
C++ is a compiled, object-based language, designed for projects that require the advantages of the OO model and the speed of pre-compiled binary code.
A good all-purpose programmer should learn both. Asking which is better is like asking if a Mack truck is better than a Lotus Esprit Turbo... the answer depends largely on what you want to do with it.
Information wants to be anthropomorphized.
The example looks fine to me, perhaps you're confusing your inability to understand the language with whether or not its a good programming language.
If you like C++ or BASIC then use them instead, I really believe people should choose the language that fits their way of thinking, I enjoy using perl and find it makes sense, you may prefer C++ - that doesnt make either of them better or worse than the other.
no sig.
First of all, I really wish they'd put in a println function, I really hate typing "\n"
but then again
sub println{ print "$_[0]\n";}
print "hello";
in other thoughts, the 'is' in
%node{VALUE} = $val is Found(0);
kinda scares me because it reminds me of applescript. I dont remember applescript, but I've done some sizeable things in it, and its so close to a natural language that you get confused and start programming in english. Its good that spoken language and programming languages look so different, otherwise I'd accidentally start speaking in code.
Sneakemail is to spam filters what an ounce of prevention is to a pound of cure.
my head($brain_cells) are hurting = (newSyntax);
butMust -> learntodoit() or die "Knowing I have failed.\n";
The real strength of Perl lay not in its technical construct, or its syntax, or even in the vast set of modules and libraries available to it. The truest strength of Perl is its culture. Larry Wall, from very early on, has tried to foster a real, positive community.
Perl6 is yet another cultural extension to Perl5. The RFC process was very messy, disorganized, and perhaps a little out-of-control. Indeed, as Larry said, he spent several months mentally thrashing as he tried to grok all of the RFC's. But that is the way he wanted it. The RFC process was a picture of a real-life war-room or think-tank.
The end result will be very exciting, I believe. The Perl6 documents, to date, have capitalized on cultural strengths of the Perl community.
Truly, Perl6 is built on the most important resource available to Larry: the huge diversity of Perl programmers all over the world. That diversity has made Perl5 a great, legendary language. I think it will make Perl6 even better. As Perl advocates, I think our best effort is in being inclusive, rather than exclusive, in our thinking.