Perl6 Pi and continued fractions

I was looking through the code of the Rakudo implementation of Perl6 where I noticed that it defines pi as my constant pi = 3.14159_26535_89793_238e0; ( with an alias my constant π := pi; )
I immediately remembered that for a subset of fractional numbers Perl6 has a type that stores them without the loss of precision that generally accompanies floating point math. That type is of course the Rat (and FatRat) type. So of course I type pi.Rat into the REPL, it then prints 3.141593 which is obviously nowhere near as precise as the result of just typing pi into the REPL 3.14159265358979.
I wanted to see the numerator and denominator values that Perl chose to use so I typed pi.Rat.perl and got <355/113>, which is nowhere near as precise as the Rat type is capable of handling. That was just the entrance to the rabbit hole.

HTML::FormFu talk for Sydney PM

I am in the process of authoring a talk for Sydney PM as an intro to HTML::FormFu (via Catalyst). The draft of which follows, to which I would welcome feedback and suggestions.


HTML::FormFu

Efficient web forms.

So you can leave at 5pm each day.


Web frameworks like Catalyst, Mojolicious & Dancer take care of repetitive things in web app development such as:

  • Connecting your code to an environment (mod_perl1/2, cgi, fast_cgi, nginx_perl etc. ok * Plack does a lot of this)
  • Mapping uri requests to code
  • Authentication
  • Authorization
  • Sessions
  • Connecting to databases & ORM's
  • Serialization/Deserialization (JSON, XML etc)
  • Templating (built on TT, Alloy etc)
  • Logging/Debugging levels
  • SiteMaps, Caching, Browser detection
  • Code Bootstrappers

Whats missing is form generation and validation.

It's very rare not to have form's in any software - business applications have lots of them.

They are very boring and repetitive, prone to mistakes and bugs as a result.

Data types are frequenly the same things: names, addresses, emails, phone numbers, etc.

Perl 6 Status

Today, from Freenode's #perl6:


01:41 < zzzzzzzzzz> Is there no site that gives a current status of Perl6 work 
                    that a non-guru could follow?

01:42 < zzzzzzzzzz> Most of the hits under 
                    https://duckduckgo.com/?q=current+state+of+Perl6 are ca. 
                    2010 and even http://perl6.org/compilers/features is close 
                    to two months old.

...

01:47 < zzzzzzzzzz> That's the impression I get but I have a hard 
                    time getting much farther than that.  For example, "what 
                    exactly do I download to start learning, and why those bits 
                    instead of other bits?"

...

01:52 < zzzzzzzzzz> Whichever.  A site that took a snapshot of the state every 
                    quarter or two would make it a lot easier for relative 
                    noobs to get up to speed and start learning things.

This is a feeling I've shared for a while. Working out where Perl 6 is takes a bit of archeology, trying to figure out what the Compiler Feature matrix means.

Anyway, I've taken a stab at trying to create a very short, simple, regularly updated set of answers: http://perl6.guide/, hopefully accessible to Perl 5 developers and random other developers. It's on Github (there's a link in there), so if you think I've gotten something wrong, or want to update it, please send me a pull request.

Book Report - October 2014

This month has been quite a busy one for me, so I haven't had much chance to work on my (in-progress) book. However, I have had some time to start work on a short talk for London Perl Workshop 2014 which will cover some of the OO best practices followed in the book. (At the time of writing, I've not yet heard whether the talk has been accepted/scheduled.)

S.C.O. cloning project - progress report

A week ago I mentioned that I've started to create a clone of search.cpan.org using the MetaCPAN API as back-end. I've also promised to record a series of screencasts explaining the process. Something, that can be very useful if you need to rewrite an application and you can't read the source-code.

20 years and counting

So myself and I think most of the Perl world missed an important date on October 12th

Well that day marked the first release of DBI to CPAN.

It is hard to judge how much an impact this hunk of code has had on dare I say it the world. IMHO it was the first killer app for the web and still with us today being actively developed and improved on and has kept its place just quietly sitting in the background doing its job.

If I sit back and think of 20 years ago I had just upgraded to a 12k modem from a 1.2k, browsed the internet, (If you could call it that) with text browser, Netscape was only release 1 day later, (By the way it too me 19+ hours to download it) a few week later one used something call web-crawler

WebCrawler.png

Managing Boilerplate with Import::Base

Boilerplate is everything I hate about programming:

  • Doing the same thing more than once
  • Leaving clutter in every file
  • Making it harder to change things in the future
  • Eventually blindly copying without understanding (cargo-cult programming)

In an effort to reduce some of my boilerplate, I wrote Import::Base a module to collect and import useful bundles of modules, removing the need for long lists of use ... lines everywhere.

Inline Grant Weekly Report #1

Just finished up week #1 of the TPF Grant for Inline Modules with DAVIDO++. We've been having a blast, making great progress, all while trying to push the boundaries of open/public/televised/pair/perl programming!

Here's our weekly status report (using our new homemade blogging system (thinking about you, Tony Bowden!)): http://inline.ouistreet.com/

We'll be writing up a report each Saturday, just in time for Gabor's http://perlweekly.com/

Stop by #inline on irc.perl.org and say HAI, if you are so inclined.

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.