Linked by David Adams on Tue 14th Jul 2015 23:21 UTC
Original OSNews Interviews From Linux Voice: "Perl 6 has been 15 years in the making, and is now due to be released at the end of this year. We speak to its creator to find out what’s going on."
Order by: Score:
Wait ...
by WorknMan on Wed 15th Jul 2015 00:38 UTC
WorknMan
Member since:
2005-11-13

From Linux Voice: "Perl 6 has been 15 years in the making, and is now due to be released at the end of this year.


I thought Perl 6 was just a specification and there were quite a few implementations of it which, to my knowledge, almost nobody was using. Is this not the case? Or is something changing?

Edited 2015-07-15 00:39 UTC

Reply Score: 3

RE: Wait ...
by CapEnt on Wed 15th Jul 2015 02:42 UTC in reply to "Wait ..."
CapEnt Member since:
2005-12-18

There is a reference grammar. He will freeze it.

For now, Perl 6 is quite a moving ground for any implementation. And, indeed, that's why nobody is using any implementation of it on production systems (AFAIK), despite the reference implementation of it being quite stable by now.

Reply Score: 5

RE[2]: Wait ...
by Delgarde on Wed 15th Jul 2015 04:30 UTC in reply to "RE: Wait ..."
Delgarde Member since:
2008-08-19

There is a reference grammar. He will freeze it.

For now, Perl 6 is quite a moving ground for any implementation. And, indeed, that's why nobody is using any implementation of it on production systems (AFAIK), despite the reference implementation of it being quite stable by now.


That, and the fact that it comes too late. Perl 6 has been a work in progress for fifteen years, and in that time, the world has moved on somewhat.

Fifteen years ago, I'd have used Perl for almost everything - now, I'd use Python for most of the same tasks, or sometimes Node. Perl is a powerful language, but compared to newer rivals, it's a pain in the ass to work with... and from what I've seen, Perl 6 doesn't offer enough improvement to win people back.

Reply Score: 5

RE[3]: Wait ...
by CapEnt on Wed 15th Jul 2015 06:29 UTC in reply to "RE[2]: Wait ..."
CapEnt Member since:
2005-12-18

Somewhat Perl 6 lost his reason to be since Perl 5 got his development resumed few years back.

So, Perl 5 himself evolved quite a bit these last fifteen years. Several features from Perl 6 ended being backported to Perl 5, and new ones was implemented, to the point that both languages now evolves in parallel. In many ways, Perl 6 got so long to be usable that Perl 5 got a life of his own.

Now we are in the odd situation of the old language supplanting the new one.

Reply Score: 3

What's the use case?
by ThomasFuhringer on Wed 15th Jul 2015 07:33 UTC
ThomasFuhringer
Member since:
2007-01-25

I have a hard time figuring out why somebody would use Perl since we have Python.

Reply Score: 1

RE: What's the use case?
by jim9000 on Wed 15th Jul 2015 21:35 UTC in reply to "What's the use case?"
jim9000 Member since:
2011-03-30

Brackets. Seriously. And CPAN

Reply Score: 2

RE[2]: What's the use case?
by Soulbender on Thu 16th Jul 2015 03:17 UTC in reply to "RE: What's the use case?"
Soulbender Member since:
2005-08-18

Sorry, pypi beats CPAN by miles.

Reply Score: 2

RE: What's the use case?
by Soulbender on Thu 16th Jul 2015 03:18 UTC in reply to "What's the use case?"
Soulbender Member since:
2005-08-18

It's great if you love to solve every problem using a regex ;)

Reply Score: 3

Comment by wigry
by wigry on Wed 15th Jul 2015 07:47 UTC
wigry
Member since:
2008-10-09

Perl - the language that looks exactly the same before and after encryption

Reply Score: 10

Why perl?
by project_2501 on Wed 15th Jul 2015 08:21 UTC
project_2501
Member since:
2006-03-20

It's 2015.

Languages are mostly fast enough. Loads are portable. Many are general purpose enough.

So given these luxuries .. Why would you not use a language that was easy to learn, easy to code, easy to read, easy to explain?

Niche stuff - sure use assmebler or C or whatever.

What's the reason to use perl? It doesn't have a monopoly on regex.

Reply Score: 5

RE: Why perl?
by Wondercool on Wed 15th Jul 2015 09:00 UTC in reply to "Why perl?"
Wondercool Member since:
2005-07-08

I can only speak from a personal point of view - I still code (professionally) in Perl from time to time.

I just love the language, mostly because there are 1000s of (perfectly good) ways to get the same thing done. That means that your own style and expression of coding are more important than in other languages.

When I started coding in Perl I was cursing it like anyone else, but I have come to appreciate the flexibility of the language and its versatility. For instance, it's quite an achievement that Perl supports Object Oriented Programming with a minimal change to the language.

I actually really like the language: hashes and arrays our of the box with all the manipulation functions, auto-vivification, interpolation of strings, file handling. Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.

I also like the gigantic library of useful code called CPAN and the extremely knowledgeable and friendly Perl community. See www.perlmonks.org

And I also really like the really good builtin documentation (perldoc), character and language support, package managers and mostly the builtin debugger.

It's just awesome!

Reply Score: 7

RE[2]: Why perl?
by cfgr on Wed 15th Jul 2015 12:00 UTC in reply to "RE: Why perl?"
cfgr Member since:
2009-07-18

I just love the language, mostly because there are 1000s of (perfectly good) ways to get the same thing done. That means that your own style and expression of coding are more important than in other languages.

That's funny as it's the complete opposite of the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."
https://www.python.org/dev/peps/pep-0020/

It's funny because Perl and Python are languages that have very similar use cases but have a very distinct ideology and approach.

I personally prefer Python's way. The expression is in the structure of your data and the architecture built around it, not in the code that is derived from it. Get your data structures right and the code should write itself.

That's nice about having the choice. We're all different and what doesn't work for me, might just work all the better for you. So let Perl flourish!

Edited 2015-07-15 12:02 UTC

Reply Score: 5

RE[3]: Why perl?
by Alfman on Wed 15th Jul 2015 14:24 UTC in reply to "RE[2]: Why perl?"
Alfman Member since:
2011-01-28

cfqr,

That's funny as it's the complete opposite of the Zen of Python: "There should be one-- and preferably only one --obvious way to do it."


I still use perl because it's always there (alot like VI actually), but this 1000s of ways has got to be one of my biggest gripes with it, since there's absolutely no possibility of mastering it. Everyone just learns a small subset and goes with it, this is especially true with modules. Devs wanting something better keep building new modules and wrappers with enhancements, which would be fine except that thousands of developers have the same idea. Without more discipline in synchronizing their work, it results in severe duplication and "not invented here" syndrome.


http://perldoc.perl.org/functions/localtime.html
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my @abbr = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
print "$abbr[$mon] $mday";
# $mon=9, $mday=18 gives "Oct 18"
$year += 1900;


use Time::localtime;
printf "Year is %d\n", localtime->year() + 1900;


http://search.cpan.org/~drolsky/DateTime-1.20/lib/DateTime.pm
use DateTime;
$dt = DateTime->now; # same as ( epoch => time() )
$year = $dt->year;
$month = $dt->month; # 1-12
$day = $dt->day; # 1-31
# all of the start-at-1 methods above have corresponding start-at-0
# methods, such as $dt->day_of_month_0, $dt->month_0 and so on
$ymd = $dt->ymd; # 2002-12-06
$ymd = $dt->ymd('/'); # 2002/12/06


use Date::Simple (':all');
my $date2 = ymd($year, $month, $day);
my $today = today();


use Date::Time;
my $date=Date::Time->new();


...More modules for date parsing..
use Date::Parse;
$time = str2time($date);
($ss,$mm,$hh,$day,$month,$year,$zone) = strptime($date);


use Date::Manip qw(ParseDate);
$date=ParseDate($datestr);



There's a bewildering array of similar yet different solutions for everything. You really need to look at CPAN to appreciate the scope of the problem.
http://search.cpan.org/search?query=time&mode=module
http://search.cpan.org/search?query=date&mode=module

http://search.cpan.org/search?query=socket&mode=module
http://search.cpan.org/search?query=ipc&mode=module
http://search.cpan.org/search?query=sql&mode=module
http://search.cpan.org/search?query=cgi&mode=module


When I write perl, I find this extremely discouraging, I'd rather have a much more standardized framework with fewer & better solutions. Maybe I need to build my own.
/sarcasm

Reply Score: 4

RE[4]: Why perl?
by cfgr on Wed 15th Jul 2015 15:34 UTC in reply to "RE[3]: Why perl?"
cfgr Member since:
2009-07-18

Yep, that's one of the two main reasons I don't really like Perl. The other being that Perl's syntax is just too cryptic and ugly.

Personal styles usually suck anyway. I've always followed a very clean coding style, or so I thought, until I threw my (python) code through a PEP8 linter. I didn't believe it would make much difference, but the readability and consistency definitely improved. Some very smart people gave those things a lot of thought, why would my gut feeling be any better?

But then, I guess everyone's got different preferences and who am I to deny others having fun. Some people love puzzling. Let them enjoy it! As long as they stay away from my work.

As a side note, the above is also a bit why I'm not a huge fan of templating inside languages (such as Clojure). It again provides too many ways in which you can express the same thing. I'd rather have more explicit templating outside the language (i.e. strings or different files).

Edited 2015-07-15 15:46 UTC

Reply Score: 3

RE[5]: Why perl?
by Soulbender on Thu 16th Jul 2015 03:27 UTC in reply to "RE[4]: Why perl?"
Soulbender Member since:
2005-08-18

until I threw my (python) code through a PEP8 linter.


PEP8 is one of the best things about Python.

Reply Score: 3

RE[4]: Why perl?
by Wondercool on Wed 15th Jul 2015 15:47 UTC in reply to "RE[3]: Why perl?"
Wondercool Member since:
2005-07-08

IMHO the fact that there are 15 different Date modules in CPAN isn't a big problem at all, it is a feature.

Just like the 10s of Desktop managers, init systems, file systems, distributions in Linux, this is what makes it strong. It means you aren't coerced into using some shitty API but can pick what suits you.

Edited 2015-07-15 15:59 UTC

Reply Score: 2

RE[5]: Why perl?
by acobar on Wed 15th Jul 2015 16:31 UTC in reply to "RE[4]: Why perl?"
acobar Member since:
2005-11-15

Had you ever worked with maintenance of code of someone else besides you ? If you had, chances are that you wished the coder had stick with standardized libraries instead of picking some random he thought were great and that didn't receive maintenance for a long time (i.e. is close to an abandoned carcass by then).

Anyway, I am not sure if my sarcasm detector is waning. ;)

Edited 2015-07-15 16:34 UTC

Reply Score: 4

RE[6]: Why perl?
by Wondercool on Wed 15th Jul 2015 16:43 UTC in reply to "RE[5]: Why perl?"
Wondercool Member since:
2005-07-08

I do maintain code written by others but the problems we solve aren't in the league of extremely complicated algorithms or problems and as such most code is still readable, just not my taste.

But yeah in Perl this is a bigger problem than in other languages but if you program often in Perl I don't think it is a big issue at all. I am certainly not a proponent of using exotic language features unless it is required.

That said: I don't think libraries are a particular problem of Perl. Just compare with Java where you have Log4j, SL4J, Logback just to name a few logging frameworks. Nowadays knowing your library is half the work, but that applies to many languages.

Reply Score: 2

RE[7]: Why perl?
by Alfman on Wed 15th Jul 2015 19:47 UTC in reply to "RE[6]: Why perl?"
Alfman Member since:
2011-01-28

Wondercool,


That said: I don't think libraries are a particular problem of Perl. Just compare with Java where you have Log4j, SL4J, Logback just to name a few logging frameworks. Nowadays knowing your library is half the work, but that applies to many languages.



Certainly this is true to an extent, but at least the standard Java libraries are designed under collaboration with the developers of the rest of the framework.

Perl modules are strewn together with no evidence of coordination at all. This wasn't so bad in the early days of programming when projects were self contained and the end result was all that mattered. But today's software is complex, requiring mashups of independent projects with many different subsystems working together. The absence of standard framework foundations can lead to unnecessary complexity and frustration when different pieces of the project use different abstraction libraries to represent the exact same data.

As you say, this problem isn't always unique to perl, but it is magnitudes worse. As cfqr pointed out above, some language designers explicitly aim to build a strong standardized foundation. Perl never had this goal, which is why it never achieved it.

IMHO perl is fine for small utilities and scripting, which is how I use it; I even prefer perl to bash any day! But I think the general consensus would be to avoid it for general large scale application development.

Reply Score: 4

RE[3]: Why perl?
by Wondercool on Wed 15th Jul 2015 15:58 UTC in reply to "RE[2]: Why perl?"
Wondercool Member since:
2005-07-08

In natural language you wouldn't expect people to all speak the same sentence for the same situation or even the same language.

How boring would it be if all would always say 'Good day' instead of 'Hi', 'How are you?', 'Nice day', 'Bonjour'

The exercise of a computer language is to create a language that is understandable by humans while still possible to compile into something the machine understands.

I don't like forcing people into a certain format.
An example would be:

if ($opt_v) {
print “Some verbose message \n”;
}
Vs.
$opt_v && print “Some verbose message\n”;
Vs.
print “Some verbose message\n” unless !$opt_v
Vs.
print “Some verbose message\n” if $opt_v

Why would I force a programmer to use exactly one of these methods? The more expressive the language, the greater chance of creating beauty, IMHO.

Reply Score: 3

RE[4]: Why perl?
by Delgarde on Wed 15th Jul 2015 21:40 UTC in reply to "RE[3]: Why perl?"
Delgarde Member since:
2008-08-19

The more expressive the language, the greater chance of creating beauty, IMHO.


It's a programming language, not a human one. It's not supposed to be beautiful - it's supposed to be functional, and it's supposed to be maintainable. Beauty is a bonus.

Reply Score: 3

RE[5]: Why perl?
by Wondercool on Wed 15th Jul 2015 22:13 UTC in reply to "RE[4]: Why perl?"
Wondercool Member since:
2005-07-08

I strongly disagree with that sentiment. If that's the case why aren't we all programming in Fortran or Cobol? Both are perfectly functional and Cobol particularly is quite maintainable and easy to read.

Also - and this is hard to define, it is a subjective feeling - it seems to me that elegant, pleasant, concise, well formatted, 'beautiful' code is easy to maintain rather than the stuff that just fits the coding standards of the company.

Reply Score: 2

RE[6]: Why perl?
by Delgarde on Thu 16th Jul 2015 01:38 UTC in reply to "RE[5]: Why perl?"
Delgarde Member since:
2008-08-19

I strongly disagree with that sentiment. If that's the case why aren't we all programming in Fortran or Cobol? Both are perfectly functional and Cobol particularly is quite maintainable and easy to read.


Because they're not all equally functional for a job. There are problems for which Fortran is traditionally very well suited, hence it's ongoing popularity for those problems - for those problems, it does the job required better than anything else.

But you wouldn't use it for everything, because for other problems, other languages do a superior job of expressing the solution to that problem. And it's nothing to do with beauty, any more than the decision to use a hammer versus a screwdriver for nails and screws - it's simply that a hammer works better for one case, and the screwdriver works better for another.

And my problem with Perl is that while it used to be indispensable to me as a tool, these days I can't think of any problem that another tool won't be at least as well suited.

Also - and this is hard to define, it is a subjective feeling - it seems to me that elegant, pleasant, concise, well formatted, 'beautiful' code is easy to maintain rather than the stuff that just fits the coding standards of the company.


I think you have that around the wrong way. The purpose of writing concise, well-formatted code is to ensure that the next person to maintain it (possibly yourself) can read it. Maintainability is the driver - any aesthetic quality is a side-effect of something well suited to purpose...

Reply Score: 3

RE[4]: Why perl?
by WorknMan on Thu 16th Jul 2015 02:08 UTC in reply to "RE[3]: Why perl?"
WorknMan Member since:
2005-11-13

Why would I force a programmer to use exactly one of these methods? The more expressive the language, the greater chance of creating beauty, IMHO.


Personally, I'll take readability over beauty any day. I don't give a damn if it looks 'boring' or not.

Reply Score: 3

RE[2]: Why perl?
by Bill Shooter of Bul on Wed 15th Jul 2015 14:05 UTC in reply to "RE: Why perl?"
Bill Shooter of Bul Member since:
2006-07-14

I just love the language, mostly because there are 1000s of (perfectly good) ways to get the same thing done. That means that your own style and expression of coding are more important than in other languages.


This is why I never want to use it for anything that anyone else will ever contribute to. Everyone has their own style and in perl they are greatly exaggerated and its difficult to get people to switch

Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.


Yes, I agree. And yes its difficutl to get more than a few people to share the required discipline.

Reply Score: 3

RE[3]: Why perl?
by WorknMan on Wed 15th Jul 2015 15:18 UTC in reply to "RE[2]: Why perl?"
WorknMan Member since:
2005-11-13

This is why I never want to use it for anything that anyone else will ever contribute to. Everyone has their own style and in perl they are greatly exaggerated and its difficult to get people to switch


Yeah. I've (unfortunately) had to maintain some perl code and quickly realized that out of the 9,000 different ways there are to do one thing in perl, perl coders usually gravitate to the most cryptic and hard to read way, because they seem more interested in showing off than actually writing readable code. And you know what I'm talking about too... the kind of code that looks like modem line noise, without a comment in sight.

And I think they do it on purpose too. If you ask me, they've gotta be compensating for something. Penis size, perhaps ;)

Edited 2015-07-15 15:20 UTC

Reply Score: 4

RE[4]: Why perl?
by Bill Shooter of Bul on Wed 15th Jul 2015 15:34 UTC in reply to "RE[3]: Why perl?"
Bill Shooter of Bul Member since:
2006-07-14

The modem static noise style is great, but it takes too long to load up all that parsing logic in your head unless you do it on a daily basis. I deal with output that's as crazy as that regularly. But it just becomes second nature. But yeah, I've turned down perl jobs because its just too much to maintain.

Reply Score: 3

RE[2]: Why perl?
by Delgarde on Wed 15th Jul 2015 21:22 UTC in reply to "RE: Why perl?"
Delgarde Member since:
2008-08-19

I just love the language, mostly because there are 1000s of (perfectly good) ways to get the same thing done. That means that your own style and expression of coding are more important than in other languages.

Which is funny, because I (and most of my colleagues) regard that as one of it's biggest weaknesses. Too many ways to do the same thing, so that unless you're an expert in all of them, it's all but impossible to maintain code written by someone else according to their own personal style and expression.

I actually really like the language: hashes and arrays our of the box with all the manipulation functions, auto-vivification, interpolation of strings, file handling. Yes you can screw it up the readability royally and the language requires discipline but at least everything is possible.


It's been a long time since most of those features were considered to be anything more than *absolute minimum* functionality for any popular scripting language.

Reply Score: 3

RE[3]: Why perl?
by Wondercool on Wed 15th Jul 2015 22:00 UTC in reply to "RE[2]: Why perl?"
Wondercool Member since:
2005-07-08

It's been a long time since most of those features were considered to be anything more than *absolute minimum* functionality for any popular scripting language.


You would think so, I tried to learn Ruby lately but it isn't easy. I couldn't understand why it wouldn't accept constructs like my_array[][] and it turns out that you have to create your own overloading to do auto-vivification. I just couldn't believe it.

Reply Score: 2

RE[4]: Why perl?
by Delgarde on Thu 16th Jul 2015 01:55 UTC in reply to "RE[3]: Why perl?"
Delgarde Member since:
2008-08-19

You would think so, I tried to learn Ruby lately but it isn't easy. I couldn't understand why it wouldn't accept constructs like my_array[][] and it turns out that you have to create your own overloading to do auto-vivification. I just couldn't believe it.


"Most" of those features, I said. Auto-vivification isn't supported by many other languages, but you're also citing such basic things as arrays, maps, and file handling. These aren't exactly unusual features in a scripting language...

As to auto-vivification, it *is* a nice feature, particularly for nested map structures, but not so nice as to outweigh all the other issues with the language...

Reply Score: 3

RE[4]: Why perl?
by cfgr on Thu 16th Jul 2015 08:13 UTC in reply to "RE[3]: Why perl?"
cfgr Member since:
2009-07-18

Autovivication causes headache and bugs. I'd rather initialise an object explicitly. It's just too error prone and it takes too long to figure out what's going on: "are we accessing something that is already initialised or did the author intend to initialise it here? Or did the author make a mistake by accessing something that he forgot to initialise somewhere?"

There is also no coherence, some functions do it, others do not. It consumes more brainpower than necessary, energy that could be used for more important things.

Edited 2015-07-16 08:14 UTC

Reply Score: 3

RE: Why perl?
by sergio on Wed 15th Jul 2015 17:30 UTC in reply to "Why perl?"
sergio Member since:
2005-07-06

Availability and compatibility. It's very useful today for all unix admins.

I still use Perl because it's installed by default in almost all unix flavors (even the very old ones).

If I create a Perl script I know it will run in Solaris, AIX, HP-UX and Linux without the need of installing anything. That's a bless if you support heterogeneous unix environments.

Python is very popular in the Linux world and It's a pretty language yes, but it's not so common in the Unix world. I don't like Perl, but It saved my ass so many times.

Reply Score: 4