52 points · by brudgers · 10y ago · 50 comments
Lisp syntax is super simple. But this simple syntax can hide an enormous complexity. Metaprogramming is complex. Lisp is so powerful, but it's not so widely used as other languages because of this complexity.
Now, Perl 6 claims to have the same power as lisp, only that instead of using a simple syntax, it is using a complex one, and a complex way of modifying that syntax. This is complexity wrapped in more complexity.
I'm sorry but I don't think Perl 6 will ever be a very widely used programming language as its predecessor was. It might however amuse a small group of hackers who want to test new ideas in programming languages.
I won't stop repeat that mantra that side effects and program state are an implicit information channel in a program. This channel is shared by many parts (or parties) inside program and it has some specific implicitly specified protocol of use. Add a piece of software that uses the channel with slightly different protocol as assumption, get ready for all sorts of problems.
Imo Perl 6 has some easy on ramps and then a long and winding learning road that can be tiring to navigate due to pot holes, inadequate doc and tools, and lots of yak shaving. I wonder if you agree that bugs, weak doc, and an immature ecosystem and tooling are a significant contributor to the toll exacted by the long (endless?) learning curve?
Also, if you've used and liked Perl 5 I'd be interested in your opinions about how you think the relationship of the two Perls will evolve.
It also seems to suffer from an advanced (possibly fatal) symbolpasta diarrhoea. Perl 5 was not pretty, but Perl 6 at times can be downright hideous.
If Perl 6 is a Lisp, that's great! You know, I am deeply and madly in love with Clojure at the moment. But that manages to be a Lisp without falling even deeper into the line noise trap than P5 did. But, you know, syntax is just syntax.
Beauty is in the eye of the beholder. I won't bore you with the details, but rest assured that there are many others like me, who appreciate Perl 5 both for its aesthetics, and are able to use the technical consequences of said aesthetics for productivity.
My only one problem about P6 is the fact they dropped the effort of having the specification so others can implement the language too. Looks like they prefer a conformance test instead of a formal/complete specification.
While that is perfect fine, I would say having both the test and the spec is even better, for those trying to learn and implement the language.
A good, formal and complete specification will make my learning process much better, IMHO.
For the original intent I'll quote Larry from the day he announced Perl 6 in 2000[1]:
"I don't know how strict a spec it will be from the language design point of view. I'm not really big on that sort of spec and there is some value to using the reference implementation approach and what we currently have is a reference implementation [with] no second implementation, well, unless you count the JVM work, but, obviously there are benefits to having things justified well enough that you could implement another one even if you didn't want to, so we'll definitely be working in that direction and - do you have something? And there was something else I was going to say - what we particularly want to stress in terms of - is not perhaps so much the spec as developing our current regression test. Well, we call them regression tests, but they're almost more acceptance tests, but, we developed our acceptance into real regression tests then you'd further develop the real regression tests into a validation test of what the language actually means and actually go out and explore all the nooks and crannies and say, "This is Perl, this is not Perl," and then we actually have a machine-readable spec. And to me that's actually a lot more important than what the verbiage on the human readable thing says."
I think the 6.Christmas release corresponds fairly directly to this original intent.
In the meantime the spec docs (as against the spec test suite), which are currently referred to as either "speculations" or "design docs" to better emphasize their contemporary role, are currently well behind the test suite and implementation. This is presumably what caught your attention.
The current thinking is that Perl 6 will follow the pattern adopted by many other mainstream languages in terms of the timing of development and publication of a relatively formal and debugged prose specification.[2]
This thinking in turn suggests it would be best if the spec docs caught up with the spec test suite and Rakudo and were then polished and formally published in a frozen form, some years from now.
At that point making a significant effort to provide practical support for alternate compiler implementations ought once again become compelling.
[1] http://www.perl.com/pub/2000/10/23/soto2000.html
[2] http://pmichaud.com/2015/pres/fosdem-specs/fosdem-specs-1.pd...
However, I believe the real power of Perl, besides the obviously awesome regex handling, is the "huffmann" principle of making common things super-quick. Sure this is the major cause of read-only code, but it's also the reason why I use perl every time I just need things to be done.
In Perl6 they kept this principle in mind, and this is the important part IMHO.
Back in the days one argument was using "grep" or "map" instead of explicit for-loops, but in this day of functional programming, that would seem a weird criticism.
Is it the type glyphs? ($%@)
References are a bit unnecessary, yes.
I too struggled with that and came to hate it.
Perl 6 directly addressed this and some related problems.
First, sigils are now invariant - they're just a part of the name that signals which of the three data structure types a particular variable is. Second, there's no need for a `->` dereferencing op.
my @array = 1,2,3; # `@` sigil means indexable var
say @array[1]; # prints 2
It might be interesting to look at an example. Perhaps you could share an example of code in Python that illustrates some data structuring code that would be confusing in Perl 5 syntax, I'll try show what the Perl 6 equivalent would be, and we can see if Perl 6 really does clean this part of the language up. Perl is a interpreted language optimized for scanning arbi-
trary text files, extracting information from those text
files, and printing reports based on that information. It's
also a good language for many system management tasks. The
language is intended to be practical (easy to use, effi-
cient, complete) rather than beautiful (tiny, elegant,
minimal). It combines (in the author's opinion, anyway)
some of the best features of C, sed, awk, and sh, so people
familiar with those languages should have little difficulty
with it.
The closest that perl had to an interactive shell was with the "-d" debugger. See for example this synopsis from 2007 at http://archive.oreilly.com/pub/post/writing_a_modern_perl_re... :> One area in which Perl falls behind other languages is in its lack of a usable Read-Evaluate-Print-Loop. (perl -de 0 just isn't enough for me.) I've used Ruby's irb and a handful of Python shells, and I'm starting to become a fan of ghci, but I fall back on perl -e far too often for my sanity.
An interactive shell should, in my opinion, support more than a REPL. It should also implement job control, like suspending a job or starting jobs in the background. Perl definitely was not invented for that purpose.
Or, perhaps the syntax for dealing with elements in a somewhat deep data structure, like: push(@{$TV{$family}{kids}},"anotherkid");
Sometimes, people are just griping about regex syntax though, which seems disingenuous, since many languages use the exact same pcre expressions.
I like perl, but if it's been a while, there's definitely some back and forth with books to decipher something I wrote some time ago.