With Fear and Wonder ...
That's how I have been approaching each piece of new Perl 6 information I've encountered.
I fear Perl 6, as I fear all things new. Over the years, I've studied and programmed
in several languages, but I've only felt comfortable -- only truly enjoyed -- programming
in Perl. I've devoted a lot of time to learning more and more Perl. I suppose it's only
natural to feel some trepidation -- even Fear -- when something that has become a big part
of your life is "threatened." Even TheDamian's recent Perl Journal article (showing how
similar Perl 6 still is to Perl 5) has done little to allay my discomfort.
Some monks have said that it was probably the same way in the transition from Perl 4 to Perl 5;
they obviously weren't there. :-)
I started Perl programming with Perl 4, and (sadly) had a chance to revisit it in my most
recent project. The porting process from 4 to 5, at least for my applications, was: install
Perl 5, then run the P4 program. I could then add P5 features (like references)
as I wanted. The change was as seamless as possible.
I apparently won't be able to do that with Perl 6. Although P5 programs will run under
P6 (in a "compatibility" mode), every program will either be a Perl 5 or Perl 6 program.
So programming in Perl 6 will require diving into a full P6 program, with little or no
opportunity to comfortably test out new features.
And yet I stand in Wonder at all the ways that Perl 6 will make some common programming
tasks even easier, fix P5 design problems, and borrow even more good ideas from
even more languages than Perl 5. So although I could continue using Perl 5 indefinitely,
I know I won't; the New Frontier is too exciting.
(I could make a list here of all the Perl 6 features I'm excited about, but that would be
an entire meditation itself.)
All in all, I'm looking forward to Perl 6. But I have trouble as seeing it as the next
stage in the evolution of Perl 5. Instead, it seems like a new Perl-like language that --
perhaps -- I will learn to enjoy as much as Perl.
I hope I've adequately expressed my feelings. I've held off posting this meditation for a while, trying to find the right approach. :-)
Impossible Robot
Re: With Fear and Wonder
by Juerd (Abbot) on Apr 04, 2002 at 07:40 UTC
|
As far as I can see, the three biggest changes in existing syntax are:
- Sigils don't change on different access (%foo[1])
- Arrow is replaced by dot, concatenation is done by underscore
- For's topic's location changes (for @foos -> $foo) and C-style loops are done with loop
So how will converting scripts go?
-
Because the sigils don't change, $foo[1] will unambiguously mean $foo.[1] (Perl 5: $foo->[1]). That means that converting existing scripts will be easiest when you simply replace %foo by $foo, instead of the other way around. If I understand correctly, context will force $foo into being a hash reference.
-
First, replace all dots by underscores, adding whitespace if it's not already there. (You may want to rething your design anyway. Perhaps the stringifying unary underscore can help you out: _($foo, $bar, $baz).) Then, simply substitute arrows for dots - or remove them, if you're not calling an object method, because $ref->{foo} will be $ref.{foo} which can be shortened to $ref{foo} (which is element 'foo' of hash %$ref, not hash %ref!)
-
Then, find all for and foreach loops, and change them
That'll be quite a hassle... BUT... There will be a Perl5-to-Perl6 conversion script, so I don't think it'll be a problem. I think the general conversion process will be:
- Backup
- Automatically convert
- Try
- Fix
- Try again
And then, you can enjoy Perl 6's new features. I think converting existing scripts is a small price to pay for the great improvements this new language will have. Yes, I do consider Perl 6 to be a new language - it's not (Perl 5)++, it's Perl 6.
Besides, Perl 5 will be around for a long time. This WILL be like the 4-to-5 transition: it'll take at least two years before the general Perl public is used to Perl 6 and has enough trust in it to actually start using it. We now ask ourselves how we have managed without references. We will ask ourselves how we have managed without hyper-operators (^+), the default-operator (//, err) and given/when blocks.
U28geW91IGNhbiBhbGwgcm90MTMgY
W5kIHBhY2soKS4gQnV0IGRvIHlvdS
ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
geW91IHNlZSBpdD8gIC0tIEp1ZXJk
| [reply] |
Re: With Fear and Wonder
by belg4mit (Prior) on Apr 03, 2002 at 19:29 UTC
|
| [reply] |
Re: With Fear and Wonder
by shotgunefx (Parson) on Apr 03, 2002 at 19:56 UTC
|
I'm looking forward to many of the features of Perl 6, but I really, really dislike some of the syntax changes. I think reusing operators with a new functionality is bound to trip me up (NEXT/continue for example). I don't like the dot but I figure I can learn to live with it. And as many have expressed, I hate the concantenation op. I think having an identifier character as an op is silly and hard to read. I guess I'll just triple space around it so there is no confusion
-Lee
"To be civilized is to deny one's nature." | [reply] |
Re: With Fear and Wonder
by BigAl (Scribe) on Apr 04, 2002 at 00:16 UTC
|
I understand where you're coming from. And you're not alone. Alot of people have the same mixed reaction of fear and anticipation. But the changes really aren't that major. Perl 6 is kind of like "Perl with tabasco" and you can (mostly) skip the tabasco if you want.
I think this is one advantage of the Perl 6 design strategy: every change, every development is public. By the time the design is finished and a Perl 6 interpreter is production-ready, most people will be familiar with the changes. It won't be strange and new, but old and comfortable, as easy as print. I already find myself typing along in Perl 5 and trying to stick in Perl 6 features and syntax. Then I pause, frustrated, and have to "back-translate" (maybe I should write a p62p5 translator :). Others will be infected similarly. And those that aren't will have a large group of more knowledgeable users to help them, just like they do now. Do you remember who first introduced you to the joy of map? Users around the world will find it's exactly the same with given, etc. It's a cool feature they never knew they had before, but now that they know it, they'll use it every chance they get.
"You can do things that change everything without changing anything." -- Brian Ingerson on Perl 6, YAPC::NA::2001 | [reply] [d/l] [select] |
Re: With Fear and Wonder
by blackflag (Novice) on Apr 03, 2002 at 23:08 UTC
|
I too have been fearful of the upcoming Perl 6 release. I don't want to completely relearn the language, and I do not wish that the easy to use Perl 5 syntax will change. However, I trust Larry Wall and the other Perl 6 developers will make a comparable (and hopefully better) language. These are the same people that have written the other versions of Perl, so I doubt they will wander far from Perl's current path. From what I have read so far, the changes that they are making are extremely good.
Peace, BlackFlag. | [reply] |
|
This is a kind of philosophical issue. You probably won't be successful as an IT person (read, computer geek) in the long run if you are not comfortable at learning and even relearning from scratch several times a year. I thought it over many times from the very moment I was presented with a chance to choose this occupation, this way of life. And that perpetual learning, eternal school excites me much :) I find the root of all computer-related fun in this very aspect!
| [reply] |
Re: With Fear and Wonder
by tmiklas (Hermit) on Apr 04, 2002 at 13:09 UTC
|
I'm afraid a bit of Perl 6 changes, but i cant stop perls' evolution and i really don't want it to stop, but i'm afraid of it ;-)
Afraid of what you ask? Changes, relearning of my favourite language, shortage of time... If i think of all the scripts i'll have to change manually or even convert them to P6 notation i feel sick ;-)
But there are also some advantages of that situation:
- a bit of adrenaline is a good thing ;-) (try jumping out of a plane ;-P)
- i'll improve my programming skills
- it's a great opportunity to learn something new
- changes are the best things in the world
Why? One of my friends told me one day that all the changes are good things - even if they *hurt* at the moment. Maybe sad, but i believe that's true! If Larry says that it would be better, i believe him. If something has changed, it means that the change was needed - that's all.
So i'm not afraid of changes... I'm afraid of myself - if i could get used to those new features, notations, etc. ;-)
BIG smile!
Greetz, Tom. | [reply] |
Re: With Fear and Wonder
by Matts (Deacon) on Apr 05, 2002 at 10:50 UTC
|
This leads into another question for me (I'm not saying what I think the answer is):
Is Perl 6 going to be any more "Perl" (i.e. the same language we've seen evolve from Perl 1 through 5) than say Ruby? | [reply] |
|
|