Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Perl 6 sort of set itself up for a tremendous uphill battle. By taking so long to "firm up", in terms of specification (or the test suite, in this case), while Perl 5 had a period of neglect, it lost a whole bunch of its early momentum to other languages. Sometimes, former Perl programmers have passed through two or three other languages as their "primary" language since they last called Perl home (I know there are several formerly reasonably well-known Perl folks who are more known now for their involvement in JavaScript, Go, or Haskell, or Rust, etc.).

It would take a ridiculously advanced language to counter that turning of the tides. Luckily (or, I guess, not due to luck but because Perl 6 developers realized they had to deliver something amazing to justify the time lost in the wilderness), Perl 6 is a ridiculously advanced language.

I haven't started a new project in Perl in several years (though my primary projects, which have existed for 9-17 years, are in Perl), but I'm strongly considering making my next project a Perl 6 project. It looks like a really fun language. All the stuff I like about Perl, with almost none of the stuff I don't, plus some advanced stuff that I don't even know enough to know why I might want it. But, I know that Higher Order Perl for Perl 5 (which I actually read while I was mostly working in Python) was a lot of fun and made me a better programmer, so I assume Perl 6 and its new paradigms will be similarly eye-opening.



This is probably one of the best unintended things to ever happen. Using other languages is the equivalent of world travel for a human. All the worst code I've ever seen is written by one language programmers, and perl is among the top of that category for a variety of reasons. I have seen maintainable, performant perl5, but the barrier is high.


That's a nice way of looking at the brain drain in the Perl community over the last decade. And, you're probably right. If we think in terms of general health of the free and open programming world, it has been remarkably improved by some of the folks who've migrated through different languages over the years. To the point where we have not one, not two, not a dozen, really nice languages with excellent communities, but several dozens of them (and at least two dozen that are large enough and effective enough to build pretty much anything with them). We have an embarrassment of riches, frankly.

There was a time when going into a large project, you could choose between Java, C/C++, or Perl. There were outliers (even some with significant footholds in some industries, like TCL), but those were the options I saw in front of me at every junction. Today, we can choose to work in so many languages, and get good results, find good community, find good library and tooling and cross-platform support, and enjoy all the stuff we found so nice about Perl way back when.


Indeed, perl people were and still are fanatical about easy text (i.e. richer than cstring) manipulation, and those other two languages fell short back then and even today you still have to do gymnastics for things perl does easy and well out of the box. Text is something that a majority of applications need to deal with at some point, and a source of hard bugs and security issues when done wrong. I am thankful for perl's influence, but I disregard it as a serious language outside of some niches like ETL and log processing. I'm skeptic that perl6 will change that, and there's been so much progress elsewhere that failure doesn't matter much, but I will wait a couple more years to see how the community responds and take a look at it myself if it pans out.


Perl 6's semantics are so different from Perl 5 it should effectively be a new language. It has metaprogramming macros like CL, concurrency that's as well thought out as Erlang/OTP, they eliminated all of the syntax warts that Perl 5 had with all the implicit magic, and out-of-the-box is absolutely fantastic with rules/grammars that I'd argue it's about as good as Haskell's Parsec. (Speaking of Haskell, I've seen some code that's written in a purely functional Haskell-ish fashion in idiomatic Perl 6.) Oh and there's finally a good object system instead of stop-gapping with Moose (which actually was kind of fun, meta-object programming was cobbled on, but I digress).

The take away - don't conflate it with your 1995 Perl. It's about as similar to Perl 5 as C#1 (pre-generics, pre-LINQ, pre-RX, pre-async, pre-NuGet, pre-basically-everything-good) is to modern C#.


There are syntax warts in there. Just new ones.


Any example?


> All the worst code I've ever seen is written by one language programmers

Some of the worst code I've seen was written by people who think the choice of programming language matters all that much (the rest was written by beginners or physicists).


Happened to me, had to choose a language to write a web crawler in ended up with Python (this was 5 or 6 years ago.)

We got a contractor in who was a Perl guru, he wrote one of the popular web frameworks but even he couldn't put forwards a good case for using it over PHP.

And now in the company my brother works for (a cloud hosting provider) they are currently switching from Perl to Python.


Speaking as the primary author of a book in one of the popular perl web frameworks (who is having difficulty doing stuff other than perl because a. my skills in perl are too much in demand, and b. Because for most of my normal work I haven't found anything perl can't do as easily or easier than other tools yet) here's my semi-considered opinion.

Meh, all the dynamic languages are basically the same. They're all basically things that manpipulate strings and C pointers. For perl/python/ruby/js here's what I'd sort of recommend:

* Pick from your team's strength, unless:

* Lots of turnkey logic, code quality and debug tools are not a priority, and you want to be able to hire fast and cheap: PHP.

* Lots of turnkey logic, per-performance isn't a problem and you want some higher order programming capability: Ruby.

* You want to manage a java-like large team for not so trivial logic, and you prioritise uniformity over expressivity. Python. Also python is a good environment for academic work as it helps the academic programmers not shoot themselves in the foot so much and academic code is a mess. Which is why python is such a good extension language for other tools.

* Async greenfield stuff where you don't need to worry about external libraries much: javascript. Also the only game in town for web front ends (plus its transpiling friends). Javascript is like a syntatically impoverished perl in this regard.

* You've got a whole bunch of mess in business logic and/or systems logic that you need to encapsulate, and you've got a small highly capable team who want to prioritise expressivity over uniformity. Perl excels here. So does python, but it'll make you do even more horrible things papering over the mess.

Regarding the last point, I believe if it reaches a tipping point perl 6 will be a good thing for async, multicore and parsing related stuff, and should be long-term productive and reduce the requirement for having as highly capable and a disciplined team that is really a requirement for non-trivial perl5 code bases.

Also perl5 is second to none for programming language back compat. I had a decent sized non-trivial project I'd written for internal (research) purposes, then neglected for several years. Then I had to look at the running code again. I'd been through several minor OS upgrades, moved to a completely different OS and gone through at least three major versions of perl. Aside from a couple of missing CPAN modules that I had forgotten about in the Makefile.PL, everything was fine out of the box.


I have a nagging feeling that server side JavaScript will soon become the new PHP. It is getting more and more popular among not-so-good programmers, and given its loose syntax I think it will lead to disastrous code. Not to mention that ECMA is working toward ADDING new feature to the language instead of deprecating some obscure ones, which would make the language easier to use.

Of course, PHP makers made their share of mistakes with their decisions - register_globals, safe_mode (which was not), inconsistent function naming in standard libs, myriad of weird bugs (like syntax error (still) throwing HTTP response 200),...


> Not to mention that ECMA is working toward ADDING new feature to the language instead of deprecating some obscure ones, which would make the language easier to use.

We'll see what happens longer-term. Certainly until recently the focus has been on the web (and deprecating features on the web is rather pointless: the web still supports things that were deprecated two decades ago, as dropping support breaks sites which makes users change browser or stick with an older version).

There's plenty of things listed in Appendix B of the spec, "Additional ECMAScript Features for Web Browsers", which contains much of the worst parts. Perhaps more will move there in the future, or to some separate section of previously-standardised-but-now-optional features.


As a fan of node.js, I'm afraid you are probably right... and not just front end guys. Some of the most horrific JS code tends to come from (imho) "enterprise" C# and Java devs... there are some patterns you just do not need to do in a dynamic language environment... and only complicates things for no real gain.

There are some really beautiful patterns emerging in the JS community though. React (mercury and others), Redux, RxJS, Koa, etc... But it takes a different kind of discipline to break up modules, and write pure functions instead of relying on typical OO paradigms for systems development. I cringe every time I see a senseless/useless DI/IoC system in JS that adds nothing but indirection and complexity (looking at you Angular).


" I cringe every time I see a senseless/useless DI/IoC system in JS that adds nothing but indirection and complexity (looking at you Angular)."

Isn't it supposed to make testing easier? (Personally I never managed to get the Angular hype, but I am a Python dev mainly).


If you're doing node-style (cjs) modules, you can use something like proxyquire[1] with testing to inject dependencies without complicating your modules, or creating logical indirection. If the only reason you have DI is for testing in a scripted platform, you're probably doing something wrong.

You can write, compose and composite plain objects and pure functions in JS modules that can be tested very easily without resorting to complex DI systems (with naming disconnects even).

[1] https://www.npmjs.com/package/proxyquire


    > debug tools are not a priority, and you want to be able to hire fast and cheap: PHP.
The only debug tools that we found that were better than XDebug or NuSphere were Studio And C#. Perl, Python and Ruby were all a bit rubbish in comparison.


I can't compare to the tools you mentioned since I haven't done much PHP in the last 10 years, but for Perl, I would strongly recommend you check out the following (Most are from the CPAN):

  * For a graphical IDE: Komodo or Padre or Eclipse with EPIC (great debugger support in those, since Perl 5's built-in debugger is pretty old-skool, requiring significant skill and experience to use effectively)
  * For code quality/standards static analysis: Perl::Critic
  * For performance profiling: Devel::NYTProf (seriously one of the best profilers I've used in any language)
  * For test coverage analysis: Devel::Cover
  * For benchmarking: Benchmark (core module) and friends
  * A REPL: Devel::REPL or Reply
  * On-demand debugging: Enbugger and Devel::Trepan
  * Unit testing: Test::More (and there are many, many other Test::* modules for anything you can think of that use the same general testing framework as the basic Test module that comes with Perl 5)
And there are so very many others out there that to mention them all would take all day, but these are the ones I use and like the most. Of course, others may have their own preferences and I'm sure there's even better stuff I haven't yet discovered TIMTOWTDI and all


I had a quick squizz at XDebug, and I'll try to remember it's existence next time I need to do some php debugging. On the other hand it looks quite high friction what with the extra config required.

For the normal use case I use `perl -d myscript.pl` as my goto debug tool, and I use the amazing test infrastructure to try to ensure that I'm debugging tests rather than interactive code. For web front end interactions I'm usually looking at:

    perl -d `which plackup` dev_server.psgi
Usually using LWP::Protocol::PSGI to get that server process management running inside my test.

For old codebases that have never run aside from inside apache, usually it's a matter of up to a day to decouple from the web server, although botched incrementally accreted mod_perl codebases can be much harder to tame (couple of months).


I'd have to disagree with code quality in regards to PHP. While the way it's traditionally done can have code quality problems, that isn't something which is inherent in the language. I've had great results working with Laravel. At least for my use case, it's basically just been a better Rails that happens to be in PHP. It's also compatible with HHVM and Hack, which can be useful depending on your needs.


I'd have thought that the security record of PHP would give Perl the edge, but perhaps that wasn't evaluated.


I don't know.. this presentation is pretty discouraging: https://media.ccc.de/v/31c3_-_6243_-_en_-_saal_1_-_201412292...

The track record for PHP in recent years has been pretty good.


That was covered fairly extensively here[1], and there's some problems with that talk. First and foremost, the modules he's referring to are either not core, or deprecated (CGI). It's really more a case of poor programmer behavior and slightly confusing behavior in a once core (and long known to be problematic and avoided) recently (at the time) deprecated core module than a language problem.

1: https://news.ycombinator.com/item?id=8813479


argh too many parentheses in your reply. Short answer, need to develop on perl/sharedhosting fast? [pull this trick](https://www.reddit.com/r/perl/comments/3xb6xz/neat_trick_for...).


I too have to learn Python for the machine learning libraries. CPAN has very little ML.


> one of the popular web frameworks

Which?


Pretty sure the vagueness was intentional so as not to identify him.


Plus I can't remember cos it was a conversation we had 5 years ago. We talked over MVC and open source (we both had open source projects) PHP, Perl, C# and Python weighing up the best option to write all the code in. Ended up using Python. It used a multi threaded library and crashed every so often with all sorts of weird errors. Never got to the bottom of it.


How is it really advanced?

I was under the impression that it's just another dynamic scripting language semantically equivalent to Perl5, Python, Ruby, JavaScript, and so on.

And obviously new languages of this kind aren't going to be very successful or interesting because knowing and using JavaScript is going to be mandatory forever due to browsers and with Babel and ES6/7 it's as good as any other such language.

Plus in addition to JavaScript, Ruby, Python and PHP have a lot of momentum as well.


I wouldn't discount language advances, there's kind of a Renaissance happening with languages the past couple years... even newer options Closure/ClosureScript along with new looks at Erlang, Haskell, F# etc... and JS bringing in new patterns.

WebAssembly will offer many options as browser adoption happens and cross-compilation with support for source maps is becoming very common as well.

I'm a fan of JS and ES5/7 in particular... that doesn't mean that other options won't take root. JS has plenty of advantages in that it's the same code client/server, less disconnect in objects, serialization constructs built in (JSON), easy translation to/from dbms (no ORM needed), etc. Just the same, a decade ago, everyone avoided JS like the plague.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: