Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
Python and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Lua, etc
 
Perl 6 - significantly nearer, and Rakudo looks very good

There's been a longstanding jest that says "You'll have Perl 6 for Christmas" but goes on to add "but of course we won't tell you which Christmas."

Christmas may have arrived early this year ... for this morning I downloaded Rakudo Star - the November 2010 release that's been out for about a week ... according to Github 200 people had got there before me, so perhaps I'm still a bit leading edge. The Rakudo team describe it as "a useful and usable distribution of Perl 6" ... I haven't thrown enough at it yet to be sure but first impressions are that their claims are valid.

Rakudo Star unpacked, and built easily from source on my Mac (MacBook Pro with Developer's Xcode, running OS X 10.6.4) ... in a nutshell:
  cd /usr/local
  sudo tar xf ~/Downloads/rakudo-star-2010.11.tar
  sudo chown -R graham rakudo-star-2010.11
  cd rakudo-star-2010.11/
  perl Configure.pl --gen-parrot
  make
  make install
  cd /usr/local
  sudo ln -s /usr/local/rakudo-star-2010.11 perl6

and into my ~/.bash_profile file add
  export PATH=/usr/local/perl6:$PATH
then (in a window that's freshly creates to check the new path ...)

  wizard:dec10 graham$ perl6
  > print "Hello World\n";
  Hello World
  > exit
  wizard:dec10 graham$


(Goodness - it's nice to have the interactive shell come up like that)


Let's try a real (Perl 5) program and - yes - that's going to throw up the compatibility issues:

  sub ladder {
    $plen = sqrt($_[0] ** 2 + $_[1] ** 2);
  }
  print "Hello World\n";
  $moat = ladder(5,12);
  $building = ladder(3,4);
  print "Ladder lengths needed are $moat and $building\n";


  wizard:dec10 graham$ perl oldperl.pl
  Hello World
  Ladder lengths needed are 13 and 5
  wizard:dec10 graham$


but

  wizard:dec10 graham$ perl6 oldperl.pl
  ===SORRY!===
  Symbol '$plen' not predeclared in ladder (oldperl.pl:3)
  wizard:dec10 graham$


And - straight away - you see the first "fix" - variables are no longer default global, even without the "use strict;". Thank Goodness!

Let's rewrite that code, but pull in another of the Perl 6 new features - named parameters:

  sub ladder($width, $height) {
    my $plen;
    $plen = sqrt($width ** 2 + $height ** 2);
  }
  print "Hello World\n";
  my $moat = ladder(5,12);
  my $building = ladder(3,4);
  print "Ladder lengths needed are $moat and $building\n";


Of course, that fails with Perl 5:

  wizard:dec10 graham$ perl newperl.pl
  Malformed prototype for main::ladder: $width,$height at newperl.pl line 8.
  wizard:dec10 graham$


but it runs sweetly on Rakudo Star:

  wizard:dec10 graham$ perl6 newperl.pl
  Hello World
  Ladder lengths needed are 13 and 5
  wizard:dec10 graham$


There's a second of the big potential criticisms of Perl 5 wiped out - Wow!

Now - you should NOT consider that Rakudo Star is Perl 6.0.0 or anything like that - there are still some features to be tested and implemented; they're listed in more detail at http://rakudo.org/announce/rakudo-star/2010.11, but it is an excellent step and something that's becoming very practical indeed to start using. And I have to say I have been very impressed this morning - it downloaded, unpacked, compiled, ran my little tests flawlessly.

The Mac I used is the presentation machine. So Perl 6 (Rakudo Star) will be available for use on forthcoming courses. That's not to say that we'll switch straight over - we will NOT - but we will be able to add flesh to an introductory talk about Perl 6 by running it, and we'll be able to delve in deeper as and if our delegates require / request us to do so.

I think I'm going to have a good Christmas this year (although I may be slightly inseparable from my keyboard) ... and I go forward with a new spring in my step; it now looks much more likely that Perl will still be one of our major training language even in 2020.

Now if you'll excuse me, I'm off to play with the samples, and write a lot more code of my own.




The 'story' behind this application / sample program is told [here] (and that also tells you why there's a picture of Edinburgh Castle illustrating the article)
The Perl 5 source of the example above is [here]
The Perl 6 source of the example above is [here]
(written 2010-12-02, updated 2010-12-04)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
P256 - Perl 6 Look Ahead
  [2967] Multiway branches in Perl - the given and when syntax - (2010-09-22)
  [2817] Setting a safety net or fallback value in Perl - (2010-06-19)
  [2816] Intelligent Matching in Perl - (2010-06-18)
  [2815] switch and case, or given and when in Perl - (2010-06-17)
  [2559] Moving the product forward - ours, and MySQL, Perl, PHP and Python too - (2010-01-01)
  [1721] Perl 6 - When will we have a production release? - (2008-07-26)
  [1417] What software version do we teach? - (2007-10-31)
  [1215] An update on Perl - where is it going? - (2007-06-03)
  [995] Ruby's case - no break - (2006-12-17)
  [582] DWIM and AWWO - (2006-01-30)
  [550] 2006 - Making business a pleasure - (2006-01-01)
  [113] A Parallel for Perl 6 - (2004-11-09)
  [89] When will Perl 6 be available - (2004-10-15)


Back to
Python through the Snow
Previous and next
or
Horse's mouth home
Forward to
Royal Wedding. How William and Catherine have changed our schedule
Some other Articles
wxPython - simple example to add GUI to a server log file analysis
Santa Special - rather more special than usual - December 2010
TransWilts Rail News ... Melksham (Santa Special) Edition ... 5th December 2010
Royal Wedding. How William and Catherine have changed our schedule
Perl 6 - significantly nearer, and Rakudo looks very good
Python through the Snow
Change of balance, of attitude, and of work method
Running a course ... what if the tutor isn't well?
Customer Service - the boundary
Finding elements common to many lists / arrays
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2019: 404 The Spa • Melksham, Wiltshire • United Kingdom • SN12 6QL
PH: 01225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/3077_Per ... -good.html • PAGE BUILT: Sat May 27 16:49:10 2017 • BUILD SYSTEM: WomanWithCat