Perl 5.20 Released, and Mojolicious 5.0: the Very Modern Perl Web Framework 126
Kvorg writes: "Back in 2012 Slashdot noticed how at the time of Perl 5.16, the modern Perl projects, including Mojolicious, formed a new and expanding movement of a Perl Renaissance. With the release of Perl 5.20 and Mojolicious 5.0, the Modern Perl Renaissance is ever more striking. Faster, neater, sharper with its asynchronous APIs, Mojolicious is extremely flexible with its advanced request routing, plugin system, perl templating and hook API. Its adherence to the modern interfaces and standards and its implementation of advanced features in support tools, DOM and CSS selectors makes it easy to program with.
Mojolicious, with its philosophy of optimized code-generation (think metaprogramming), enabled-by-default support for encodings and UTF-8, zero dependency deployment with wide support for existing CPAN packages, zero downtime restarts and fully tested implementations, reminds us of how fun and flexible programming in scripting languages used to be. Of course, integrated documentation and a very supportive bundled development server don't hurt, either. The new Perl release with new postfix dereference syntax, subroutine signatures, new slice syntax and numerous optimizations makes it all even more fun."
Mojolicious, with its philosophy of optimized code-generation (think metaprogramming), enabled-by-default support for encodings and UTF-8, zero dependency deployment with wide support for existing CPAN packages, zero downtime restarts and fully tested implementations, reminds us of how fun and flexible programming in scripting languages used to be. Of course, integrated documentation and a very supportive bundled development server don't hurt, either. The new Perl release with new postfix dereference syntax, subroutine signatures, new slice syntax and numerous optimizations makes it all even more fun."
Damn I'm old... (Score:5, Funny)
I kept thinking "I am the very model of a modern Major Perl Framework..."
Re: (Score:2)
LOL ...
Somewhat apropos, really.
Re: (Score:2)
About binomial theorem I'm teeming with a lot of news
With many cheerful facts about the square of the hypoteneus
Re: (Score:3)
I think being old is a requirement for understanding TFS. :-)
Re:Damn I'm old... (Score:5, Funny)
I am the very model of a modern Major Perl Framework,
But here I am on Slashdot, trying harder from my job to shirk,
From HackerNews to 4chan there's no forum in which I won't lurk,
I am the very model of a modern Major Perl Framework!
People still use Perl? (Score:1, Informative)
Color me surprised.
Re: People still use Perl? (Score:4, Funny)
Re: (Score:2, Insightful)
Re: (Score:3)
People still use BASH (and yes, it's still hella usable if the task is simple).
If the tool fits and does the job, use it.
Re: (Score:2)
I was going to comment how you skipped Malbolge and how that makes you a closed-minded noob that only works with popular languages, but then I noticed that you skipped over C. Or maybe you made a typo and lumped it with BuildProfessionalCC.
So if you were wondering why you got skipped over a job, it might just be because HR's filter didn't think you knew how to program in C.
Re: (Score:2)
Re: (Score:2)
Yeah, it's pretty popular in the embedded world. Toasters, Arduinos, Avionics.
When the hardware maker couldn't be bothered to make a high level compiler for the chip or when the thing absolutely positively can't be allowed to fail, C is a good choice.
Oh, and that Linux thing and a large swath of open source software. You know, if you're into that sort of thing.
Re: (Score:2)
> People still use C? Really?
You just did_______^
Re: (Score:2)
Perl is monochrome.
Re: (Score:2)
What PERL looks like to Python programmers..
http://www.google.com/imgres?i... [google.com]
What Python looks like to Perl programmers (Score:4, Funny)
http://handsonaswegrow.com/wp-... [handsonaswegrow.com]
Not exactly, but I like the picture.
Re: (Score:2)
His indentation is wrong. Whitespace matters.
Awesome! (Score:5, Interesting)
I don't much care about what a lot of people think about it, I love Perl and still use it daily in my job. I've dabbled in PHP and the various frameworks it supports but I always find myself returning to Perl/CGI/DBI. But this sounds like something I have been waiting for. It's really nice to see some new stuff coming out for Perl 5 as I simply can't seem to wrap my head around Perl 6. This is great news for old dogs!
Maybe one day (Score:2)
Maybe one day even Slashdot will get UTF-8 support.
One day.
Any decade now.
Re: (Score:1)
Re: (Score:3, Interesting)
Re:Awesome! (Score:4, Informative)
The p5p (Perl 5 Porters, the main p5 dev group) are removing a bunch of cruft. Old OSes and EBCDIC are up on the chopping block next. They're also removing microperl, which unfortunately probably is the best chance of getting more than perl to parse Perl (microperl removes just about every OS-specific function of Perl, like the unix user/group/passwd file stuff).
But honestly, there's so few people working in the core code, and I don't imagine any of the major forks I've heard about gaining any steam either.
Re: (Score:1)
Yeah, and what I'm talking about is ditching stuff like [...] unless and statement modifiers
FOAD
Re: (Score:3)
More than likely, I don't expect Perl 6 to ever see light of day. The big problem with it is that it's not Perl.
I don't have a huge problem with a new scripting language, but recognize that it's (for all useful purposes) something new and different and give the project a new name. Also, Perl 5 is AFAICT completely backwards compatible to at least Perl 3; Perl 6 either won't run prior code or requires a huge hack to do so.
Re: (Score:1)
Re: Awesome! (Score:3)
Bah (Score:2)
I was using perl before it was cool.
(I figured a fanboi submission required a hipster response)
Re: (Score:1)
I was using perl before it was cool.
(I figured a fanboi submission required a hipster response)
Perl was cool? Seems that it's never been since I started using it in 2000.
A language that lets you do whatever (Score:5, Insightful)
Re:A language that lets you do whatever (Score:4, Interesting)
That's one side of perl: The fastest development time imaginable for small programs. The other side, that no one has mentioned, is that perl conforms to the OO paradigm more closely than any other language (including Objective-C.) I have written very large programs in perl and contrary to popular opinion these programs are much easier to read and understand than if they were written in C++ for example.
Re: (Score:1)
The other side, that no one has mentioned, is that perl conforms to the OO paradigm more closely than any other language
Except for nearly all of the other ones? Especially other scripting languages?
Pick a bunch of languages at random. Stick them on a dartboard. Throw something gigantic at the dartboard. Chances are every language you hit conforms to the OO paradigm more closely than perl.
I can write object-oriented assembly. That doesn't make it a particularly OOPy language. Perl objects are hacked on, somewhat painfully at that.
Re: (Score:2)
Which industry? Finance seems to like Java, C++, and then Python. Web seems to like JavaScript, Ruby, PHP, and then Python. Those are the only industries I have first-hand experience with.
(Though I do recognize the fact that Perl is on none of those lists, even though I'm hired as a Perl programmer in both those industries, I've found it to be one of those things that, like an infection, spreads to every task that needs doing in a unix network)
I think it would be funny as heck if.... (Score:3)
It has a lot going for it, especially if a project like this makes it as approachable as PHP for web application development.
Serious question, though: other than it being old, are there any problems that keep it from being viable as a modern web application platform?
Re: (Score:1)
Serious question, though: other than it being old, are there any problems that keep it from being viable as a modern web application platform?
Yes. Not technical ones, though. Everyone has been flaming it for so long that it's no longer hip. (Sigh.)
Re: (Score:3, Interesting)
The problem is that Perl (like C) requires discipline. It is possible to write well written and architected code in any language. But some languages make it harder than others. But some languages (Java, I'm looking at you) are designed to coddle programmers from doing things they shouldn't. It's silly because engineers should know their craft and not require a nanny in the form of a purposely limited la
Re: (Score:2)
I'd take perl over node anytime but I'm not impressed by CPAN (it's better than npm, if you want some faint praise) and a lo
Re: (Score:2)
Re: (Score:1)
Everything becomes obsolete. This attitude to me is core to some of the major problems facing technology today: The lack of maintenance. Everything is made with the expectation that it will be in a landfill in two years. But the world can't run that way. Think of how much COBOL code runs your daily life. Rewriting it in a different language would be expensive and provide little value.
So I'm guessing o
Re: (Score:2)
Re: (Score:3)
Dancer was inspired by Sinatra, but if you wanted something close to the metal, you wanted Plack (like Rack or WSGI). But really, you wanted Mojolicious.
Dependencies are not a bad thing. CPANTS makes sure they work. But if you don't like dependencies, you wanted Mojolicious.
Re: (Score:2)
But really, you wanted Mojolicious.
This.
Re: (Score:1)
I think it's interesting that you didn't mention Mojolicious, which has your dependency problem from Dancer sorted, and is also a quite modern rethinking of HTTP on Perl. None of the old cruft from the 90s.
Re: (Score:3)
1) s/Perl/Code/g
2) This is one of those things that causes frustration the first 3-5 times it happens, and then you find the right habits. I can't remember the last time that actually bit me. Every language has its own definition of falsey.
3) I've never had to read the Perl source to actually solve a problem in my Perl code (except that one time there was an actual bug in Perl, back in 5.10.0). The documentation explains everything, including all the obscure edge and corner cases.
Re: (Score:3)
1) I agree that extensive use of magic vars (the topic var, $_, especially) can create a major problem for readability. But the magic vars, $_ especially, allow concise constructions that would otherwise take a lot of my time to type and longer to verify I typed correctly. The onus is on me, the programmer, to ensure my code is readable, no matter how much the language assists me in that, and I find I can write readable Perl faster than I can write readable JavaScript (choosing two languages I feel I am equ
Re: (Score:2)
This is best you can do to flame Perl?
1. It must be me but I do not find Perl any more problematic in this respect than say C or Javascript. In fact facilities like variable string interpolation and symbolic references in my view makes Perl more readable and understandable.
2. So... use if ( defined $str ) what's so irrevocable borked.
3. Care to give an example. I have never read Perl source and have programmed 100k's line of code in Perl and maintain several CPAN modules.
Re: (Score:2)
NEWS FLASH: Dumbass programmers make dumbass mistakes and produce dumbass code.
Those of us at the adults' table get to use real forks and steak knives and we don't hurt ourselves at all.
Re: (Score:1)
Garbage collection is still a huge performance problem. Even with all the modern algorithms the fact that reachable objects must be traced causes real problems with locality of reference. While Perl does have a disgusting syntax the nice thing is it precludes the use of the JVM or CLR. That's probably a good thing.
Oxymoron (Score:2, Insightful)
Ok, I know I'll get modded down to oblivion for this, but my first thought on reading the headline was "Modern Perl Web Framework, isn't that an oxymoron?" Any others think that as a reflex at first too? Even if you don't really believe it?
I know I used to love Perl, but that was a long time ago...
Re:Oxymoron (Score:5, Interesting)
Given I'll make more that $200K programming Perl this year, no that was not my first reflex...
My first reflex on seeing this on Slashdot was, "I probably shouldn't read the article because its going to be filled with the same tired, ignorant Perl hate. And then I'm going to waste time trying to respond to it."
You don't have to use Perl if you don't want to. Why isn't that enough? Why do you feel entitled to dump your FUD on my community? Perl isn't the most popular choice but there's a lot of us making a decent living at it, so please if you don't get it, or you don't like it, unless you have a grudge with Perl that hasn't already been mentioned 100K times what's the point of saying anything at all?
Re: (Score:2)
Why do you feel entitled to dump your FUD on my community?
This wasn't meant as FUD, just good natured jibing. Relax :D
Perl isn't the most popular choice but there's a lot of us making a decent living at it, so please if you don't get it, or you don't like it, unless you have a grudge with Perl that hasn't already been mentioned 100K times what's the point of saying anything at all?
I don't doubt it. I have no hate for Perl, I was joking. Notice how many qualifies I put on my statements? It was just the first thing that popped into my head when I read a slashdot headline, no biggie.
Re: (Score:2)
No doubt, I have a few friends that cashed in old Cobol skills back when we were partying like it was 1999 (for the second time). However in my nearly 20 years of writing Perl for web sites I've never worked on an application that was more than 6 years old when I was hired (and about half of them where new applications, the last 3 were startups using Perl).
I realize the Perl community doesn't spend a lot of time adverting all the companies that do choose Perl for new startups, since we are all busy working
Perl. (Score:2)
Perl Festivity Levels (Score:5, Funny)
Perl Festivity Level 1: Developers and users have gathered to nibble hors d'oeuvres and chat amiably with each other about the Modern Perl Renaissance. With every sip of their drinks Perl seems ever more striking. Some are gathered around the upright piano improvising songs that proclaim how it is faster, neater, and sharper than ever before with its asynchronous APIs.
Perl Festivity Level 2: Everyone is talking loudly -- sometimes to each other, and sometimes to nobody at all. Perl seems even better. Perl Monks are patiently explaining syntax and style to potted plants and other nearby objects. Around the piano people are feeling fun and flexible, just as programming in scripting languages used to be. Someone is crooning a bawdy ballad where a couple of inexperienced DOM and CSS selectors encounter a very supportive bundled development server.
Perl Festivity Level 3: Monks are arguing violently and defrocking one another over nested do...until loops that bail on exceptions. People are gulping down other peoples' drinks, placing hors d'oeuvres in the upright piano to see what happens when the little hammers strike as everyone bawls "Got my Mojolicious workin' ... but it don't work on Python!" They have lost count of their drinks, and the world is harmonious with blissful adherence to modern interfaces and standards.
Perl Festivity Level 4: All the guests, hors d'oeuvres smeared all over their naked bodies are performing a ritual dance around a burning heap of tables and chairs in celebration of postfix dereference syntax, subroutine signatures, new slice syntax and numerous optimizations. The piano is missing.
~~ with apology and deference to Dave Barry [cmu.edu]
Post Fix dereferencing about time. (Score:2)
I was very active back in the early days of 5.0 development. I fought for this and lost.
I always struggled with the non-nonsensical @{} ${} ..... style. It was difficult to mentally process. Long chains of dereferencing would be especially complicated.
I'm very pleased to see this finally make it in.
That's not it. (Score:2)
The problem isn't that perl is old. The problem is that perl reads (and writes) like encrypted sanskrit and is just generally weird in its approach to everything.
Once you've invested a great deal of time learning it, and its APIs, it's a big deal to change, because you're effective in it... but, speaking from personal experience, after years of perl-ing, I tried something else, and what a revelation it was. Not everyone is willing to put in the kind of effort it takes, and familiarity itself can make nice s
Re: (Score:3)
I disagree, but perhaps that is because I learned how to program by learning Perl. I've written huge projects in Python, C++, Java, and JavaScript, and I still prefer Perl for my daily problems (but then, I also actually like C++, so it is possible that I am irreparably damaged). I have had no problem moving to other languages, I even like what they offer (even Java).
Python's idea of the ternary operator, now that's weird. STRING.join( ITERABLE ), that's weird (though the only obvious solution because of ho
Re: (Score:2)
Perl was designed by people and for people who were fond of the Unix shell scripting syntax, all the unix tools, and the C language, which were the primary tools of coding unix in the old days. Unfortunately, Perl looks cryptic to anyone without a background in that sort of Unix environment. Most people don't learn unix shell scripting and C, before jumping into a scripting programming language. They jump straight into scripting language. As a result, Python has a huge advantage with this crowd. Then there
Re: (Score:2)
To this day I'm surprised at how much the shell can do for me, and I spend most of my time there. I find myself writing fewer Perl scripts and more shell scripts to Get Stuff Done.
I've kept saying "Perl is the UNIX philosophy taken beyond its logical conclusion."
Re: (Score:2)
Shell scripting usually works fine until you want to 1. be portable or 2. work with strings. You can do both with shell but I usually go with something like Perl when it happens.
Re: (Score:3)
Shell has marginally better whipituptitude, until you want
1) Arrays
2) Deep string operations
3) Documents
(though, side note, I'm working on a project to make (3) easier to handle because it comes up so often, and there's jq already)
Re:That's not it. (Score:5, Insightful)
The problem isn't that perl is old. The problem is that perl reads (and writes) like encrypted sanskrit...
I really wish people would stop saying this. It's certainly possible to write horribly obfuscated Perl, deliberately or otherwise, just as it's possible to write C, or Python, or anything else in a nearly unreadable way. I'll grant that Perl maybe allows you to get away with a bit more.
However, it's just about as easy to write clean, maintainable Perl as it is in any other language. Follow good coding practices and you'll have clean code, code badly and it'll be a train wreck regardless of language.
Re:That's not it. (Score:5, Interesting)
To expound on this point a bit deeper:
While one can write horrible code (without trying too hard) in any language (even python!), there *is* a rational reason that Perl tends to fare worse in this regard on average.
The reason is that, as compared to almost every other programming language out there, Perl was designed by a Linguist (as in, human languages) with an explicit goal of being very expressive. In many other languages, there's one canonical way to do a given thing, and then perhaps a few other ugly, horrible, slow, round-about ways to accomplish the same thing different, but most of the time everyone hones in on the same approximate language patterns.
Perl, on the other hand, was explicitly designed such that there are often many wildly varying different ways to accomplish the same goal, allowing for a great freedom of expression and stylistic choice. Over the years this theme has extended throughout the Perl ecosphere, well beyond the syntactic features of the core language itself, to the point that just about any programming style or paradigm can be wrought within Perl easily. Do you like C++-style multiple inheritance? Or maybe something more like Traits/Roles and object method invocation via message passing? How about functional style lamba stuff? Meta-object programming? Threads (of a few kinds), Processes, eventloops (of many kinds)? Declarative programming (with or without OO)? DSLs? How many flavors of templating do you want? Just about any real or academic-toy knob you can think of to twist which would affect how programming languages work probably already exists within Perl at this point. In this way it's almost like a modern LISP, but with a much larger standard library of language tools built on top, and fewer parentheses.
So you throw 50 "professional" programmers in a room with a Perl interpreter and ask them to solve the same high-level problem and you'll probably get 45 completely shitty implementations, 3 decent ones, and two brilliant ones. But not a single one of those 50 implementations will resemble the others much.
In the hands of a real artist, Perl is a very powerful tool for writing beautiful software, and it gives said artist the freedom to solve problems using the paradigms and syntactic styles that best match the problem domain without ever leaving the world of Perl. In the hands of a novice, however, it's way too much expressive freedom, and leads to basically-trashy, horrible code. Perl is programming without lane markers, seat belts, or brakes. There's nothing standing in the way of greatness, and nothing standing in the way of being a complete idiot, either.
Unfortunately, most programmers in the world aren't artists. They lack the innate skill, the drive and determination, or even the desire to become an artist. They're just doing a job and collecting a paycheck. Python is a great tool for these people, and Perl is not.
Mod parent up (Score:2)
Someone please mod parent up...
Re:That's not it. (mostly) (Score:1)
I mostly lurk and seldom reply to anon.
But I'm compelled to say
Well Spoke, and thanks for the forethought.
Perl was the reason I started wrapping my brain around regular expressions. Later in the 90's I build complex backends using cgilib. Tried a few frameworks like mason..... I became a perlOphite for all the sentiments you expressed so well.
The ease of cpan, of quickly manipulating DBI tables, so many reasons why it, and its attitude,
always works for me. Off a CLI, wrapped up in a shell script, part of a
Re: (Score:2)
I really wish people would stop saying this. It's certainly possible to write horribly obfuscated Perl, deliberately or otherwise, just as it's possible to write C, or Python, or anything else in a nearly unreadable way. I'll grant that Perl maybe allows you to get away with a bit more.
I really wish people would stop defending Perl in the manner. Perl's sigil madness is endemic to the language. Yes, you can avoid some of the craziness (such as "use English"), but good luck to you once you start using references.
Re: (Score:2)
Re: (Score:2)
It is when you get lost in a maze of them. I mentioned references for a reason, because anybody who's experienced ${ hell knows what I'm talking about.
Re: (Score:2)
If that's the worst criticism you have of Perl, then it's doing pretty well for itself.
It's the worst example of many. Too many sigils and too much magic in Perl.
I remain amazed at how many people bash Perl for its syntax and then proceed to praise PHP as some sort of bastion of web language design sanity.
Like who? PHP is well-known for being a hacked together language, and it clearly shows its Perl inspiration. PHP is a prime example of "worse is better". Python is the language that gets all the praise for good, clean design. And while I could nitpick Python, compared to Perl it is a bastion of sanity.
Re: (Score:2)
Piss off. There's a difference between "can" and "want to".
Re: (Score:2)
Was this during Perl's heyday, when it was ... shudder... popular? The popular language of the day always suffers from very poor programmers making very bad decisions.
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Gee, if that was the criteria, I'd be banning Java at work. Because I've seen first-hand a number of Java devs writing absolutely stupid things resulting in a heap of vulnerabilities.
The reality is that you get a bunch of stupid developers, and it doesn't matter what language you put in front of them, they're going to write stupid code. The people who've worked under me in perl don't get the opportunity to write code that dumb because a) I provide a saner framework work in where those gotchas are centrali
Re: (Score:2)
I've put that bullet through that approach.
I've grabbed the precise versions of everything that we're going to use, checked into our version control system, complete with a full build-from-scratch setup that will build perl from source, with the exact options we need (or at least the exact same options every time, not sure if we need threading, for example), and the precise list of CPAN modules that we are using, along with standard patches to said modules where required (some of them don't support AIX as w
Re: (Score:1)
I don't ascribe the bad code to the language, but to the bad developers.
Unfortunately, Perl limits even good developers.
The major problem I have with Perl is not its sometimes ugly syntax, but rather its limited mechanisms for enforcing code correctness at compile time. This means that many types of error can't be found until one runs a program. This in turn means one runs up against the classic combinatoric explosion problem associated with run time testing. Given that even the best developers have bad days, this can be a big problem.
Perl is a lot like Visual Basic, or spre
Re: (Score:2)
I used to be a huge fan of C++.
All those negatives you cite seem to me to be advantages. Because when you know how to use them, they become powerful forces for good. Sure, there's plenty of room to shoot your foot off, but there are some things you can do in Perl that a stricter language wouldn't let you do.