News for hackers. Stuff that matters.
Re:“2015 will be the year that Perl 6 officially launches fo... by lmm on Friday November 07, 2014 @06:54AM (#8572098)
Perl was, in its day, a breath of fresh air. It had an emphasis on practicality that made easy things very easy: regex literals, default arguments like $_, minimal syntax overhead, with things that would be syntax in other languages hoisted to interpreter args (-e, that arg that means "run this as an awk-style loop"), and so on. More than that, the project worked as a holistic ecosystem, rather than just a language and some tools: these days every language has something like CPAN, but it was a huge innovation at the time. Perl also pioneered a lot of the unit-testing infrastructure that we take for granted these days; every project in CPAN was expected to have tests, using the same libraries, and they ran as part of the install process. A cynic might say that perl innovated here out of necessity; lacking static typing and not having VM isolation means good unit tests are a necessity. But still, the resulting infrastructure is very good, and some very solid programs are written in perl. In many ways I'd say it was the go of its day.

The downside of the emphasis on practicality was that the language always suffered from incoherence; with no principled foundation it's been slow to adapt as the practical things users want to do change (e.g. I'd argue string manipulation is a lot less important than it used to be - if you were writing perl today, you might give json manipulation the same prominence as regexes). Perl 6 may have been an effort to fix this, but went too far in the opposite direction; overly formalized, with a premature separation between VM and language that massively slowed development.

There's a lot of good stuff about modern perl - Moose and the like - but IMO it's too little, too late; other languages have been able to improve their infrastructure to (mostly) match perl for easy things. Meanwhile perl's incoherence makes it very hard to write large programs and solve hard problems, where languages with a firmer theoretical foundation and stronger stylistic principles have a huge advantage.

Re:“2015 will be the year that Perl 6 officially launches fo... by mst on Friday November 07, 2014 @07:43AM (#8572234)
Every time I try to write ruby or python code, as soon as I need to write classes I realise just how much boilerplate they require compared to Moose and how depressing not having first-class attributes, method modifiers and roles is, and end up back writing perl5.
Re:“2015 will be the year that Perl 6 officially launches fo... by fennecfoxen on Friday November 07, 2014 @08:01AM (#8572297)
As someone who has written both Perl and Ruby (in that order), you might be interested in this Ruby gem to alleviate at least some of those problems: https://github.com/solnic/virtus
Re:“2015 will be the year that Perl 6 officially launches fo... by Diederich on Friday November 07, 2014 @07:49PM (#8575516)
This is a thoughtful post, thank you.

> Meanwhile perl's incoherence makes it very hard to write large programs and solve hard problems ...

I've been on teams writing very large systems solving very hard problems in Perl 5 for more than 20 years. I know that some of that stuff that was written in the 90s is still under active development and maintenance today, even though it's several developer generations in the past.

Perl 5 may or may not be 'incoherent'. It is certainly somewhat idiosyncratic. But so is JavaScript, perhaps to a lesser degree.

Perl 5 in the large requires some somewhat different (but not too difficult) disciplines.

But that's not so different than most other languages.

> In many ways I'd say it was the go of its day.

This made me smile! Thank you again.

Re:“2015 will be the year that Perl 6 officially launches fo... by lmm on Saturday November 08, 2014 @04:22AM (#8576425)
> Perl 5 may or may not be 'incoherent'. It is certainly somewhat idiosyncratic. But so is JavaScript, perhaps to a lesser degree.

I think if "it's not a lot worse than Javascript" is the best you can say in its favour...

> Perl 5 in the large requires some somewhat different (but not too difficult) disciplines. But that's not so different than most other languages.

The problem I always saw was that libraries would follow their own styles, so once you had a project that depended closely on several different libraries you'd be forced to cut against the grain of several of them. It's a problem that's lessened in a language with a single standard way of doing OO, a single standard way to do event-driven I/O, or even trivial things like code formatting. Maybe the perl community has found more of a consensus in recent years.

Nowadays I work almost completely in scala, which some people compare to perl, so I'm concerned about not repeating perl's decline in popularity.

Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @11:55AM (#8580233)
> The problem I always saw was that libraries would follow their own styles, so once you had a project that depended closely on several different libraries you'd be forced to cut against the grain of several of them. It's a problem that's lessened in a language with a single standard way of doing OO, a single standard way to do event-driven I/O, or even trivial things like code formatting.

The Perl 6 language design directly addresses this problem. The intent is to avoid throwing out the baby (making both timtowtdi and long term language evolution practical) with the bath water (lack of composability of the various ways to do things and of new features that emerge). The Rakudo implementation is most of the way there.

Re:“2015 will be the year that Perl 6 officially launches fo... by GregBuchholz on Friday November 07, 2014 @04:19PM (#8574672)
I think the impact of Perl is even bigger than what you are describing. I kind of see Perl as the first language which finally lead the masses out of the wilderness-of-C, and brought forth the light of reference-counting/garbage-collection (no more manual memory management and segfaults), dynamic typing, and "advanced" data structures like hashes/dictionaries (no more off-by-one errors, no more buggy reimplementations with pointer chasing). And actual honest-to-goodness strings, not null-terminated abominations. All without out a syntax that was too scary or unfamiliar. In the 90's Perl was the gateway drug to the more lispy future that we now inhabit.
Re:“2015 will be the year that Perl 6 officially launches fo... by Roboprog on Saturday November 08, 2014 @12:39AM (#8576144)
I like that Perl 5 uses reference counting instead of a full-blown GC and that small scripts start up quickly with a small memory footprint. Alas, Perl 6 went down the garbage collecting virtual machine path, at which point, it has to catch up with Java while trying to differentiate itself from it.
Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Saturday November 08, 2014 @01:01AM (#8576179)
What startup delay and RAM usage do you think is just too large to be acceptable for a small script, no matter how good a language/compiler is in other respects?
Re:“2015 will be the year that Perl 6 officially launches fo... by Roboprog on Saturday November 08, 2014 @02:30PM (#8577897)
Good question, and I'm not even sure. Perl 5 on my Mac is about 1.2 MB resident to run a one-liner, though, and I'm pretty sure I can't load the JVM in 1 or 2 MB. Need to follow up on that to find smallest practical Java program (as a contrast)

Similarly (same laptop), I can get perl to print its version (5.16.2) in about 0.01 secs (2nd time), but java (1.8.0_11-b12) takes about 0.11 secs (2nd time).

Most of my work is in Java, but it gets to be a tyrannical hammer that must be used for everything in some minds :-(

Again: Parrot having to compete with the JVM makes me sad.

Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @08:47AM (#8579887)
Fwiw most Rakudo devs now prefer MoarVM for most things because it's generally the fastest, leanest, least buggy and most specification compliant of the currently available backends (MoarVM, JVM, Parrot). MoarVM is definitely the right pick for folk who want the leanest startup P6 can deliver.

http://moarvm.org/

Even with the MoarVM backend, Rakudo takes a lot more time and RAM to startup than the compiler for most mainstream languages. It handily beats the JVMs devs use but that's not saying much.

On the third hand, a few devs have said they are regularly using Rakudo at $work, including for one-liners.

If anyone wants to try P6 I recommend RakudoBrew:

https://github.com/tadzik/rakudobrew

Re:“2015 will be the year that Perl 6 officially launches fo... by lmm on Friday November 07, 2014 @05:22PM (#8574976)
Maybe. I think people underestimate the importance of TCL, because it was (relatively) buried so shortly after (mostly for political reasons) - it had a lot of influence on Python in particular. But my perspective is of course coloured by my own experience.
Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @12:04PM (#8580255)
> Perl 6 may have been an effort to fix this, but went too far in the opposite direction; overly formalized, with a premature separation between VM and language that massively slowed development.

I also think the Parrot VM project added a few years to P6's gestation.

When you say "overly formalized", perhaps you mean the early break out of mailing lists and especially the Parrot project? I don't think "overly formalized" fits the last decade of Perl 6 development -- Pugs (2005 - 2007) was distinctly anarchistic.

Re:“2015 will be the year that Perl 6 officially launches fo... by JohnBooty on Friday November 07, 2014 @08:55AM (#8572467)
I've been farting around the software world for a while (but have never touched Perl) and that's the best explanation of Perl's appeal that I've ever read.
Re:“2015 will be the year that Perl 6 officially launches fo... by huherto on Friday November 07, 2014 @08:43AM (#8572426)
> The downside of the emphasis on practicality was that the language always suffered from incoherence

IMHO, it was coherent. But the syntax is wierd (may be usage of symbols $%@{}[] ) for people unfamiliar with it.

I haven't done big projects with perl in the last 12 years. But when I need it, it is like riding a bike.

Re:“2015 will be the year that Perl 6 officially launches fo... by danielweber on Friday November 07, 2014 @09:30AM (#8572610)
Perl optimized itself to death. They wanted a new feature, realized they could save 3 keystrokes per day by using $‽ for some new feature, all the experts agreed, and they go with it.

I'm really afraid that Rails is going the same way, that the DRY mantra is going to eventually lead to a Huffman encoding only parseable by Rails experts, and then no one new will want to get on board.

Re:“2015 will be the year that Perl 6 officially launches fo... by rlucas on Friday November 07, 2014 @01:31PM (#8573929)
Perl's "magic" variables like "$?" were not named to optimize keystrokes.

Most of Perl 5's syntax comes from well established (for perhaps a decade) UNIX culture, from shell, awk, sed, and C syntax conventions. Vanishingly little is actually novel to Perl.

Rails, which is obviously not a peer to Perl, but which you bring up as "going the same way," does similarly have a huge emphasis on convention. But most of its conventions are de novo, made up within the Rails/Ruby community.

You can hate Perl (5) all you like; no accounting for taste and all. But if you find parts of it unfamiliar, it's probably because you are ignoring (or ignorant of) where it came from.

Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @08:45PM (#8581650)
Repeat post with better formatting:

Standard Perl 6 has just these non-English variables:

- $_ means "it"

- @_ means "args"

- $! means "current exception/error"

- $/ means "last match"

- $0 means $/[0], the first captured value of the last match

All other system variables have understandable English names, eg:

- $IN means the STDIN object/handle

- $OUT means the STDOUT object/handle

- %ENV means a hash (dict, associative array) of system environment variables

- $PID means the system process id

- $*KERNEL means the operating system kernel running under

Etc.

Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @11:47AM (#8580213)
Standard Perl 6 has just these non-English variables:

* $_ means "it" * @_ means "args" * $! means "current exception/error" * $/ means "last match" * $0 means $/[0], the first captured value of the last match

All other system variables have understandable English names, eg:

* $IN means the STDIN object/handle $OUT means the STDOUT object/handle %ENV means a hash (dict) of system environment variables $PID means the system process id $*KERNEL means the operating system kernel running under

Etc.

Re:“2015 will be the year that Perl 6 officially launches fo... by treehau5 on Friday November 07, 2014 @09:55AM (#8572737)
Rails is a framework. You can still write Ruby without the cryptic DSLs.
Re:“2015 will be the year that Perl 6 officially launches fo... by danielweber on Friday November 07, 2014 @11:35AM (#8573304)
Yes, I love Ruby, and use it a lot outside of Rails.

I have some issues with Ruby "helpfully" letting you leave out more and more syntax, like parentheses from multi-argument function calls, or saying you don't need {} if the last argument is a hash, which are easy to grok if you already know Ruby but can be yet-another-confusing-rule for newbs. But those are relatively minor.

Re:“2015 will be the year that Perl 6 officially launches fo... by treehau5 on Friday November 07, 2014 @01:55PM (#8574051)
When I first learned ruby, it was my first dynamic language I ever fully experienced. I never found the poetry mode to be an issue, and in fact the community was so new and vibrant, they made it very clear to me what was going on. I believe every ruby tutorial I have ever seen made it very clear what was going on.

as far as the hash, you can always inspect the actual arguments being passed, which doubles as a nice learning exercise for beginners.

Re:“2015 will be the year that Perl 6 officially launches fo... by vithlani on Wednesday November 12, 2014 @06:22AM (#8594912)
Very well put sir, very well put....
Re:“2015 will be the year that Perl 6 officially launches fo... by ohsnap on Friday November 07, 2014 @08:03AM (#8572298)
totally agree. Perl was super innovative in it's day. It's really hard for a language to evolve after it becomes established.
Re:“2015 will be the year that Perl 6 officially launches fo... by raiph on Sunday November 09, 2014 @11:32AM (#8580172)
The Perl 6 design has directly addressed that very problem from the start.

Aiui Larry Wall believes it will be significantly easier for Perl 6 to evolve than for Lisp to do so, without falling in to the Lisp Curse trap.

[deleted]
Re:“2015 will be the year that Perl 6 officially launches fo... by evan_miller on Friday November 07, 2014 @11:18AM (#8573192)
It's actually -ne, perhaps with -a if one wants awk-style field splitting of lines.

-l modifies the output record separator (makes print append \n)