

I read Mojolicious Web Clients
source link: https://fogknife.com/2020-03-03-i-read-mojolicious-web-clients.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.


I read and enjoyed brian d foy’s Mojolicious Web Clients , a short and direct guide to writing command-line utilities using the open-source, Perl-based web toolkit called Mojo . (The title’s “Mojolicious” formally refers to a full-featured web framework built on Mojo , but I am told that the longer name now embraces both the toolkit and the framework, per the project’s official website .)
I’ve worked with Mojo for a couple of years now; my Webmention library relies upon its wonderful DOM parser , for example. But I didn’t really understand the project as a whole; while it does offer higher-level guides to complement its voluminous nuts-and-bolts reference material, it has always lacked the slower, fleshier explanatory power of a real book. As such, I hungrily purchased foy’s new e-book the moment I learned about it. Even though it covers just one aspect of Mojolicious — using its toolkit to request and extract interesting data from the web, whether via JSON-based APIs or human-intended HTML pages — it still provides very welcome long-form documentation coverage to a project that has long deserved it. I hope similar books follow.
Mojolicious Web Clients tours through major Mojo concepts over a few short and example-heavy chapters. After spending a few evenings working through it, reading slowly enough to get the gist of all its code examples — taking notes and occasionally keying them in to run my own experiments — I have a much more complete understanding of Mojo’s structure, power, and philosophy. For example, the purpose of Mojo “collections”, an object-oriented reimplemnentation of Perl’s built-in array structures, no longer eludes me. And I understand why Mojo cheerfully stole “ promises ” from JavaScript, allowing one to write conceptually tricky non-blocking code in a fluid and readable way; now I itch to add this technique to my own projects.
Prior to reading this book, I felt quite foggy on the difference between the Mojo toolkit and the Mojolicious framework, vaguely understanding the latter as a followup to the venerable Catalyst framework , and knowing that CPAN hosted a variety of modules under the “Mojo” namespace but not seeing any particular pattern to them. Happily, foy’s book opens with a history of Perl-based web tools right up through the present, clearly explaining how Mojo has picked up the torch from the long-lived LWP library , and going on to demonstrate its commitment to modernization through an emphasis on fluid coding style and strategic wheel-reinvention .
Mojo, apparently, is one of those rare software projects that starts over from scratch and gets it right. According to its manual page, Mojolicious has only four library dependencies, and all of them already ship with Perl. A veteran Perl hacker recognizes this as absurd , especially for such a wide-ranging project. It often seems that a typical Perl-based project (any of mine included, certainly) wants to download half of CPAN before it will deign to try installing itself, and so Mojo represents a stunning lesson in dependency-austerity. And as such, of course, it brings both a gift and a challenge: use Mojo in your project, and see how little else you’ll need to get to your goal. You just might write better software for it, with far fewer dependencies outside of your control.
To a Perl fan like me, learning Mojo today feels like both a relief and a necessity. At a time when the lights threaten to shut off over Perl’s role as anything other than small-scale Unix-glue, Mojolicious represents a rare project keeping the party going with inventive and ongoing vitality. I was intrigued when colleagues first suggested the Mojo modules to me two years ago, delighted to find Mojolicious quietly starring in Emily Shea’s 2019 conference presentation about voice-driven programming , and now cheered by the arrival of even one fresh book on the topic. As Brian Wisti recently said , “Mojolicious is why I still have Perl installed in 2020”. I like Perl enough and respect its community, however small these days, that I feel obliged to adapt my own practices to better feed from — and, I hope, feed back into — this valuable source of forward-looking energy.
This article was also posted to the “books” section of Indieweb.xyz .
Recommend
-
279
README.md Overview gRPC-Web provides a Javascript library that lets browser clients access a gRPC service. You can find out much more about gRPC in its...
-
38
Mojolicious is an MVC framework . But, unlike
-
8
5 Reasons Why Your Clients Don’t Read Your Agency’s ReportsWritten byEstablishing the business value of your SEO performance as an agency is part of client re...
-
12
How This Web Developer Uses AWeber and Thrive Suite To Generate A Waiting List Of Clients By Kelsey Johnson September 16, 2021 Learn how to collect leads, f...
-
11
Open Source Web Mail Clients in JavaJWebMailWebMail is a www-frontend to IMAP/POP3 mailboxes. You can compare it to the systems Hotmail, YahooMail etc use....
-
7
On The Mojolicious Codebase By Joel Berger on March 27, 2016 11:59 PM under
-
6
Super Easy SSL Certs for Mojolicious Apps I’m assuming that by now you’ve probably heard of
-
4
Joel Berger Perl for Science, Perl for the Web, Perl for Fun
-
6
Mojolicious Advent Calendar 2018 call for posts By Joel Berger...
-
4
A Mojolicious Advent Calendar! I’m happy to announce that this year I’m going to be running a Mojoli...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK