Posts in this category
- Current State of Exceptions in Rakudo and Perl 6
- Meet DBIish, a Perl 6 Database Interface
- doc.perl6.org and p6doc
- Exceptions Grant Report for May 2012
- Exceptions Grant Report -- Final update
- Perl 6 Hackathon in Oslo: Be Prepared!
- Localization for Exception Messages
- News in the Rakudo 2012.05 release
- News in the Rakudo 2012.06 release
- Perl 6 Hackathon in Oslo: Report From The First Day
- Perl 6 Hackathon in Oslo: Report From The Second Day
- Quo Vadis Perl?
- Rakudo Hack: Dynamic Export Lists
- SQLite support for DBIish
- Stop The Rewrites!
- Upcoming Perl 6 Hackathon in Oslo, Norway
- A small regex optimization for NQP and Rakudo
- Pattern Matching and Unpacking
- Rakudo's Abstract Syntax Tree
- The REPL trick
- First day at YAPC::Europe 2013 in Kiev
- YAPC Europe 2013 Day 2
- YAPC Europe 2013 Day 3
- A new Perl 6 community server - call for funding
- New Perl 6 community server now live, accepting signups
- A new Perl 6 community server - update
- A shiny perl6.org site
- Creating an entry point for newcomers
- An offer for software developers: free IRC logging
- Announcing try.rakudo.org, an interactive Perl 6 shell in your browser
- Another perl6.org iteration
- Blackjack and Perl 6
- Why I commit Crud to the Perl 6 Test Suite
- This Week's Contribution to Perl 6 Week 5: Implement Str.trans
- This Week's Contribution to Perl 6
- This Week's Contribution to Perl 6 Week 8: Implement $*ARGFILES for Rakudo
- This Week's Contribution to Perl 6 Week 6: Improve Book markup
- This Week's Contribution to Perl 6 Week 2: Fix up a test
- This Week's Contribution to Perl 6 Week 9: Implement Hash.pick for Rakudo
- This Week's Contribution to Perl 6 Week 11: Improve an error message for Hyper Operators
- This Week's Contribution to Perl 6 - Lottery Intermission
- This Week's Contribution to Perl 6 Week 3: Write supporting code for the MAIN sub
- This Week's Contribution to Perl 6 Week 1: A website for proto
- This Week's Contribution to Perl 6 Week 4: Implement :samecase for .subst
- This Week's Contribution to Perl 6 Week 10: Implement samespace for Rakudo
- This Week's Contribution to Perl 6 Week 7: Implement try.rakudo.org
- What is the "Cool" class in Perl 6?
- Report from the Perl 6 Hackathon in Copenhagen
- Custom operators in Rakudo
- A Perl 6 Date Module
- Defined Behaviour with Undefined Values
- Dissecting the "Starry obfu"
- The case for distributed version control systems
- Perl 6: Failing Softly with Unthrown Exceptions
- Perl 6 Compiler Feature Matrix
- The first Perl 6 module on CPAN
- A Foray into Perl 5 land
- Gabor: Keep going
- First Grant Report: Structured Error Messages
- Second Grant Report: Structured Error Messages
- Third Grant Report: Structured Error Messages
- Fourth Grant Report: Structured Error Messages
- Google Summer of Code Mentor Recap
- How core is core?
- How fast is Rakudo's "nom" branch?
- Building a Huffman Tree With Rakudo
- Immutable Sigils and Context
- Is Perl 6 really Perl?
- Mini-Challenge: Write Your Prisoner's Dilemma Strategy
- Longest Palindrome by Regex
- Perl 6: Lost in Wonderland
- Lots of momentum in the Perl 6 community
- Monetize Perl 6?
- Musings on Rakudo's spectest chart
- My first executable from Perl 6
- My first YAPC - YAPC::EU 2010 in Pisa
- Trying to implement new operators - failed
- Programming Languages Are Not Zero Sum
- Perl 6 notes from February 2011
- Notes from the YAPC::EU 2010 Rakudo hackathon
- Let's build an object
- Perl 6 is optimized for fun
- How to get a parse tree for a Perl 6 Program
- Pascal's Triangle in Perl 6
- Perl 6 in 2009
- Perl 6 in 2010
- Perl 6 in 2011 - A Retrospection
- Perl 6 ticket life cycle
- The Perl Survey and Perl 6
- The Perl 6 Advent Calendar
- Perl 6 Questions on Perlmonks
- Physical modeling with Math::Model and Perl 6
- How to Plot a Segment of a Circle with SVG
- Results from the Prisoner's Dilemma Challenge
- Protected Attributes Make No Sense
- Publicity for Perl 6
- PVC - Perl 6 Vocabulary Coach
- Fixing Rakudo Memory Leaks
- Rakudo architectural overview
- Rakudo Rocks
- Rakudo "star" announced
- My personal "I want a PONIE" wish list for Rakudo Star
- Rakudo's rough edges
- Rats and other pets
- The Real World Strikes Back - or why you shouldn't forbid stuff just because you think it's wrong
- Releasing Rakudo made easy
- Set Phasers to Stun!
- Starry Perl 6 obfu
- Recent Perl 6 Developments August 2008
- The State of Regex Modifiers in Rakudo
- Strings and Buffers
- Subroutines vs. Methods - Differences and Commonalities
- A SVG plotting adventure
- A Syntax Highlighter for Perl 6
- Test Suite Reorganization: How to move tests
- The Happiness of Design Convergence
- Thoughts on masak's Perl 6 Coding Contest
- The Three-Fold Function of the Smart Match Operator
- Perl 6 Tidings from September and October 2008
- Perl 6 Tidings for November 2008
- Perl 6 Tidings from December 2008
- Perl 6 Tidings from January 2009
- Perl 6 Tidings from February 2009
- Perl 6 Tidings from March 2009
- Perl 6 Tidings from April 2009
- Perl 6 Tidings from May 2009
- Perl 6 Tidings from May 2009 (second iteration)
- Perl 6 Tidings from June 2009
- Perl 6 Tidings from August 2009
- Perl 6 Tidings from October 2009
- Timeline for a syntax change in Perl 6
- Visualizing match trees
- Want to write shiny SVG graphics with Perl 6? Port Scruffy!
- We write a Perl 6 book for you
- When we reach 100% we did something wrong
- Where Rakudo Lives Now
- Why Rakudo needs NQP
- Why was the Perl 6 Advent Calendar such a Success?
- What you can write in Perl 6 today
- Why you don't need the Y combinator in Perl 6
- You are good enough!
Wed, 01 Dec 2010
A Foray into Perl 5 land
Usually I use Perl 6 as my programming language of choice. But about a week ago I started to plan and code an application for which the richness of the Perl 5 ecosystem outmatch the design weaknesses of Perl 5, compared to Perl 6.
I have quite a bit of Perl 5 experience too, but so far I mostly used it for smallish tasks, and didn't have too much use for many frameworks.
Here is a list of some tools I used, and my experience with them. I hope that my experiences can help the Perl 5 community to improve some edges here and there, and serve as an inspiration for Perl 6 modules authors what problems to approach.
cpanminus - painless module installation.
Just when a XML parser had a dependency on an external C header file (expat.h), a module installation failed. Since Perl modules don't have a way to declare external dependencies, that's probably as good as a module installer can work. Kudos! The only improvement I can think of is directly showing the error message, instead of having it to dig up from a log file. I don't know if there's an easy way to automate that though.
DBIx::Class for the database
I store data in a postgresql database. From lowest to highest abstraction, the Perl modules involved are DBD::Pg (the database driver), DBI (the driver-independent database interface) and DBIx::Class, an object relational mapper.
Postgres itself is fantastic, and DBD::Pg and DBI look rock solid to me.
I've worked with DBIx::Class before, and liked it. Upon rereading the
documentation, I found that since my last usage the recommended usage pattern
has changed. Writing result classes into the
namespace and result set into
ResultSet::MyClass has made the
result sets more accessible. Since they are a key feature of DBIx-Class, I
welcome this change, and adopted it very naturally.
A small left-over from the previous scheme made the transition a tad harder than it had to, but upon reporting it on the #dbix-class IRC channel (on irc.perl.org), I immediately got commit access, and fixed it in the source.
Since I deal with trees, I was happy to discover a DBIx::Class plugin for nested sets. I was less happy to discover that it broke basic object creation, and had a bug that prevented merging of trees, a feature advertised in the documentation. Luckily both were very easy to patch, the patches now live in the bug tracker. I hope the maintainer applies them soon.
The nested set extension comes with a good test suite, but it seems it hasn't had much real world usage. I think that with some more usage (and maybe a few more bug fixes), it'll turn into a very good module.
Mojolicious for the web frontend
While waiting for the Catalyst dependencies to install, I decided on a whim to try out Mojolicious, a new-ish web framework. Or more precisely Mojolicious::Lite, a simplified API that lets you keep the whole application in a single file.
Now there were a lot of small, rough spots in Mojolicious. The community on IRC was very helpful, and asked me to record my findings on a wiki page - which I did.
What really bugs me about Mojolicious is that the built-in template system produces very incomprehensible error messages. It uses a mixture of verbatim text and perl code, separated by tags with various semantics (for example tags that just execute code, those that execute and insert the result, optionally with HTML/XML escaping).
Unfortunately that means that the code you write differs from the code that perl executes, which makes the error messages pretty useless.
My first suggestion to improve that situation is to display the generated code in the error message, in addition to the template code (and make the generated code as simple as possible.
If the generated code is non-trivial, it would help to add some markup to distinguish the user-written code from the code that the generator adds around it. I have no idea how easy or hard that would be to implement, though.
The Perl 5 modules were mostly very easy to use, and the corresponding communities very attentive and helpful.
If there's something the authors can learn from Perl 6, then it's a love for better error messages.
The Perl 6 world can aspire for such a rich and easy-to-use module system.
Comments / Trackbacks:
Write a comment