Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] perl? (was: Employment for "oldies")



On Mon, 15 Aug 2016 21:44:36 +0900
"Stephen J. Turnbull" <turnbull.stephen.fw@example.com> wrote:

> Attila Kinali writes:
> 
>  > And this is, what I hate with python. The constant need to check
>  > and rewrite scripts when updating python, because something might
>  > have changed in the language, subtely breaking things.
> 
> This is true in any language.
> 
> I don't know what distro you use; I have never had a well-spec'd
> Python package (ie, specifying python-x.y in the shebang) fail when
> updating Python (almost all my experience is limited to Debian,
> MacPorts, and (long ago) Fink).  Sure, you end up with 3 or 7 Python
> installations, but so what?  Disk is cheap.

Yes. But that's what i'm exactly talking about. With perl I had very
seldom the need to specify the version I am using. And if, it was only
a "use at minimum this version, anything later is ok". With one exception
(see below) there was never a case where something I wrote didn't run with
a modern version of perl. And some of my code has been written for 5.005
and still works unmodified for >15 years.

The one exception where I ran into a compatibility problem with perl
was with my VHDL parser. In order to count the paranthesis i needed
a perl regexp feature that had a big fat "WARNING! EXPERIMENTAL FEATURE!
DO NOT USE! THE SYNTAX IS SUBJECT TO CHANGE!" written in the description.
Needless to say the syntax changed at some point.

> But that used to be a major pain with Perl 5.y -> 5.(y+k) updates on
> Debian -- even Debian packaging itself went deeeep south in the middle
> of an upgrade on one occasion, and I had reinstall from disk and wait
> for the fix at Debian (which was released in like 18 hours, but
> still...).  I seem to recall that for a while Debian had 3 system
> perls (5.8, 5.12, 5.16+), which never happened with Python-based
> distros, and it took Debian like forever to get rid of 5.8 and then
> 5.12.

I must have ignored that :-) I only ever used /usr/bin/perl and everything
was fine. And the only perl fuck-up in debian/unstable that I remember was
somewhen in the early 2000's... 2001 or 2002 or so... And as you wrote,
it was all just wait a day until the fix is out before you upgrade.


>  > Python, like any other language, is for me a tool to get work
>  > done. I don't want to invest time into keeping scripts alive that
>  > i've written and that otherwise work fine.
> 
> So put "python-x.y" into the shebang and you'll be fine.
> 
> But that's just the theory.  Pragmatically, if you don't already know
> that much, you're probably too far behind in Python knowledge to ever
> catch up to your Perl for that purpose.  

So, why isn't this written at the beginning of every python book
in big friendly letters? It takes some time to figure out that one
has to restrict the version down to the minor. It also creates problems
with maintaining scripts for a long time, because eventually, the python
version i am using will be removed from the distro. I wrote my first python
scripts around python 2.4. Which current distro still has a 2.4 version around?
Even with debian/stale, the oldest version you get is a 2.7. So your
only choice is either python 2.7 or 3.x. What am I going to do with
that script I wrote 5 years ago?

> Why even think about changing?
> (Unless just for the fun of learning a new language.)

Because it is a tool. Other people use it. And I want to use their code.
I am not such a bigot to think that my favorite language is the one
and only and that everything else is not even worth considering.
Even if i'm just using some application written in python and not
developing using it, I do have to fix bugs or adapt it to my specific
needs more often than not. And in these cases I need to understand what
went wrong and why. To be able to do that, I need to write python to learn it.
And yes, learning a new language is fun...though i should problably
invest my time rather in haskell than in python ;-)


>  > > How does that fit with "modern Perl"?  Or is it just a separate
>  > > reason for using Perl?
>  > 
>  > As perl5 didn't change much over the past 15 years, it's still a
>  > magnificent language for text processing.
> 
> I never found it magnificent; it was a cult to be indoctrinated into
> (like Emacs Lisp).  Way too much much magic (eg, barewords that were
> actually strings and strings that were interpreted as integers) and
> implicit variables that I had to keep in my head.  Doing Emacs Lisp
> was enough of that for me -- and there is no alternative to Emacs if
> you want "something like" Emacs.  No energy to learn effective Perl. :-(

Interesting. I never felt that way. Yes, perl is cryptic, almost archaic
at places. But as someone comming from shell scripting, most of it
feels kind of a natural extension. Yes, if you see a #@$_ it's weird
at first, but you get used to it. Like the latin-german incantations
at your local satanic cult.

 
>  > generally speaking, my way of writing perl didn't change much over
>  > time (yes, some of my newly written scritps still look like
>  > butchered awk scripts).
> 
> I suspect that's *not* what Josh meant by "modern Perl" for large
> projects. :-)

What? It isn't? Damn.. And there I thought I knew perl!


			Attila Kinali

-- 
It is upon moral qualities that a society is ultimately founded. All 
the prosperity and technological sophistication in the world is of no 
use without that foundation.
                 -- Miss Matheson, The Diamond Age, Neil Stephenson


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links