----
presentation_topic: Apocalypse Now
presentation_title: Perl 6 is Here Today
presentation_place: http://www.kwiki.org/apocalypse/start.html
presentation_date: August 3rd, 2005
----
{image: http://perlcabal.org/~autrijus/today.jpg}

Apocalypse Now

Brian Ingerson

http://www.kwiki.org/apocalypse/start.html

----
== Why The Sheer Horror Ingy?

{image: http://example.com/30644841_2a9e22ef88.jpg}
+* Is it the Hot Balls of Fire?
+* Or the fact that it's Tuesday night and you haven't written your Perl 6 talk?
+** *And you really don't know anything about Perl 6.*

----
{image: http://www.wetware.com/bc/burn/burnimage/nat1.jpg}
== OSCON is Completely Insane

+* My year is broken into two halves: 
** pre-oscon and post-oscon
+* Before OSCON you try to hack on Cool Things (tm).
* On February 15th you send off 5-10 proposals
* Probably none of them will get accepted
+* So you play the "Autrijus Stunt Double Card"
+* You spend six months worrying about what to say.
+* Then you write your talk in the final 24 hours.
* Give the talk and rinse, lather, repeat...
+* THIS IS TYPICAL!!
----
== Gratutitous Rant Slide
{image: http://www.w3.org/2004/Talks/w3c10-WebOfMeaning/TimOReilly.jpg}
* O'Reilly is the Heart and Soul of OSS
* BUT...
+* There is way more going on out there than OSCON can possibly present.
+* OSCON started out as "The *Perl* Conference"
+* It has grown into "The Everything Conference"
+* This may be my last OSCON...
** 2000-2005
+* Please support grass roots conferences in your favorite technologies
** Like YAPC
** And whatever it is you Python and Ruby people do...
+* And ORA, please find a way to include all the hackers.

+</rant plea="O'Reilly, please don't cut my balls off for this">
----
banner_bgcolor: lightblue
----
{image: http://images.amazon.com/images/P/B0002U5CSS.01-A3CU9PWKX4XOBY._SCLZZZZZZZ_.gif}
== So How did Ingy get the Honors of Talking About Pugs?

+* Thank George!
+* Audrey Tang is arguably one of the greater hackers of our time...
+* But they don't seem to take that into account at the airports...
+* Autrijus won't be here for at least 3 more years.
+* So Ingy is the opportunist this year.
----
{image: http://www.fabioifc.com/fabio/FAB_GIFS2/FABIO_double.gif}
== I am here as Audrey Tang's Stunt Double!

* Ingy has dubious qualifications...
* Very early pugs user.
* Taipei Hackathon
* ~100 early commits
* Toronto Hackaton

----
{image: http://royshort.com/images/Duke/GIRLSDEMAND.jpg}
== We Have Some Very Exciting New For You!!!

* Without further ado...
+* Perl 6 IS HERE TODAY!!!
+* Um... well...
+* Yeah, duh.

----
== A Word From our Sponsor

* Maybe this is a good time to hear what Autrijus has to say:

+http:movies/oscon05-autrijus.mp4

----
{image: http://al-islam.org/gallery/kids/Clipart/drawings/Mob.gif}
== Wiki Style Development

* On the Pugs Dev Team\wMob, everyone is welcome.
* irc://irc.freenode.net/#perl6
* http://apocalypse.kwiki.org
+* What Me Worry?
{image: http://www.firsttvdrama.com/enterprise/images/alfred.jpg}
+* The Lambda Camels will save me...

----
{image: http://www.chak.org/blog/archives/images/2004-09-15-pug/black-pug.jpg}
== So What is Pugs Anyway?
----
{image: http://www.cpan.org/misc/jpg/cpan.jpg}
== Pugs is Just Another CPAN Module

* Perl6-Pugs
* Available on a CPAN near you
* Same old, same old:

    perl Makefile.PL
    make
    make test
    make install

----
{image: http://www.rblack.org/Subversionsept.jpg}
== Pugs is *NOT* Just Another CPAN Module

* http://svn.openfoundry.org/pugs
* It is a fully working Perl 6 Interpreter
* And so much more.

/Run pugs for the nice people/

----

* `examples/advocacy/motd.p6`

.perl
#!/usr/bin/pugs

use v6;

#XXX just so that File:;Spec can be used w/o being installed
unshift @*INC, 'ext/File-Spec/lib', '../ext/File-Spec/lib', '../../ext/File-Spec /lib';

require File::Spec;

my $progdir = splitpath($*PROGRAM_NAME)[1] || '.';
@*INC.push($progdir);
require Motd; #must be in PERL6LIB path, to say 'use'; 

my $limit     = @ARGS[0] // '2';
my $dict      = canonpath("$progdir/pugspraise");
my $fh        = open $dict err die $!;
my @list      = map &chomp, =$fh;

#XXX it sure would make things tidier filehandle could be autochomped.

my &tell = -> $max {
        # the hash prevents the pick of identical phrases for a single
        # sentence
        say "Pugs is{
            my %a;
            # randomize the iterations for variety's sake
            for 1..pick( 1..$max) {
                # weight every pick equally    
                %a{pick @list}=1;
            }
            report matchval(1,%a,$max);
        }."
};

tell($limit);
.perl

----
{image: http://www.worksongs.com/blogpics/junction.jpg}
== The Pugs Timeline

* I remember my very first experience with the Pugs interpreter...
+* Junctions!
* In the first week!
* The `print` function came about a week later!

----
{image: http://linide.sourceforge.net/pugs-svngraph-6.2.9.png}
== The Pugs Timeline

* Project begins: Feb 1
+* Primitive interpreter working: Feb 6
** With Junctions!!
+* `print` works: Feb 15
+* `say` works: Feb 16
+* `Test.pm` runs correctly: Feb 23

+* PCRE regex support: Mar 19
* `mandel.p6` compiled to Parrot: Mar 24

+* Container types: Apr 10
* `BEGIN` blocks and `use`: Apr 26

+* PGE-based rule support: May 2
* Basic objects and classes: May 12
* mod_pugs: May 17
* Use Perl 5 modules: May 25

+* Safe mode and evalbot: Jun 2
* Source filtering macros: Jun 11
* `Test.pm` compiled to Parrot: Jun 18
* `Test.pm` runs on Parrot: Jun 23
* `Hello, world!` from Perl 5 to PIL to Parrot: Jun 24
* Perl 6 AST as Perl 6 objects: Jun 25
* PIR nodes as Parrot objects: Jun 26
* Test::Builder feature complete: Jun 30

+* Separate compilation, starting with Prelude.pm: Jul 10
* Beginning of Perl 5 evaluator of PIL: Jul 14
* Beginning of PIL to JavaScript compiler: Jul 17
* New PIL runcore in Haskell begins: Jul 30

+* MetaModel implementation in Perl5 bootstrapped: Aug 01
+* Pugs 6.2.9 Release: Today!

----
== Who have done it

{image: http://perlcabal.org/~autrijus/images/commit.png}

* Lambdacamels
** 100+ committers
** 5000+ revisions
** We have 7000 unit tests; at least 15000 more expected
+* Autrijus's primary function is Pugs's journaling filesystem
** http://use.perl.org/~autrijus/journal/
** He is responsible for less than 40% of commits now

----
== Obligatory timeline

{image: http://pugscode.org/perl6-timeline.png 500}

* 6.0: Initial release
* 6.2: Basic IO, variable and control flow elements
* 6.28: Classes and traits
* 6.283: Rules, Grammars
* 6.2831: Role composition
* 6.28318: Macros
* 6.283185: Port Pugs to Perl 6, if needed

----
{image: http://perlcabal.org/~autrijus/images/earendils_ship_port.jpg}

    A ship then new they built for him
    of mithril and of elven glass.

                    -- Perl 5.0, perl.c

----
{image: http://perlcabal.org/~autrijus/images/ship.jpg}

    A ship then new they built for him
    Of mithril and of elven-glass
    With shining prow; no shaven oar
    Nor sail she bore on silver mast;
    The Silmaril as lantern light
    And banner bright with living flame
    To gleam thereon by Elbereth
    Herself was set, who thither came...

                    -- Pugs 6.2.6, Main.hs

----
{image: http://perlcabal.org/~autrijus/images/ship.jpg}

    Sie bauten ihm ein neues Schiff
    Aus Mithril und aus Elbenglas
    Mit stolzem Bug, doch ruderlos,
    Mit Silbermast, doch ohne Tuch,
    Und Elbereth kam selbst herab:
    Sie schuf dem Schiff den Silmaril
    Zum Banner, ein lebendiges Licht,
    Ein heller Schein, der nie verblaßt.

                    -- Pugs 6.2.7, Main.hs

----
{image: http://perlcabal.org/~autrijus/images/ship.jpg}

    眾人為彼造新舟
    鑄以祕銀精靈璃
    船首閃耀何需槳
    銀桅未有風帆繫
 
    無雙寶鑽作燈炬
    旗幟輝煌展生焰
    映照燃星雅碧綠
    神祇乘梭下九天...

                    -- Pugs 6.2.8, Main.hs
----
{image: http://perlcabal.org/~autrijus/images/ship.jpg}

    Une nef neuve alors lui firent
    De mithril et de verre elfique,
    À la proue brillante, sans rame
    Ni voiles à son mât d’argent:
    Le Silmaril comme lanterne
    Et bannière, vivante flamme,
    Pour resplendir y fut placé
    Par Elbereth même, qui vint...

                    -- Pugs 6.2.9, Main.hs
----

    use v6;

    for $*Larry {
        our Ship $pugs .= new(:of<mithril elven-glass>);
        given $pugs {
            $.prow does Shine;
            Silver $.mast but none(Oar::Shaven, Sail);
            Light  $.lantern := $*Silmaril;
            Bright $.banner  := Flame.bless:{};
            when $*Elbereth.gleam {
                .sail(...);
            }
        }
    }
                    -- examples/poetry/pugs_main.p6

----
{image: http://www.csse.monash.edu.au/~damian/damian.gif}
== Perl 6 is a completely Insane Language

+* It was designed mostly by Damian and Larry
* Did you see their talks last night?
{image: http://www.2log.net/home/tabloid/gazou/damian2.gif}
* Need I say more?

----
{image: http://images.amazon.com/images/P/B00006L1T0.01.LZZZZZZZ.jpg}
== Perl 6 is a completely Insane Language

* Perl 6 makes the easier things even easier
+* And the hard things become truly weird!
+* No good idea has been left behind...
+* It is a language that is almost */impossible/* to implement

----
{image: http://www.atomiccoffeemedia.com/theonion/jimmydean/contest/images/pictures/pugs-hot.jpg}
== There /is/ a group of people more insane though...

* They call themselves Lambda Camels
* They fear nothing
* They rush in where angels fear to tread
* They have a secret weapon...
+* Haskell
{image: http://www.haskell.org/HaskellLogo_2.jpg}
----
{image: http://www.atomiccoffeemedia.com/theonion/jimmydean/contest/images/pictures/pugs-hot.jpg}
== There is a group of people more insane though...

* How do you join their ranks?
* You just ask, and you get full commit access to pugs.
* Many times you don't even need to ask
* There are well over 100 people with commit access.
* *You* can be the next. Seriously...

----
== Intoducing the Lambda Camels!

* The best people to tell you about Pugs are its authors...
* I interviewed 9 of the many people who are hacking on Pugs.

+* Audrey Tang -- `autrijus` -- Taipei, Taiwan
* Aankhen -- `Aankhen` -- India
* Gaal Yahas -- `gaal` -- Tel-Aviv, Israel
* chromatic -- `chromatic` -- Oregon, USA
* Stevan Little -- `stevan` -- Connecticut, USA
* Ingo Blechschmidt -- `iblech` -- Bavaria, Germany
* Nathan Gray -- `kolibrie` -- Virginia, USA
* Yuval Kogman -- `nothingmuch` -- Israel
* Darren Duncan -- `Darren_Duncan` -- British Columbia, Canada

----
== The questions:
* Describe the Pugs Team.
* What is the coolest thing about Perl 6?
* What is the coolest thing about Pugs?
* What have you been hacking on lately?
* Write a piece of Perl 6 code.

----
=== Describe the Pugs Team.
+* nothingmuch -- The pugs team is the subset of the people of the world world such that a given member has a pugs committer bit. That's not saying much though. ;-)

+* Aankhen -- Some of the brightest people I've ever worked with.  Seriously, where else would you find someone who's writing a Perl 6 to JavaScript compiler?  Or a self-hosting metamodel of Perl 6 in Perl 5?  Or even Pugs itself, an implementation of Perl 6 in Haskell which can compile to JavaScript?

+* chromatic -- First there was Autrijus, who taught himself Haskell.  Then other people taught themselves Haskell, and Perl 6.  Now people write Perl 6, or Haskell, or Parrot, or Perl 5, or JavaScript, or documentation, and things work together and every day the full Perl 6.0 gets a little bit closer.

+* stevan -- An insane bunch of over-acheivers who clearly are neglecting their any(@day_jobs, $family, $real_life) in order to hack on Pugs.

+* autrijus

    Who can be chaotic
        with calmness turning crystalline
    Who can be peaceful in long term movement
        While showing vitality progressively

    Those who keep Dao in them
        No complacency 

+    孰能濁以止？靜之徐清。孰能安以久？動之徐生。
    保此道者，不欲盈。

----
=== What is the coolest thing about Perl 6?
+* gaal -- It steals the right things from many languages, but still is *Perl*.

+* iblech -- I like the way it combines imperative, OO, and functional programming. I like its conciseness. I like its great flexibility: user-defined operators, possibility of overriding/subclassing "built in" classes, macros, possibility of grammar redefinition.

+* nothingmuch -- The coolest thing about perl 6 is that it's everything including the kitchen sink, but it remains pretty. There is functional programming, object oriented gramming, aspect oriented programming, imperative, and more all in one  giving you the ability to use the best one for each job, and more importantly to use them all together. The language itself promises more performance, more xibility and more safety than perl 5.

+* Darren Duncan -- I like the proper clean support for Objects, where you can declare object attributes that are checked by Perl at compile time as my/our variables are now, rather than being hashes where keys are just strings.

+* autrijus

    Defect makes perfect
        Inflection straightens
    Hollow allows impletion
        Spoiled renews
    Lesser means content
        Excessive confused

    Thus the ideal leader
        Embraces the integrated Dao as paradigm

    「曲則全，枉則直，窪則盈，敝則新，少則得，多則惑。」
    是以聖人抱一為天下式。

----
=== What is the coolest thing about Pugs?

+* Aankhen -- Being able to compile to JavaScript.

+* chromatic -- The possibility of multiple independent backends (and multiple independent frontends) is compelling.

+* iblech -- I like Pugs' excellent design, allowing rapid development. I like its testsuite. I like that there're many things you can do (write Haskell, write Perl 5, write Perl 6, write documentation, etc.). I like its multi-backend nature (eval, compile to PIL, PIR, Perl 5, JavaScript, ...).

+* kolibrie -- It's fun.  The team ignores the "it's impossible" viewpoint and implements things anyway.

+* Darren -- It lets Perl 6 run right now.  And that it is a clean and elegant but quick esign.

+* autrijus

    Humans begin life gentle and tender
        Turn hard and rigid in death
    Plants begin life gentle and fragile
        Wither and dry up in death
    Thus gentle and tender are living types
        Hard and rigid are dying types

    Headstrong army
        May not win a battle
    Hard wood
        Normally cut down
    Strong and bulky
        Low
    Gentle and tender
        The highest ranked

    人之生也柔弱，其死也堅強。草木之生也柔脆，其死也枯槁。
    故堅強者死之徒，柔弱者生之徒。
    是以兵強則滅，木強則折，強大居下，柔弱居上。

----
=== What have you been hacking on lately?

+* Aankhen -- A Perl 6 replacement for CGI.pm.  This consists of a large number of modules, including libwww-perl, URI.pm, and an HTML generation module.  The most recent module I hacked together was HTTP::Query.

+* gaal -- Precompiled Prelude.pm, and a build system I'm not happy with yet.  Next up is `use fatal`.

+* chromatic -- I'd like to add a few more features to Test::Builder::Tester and write a couple of other testing modules, perhaps Test::More and Test::Class.

+* stevan -- For the past month or so I have been working on the Object Meta Model, which is the underlying structure of the classes, and instances in Perl 6.

+* iblech -- I've been working on PIL2JS lately, a PIL to JavaScript compiler. And this is why it's great to have a large testsuite, I can see the areas I've to work on quite accurately.

+* nothingmuch -- I hacked 3-4 hours of Harrorth this week though. Harrorth is my attempt at learning haskell, forth and Parrot together by implementing the second in the first on top of the third.

+* autrijus

    Act in nothingness
        Work in peace
        Taste in flavorlessness

    Magnify the small
        Amplify the little
        Return animosity with kindness

    Masterminding complex from easy
        Managing big projects from small

    為無為，事無事，味無味。大小多少，報怨以德。
    圖難于其易﹔為大于其細。

---- 
=== Write a piece of Perl 6 code.

+*stevan:

  # function perl 6
  multi sub length ()          returns Int { 0               }
  multi sub length (*$x, *@xs) returns Int { 1 + length(@xs) }

  # fun with Junctions
  any(1 .. 100).pick() # pick random number between 1 and 100
      
  # factorial with anon block
  my $fact = -> $n { $n < 2 ?? 1 !! $n * &?BLOCK($n - 1) };
  $fact(10);

+* iblech

  say @array.map:{...};
  # say (imperative)
  # @array.map (OO)
  # map:{...} (functional)

+* nothingmuch

 # the ☛ sub executes several bits of code simultaneously but safely
 # (as long  they don't do IO).

 sub ☛ (*@subs of Code) { for @subs -> &c { async { atomic { &c } } } };

 ☛ &moose, &goat;

+* autrijus

    無憂

    no worries;

----
== So What Can You Do With Pugs Now?

* Q: Can you write scripts?
+* A: Yes!

* Q: Can you write modules?
+* A: Yes!!

* Q: Can you use it in production?
+* A: Yes...
+* (If you are a total frickin idiot)

+* But some idiot will do it...
+* And that's a good thing.
* Some idiot way back when decided to use Perl in a production environment.
----
== Perl 6 is totally crazy man!

+* It's /Gonzo/!
{image: http://usuarios.lycos.es/catarsis/images/11185f.jpg}
----
banner_bgcolor: hotpink
----
{image: http://images-eu.amazon.com/images/P/B00005Q3DX.03.LZZZZZZZ.jpg}
=== Gonzo Journalism
+We had two bags of grass, seventy-five pellets of mescaline, five sheets of high-powered blotter acid, a saltshaker half-full of cocaine, and a whole multi colored collection of uppers, downers, laughers, screamers... Also, a quart of tequila, a quart of rum, a case of beer, a pint of raw ether, and two dozen amyls. Not that we needed all that for the trip, but once you get into a serious drug collection, the tendency is to push it as far as you can. The only thing that really worried me was the ether. There is nothing in the world more helpless and irresponsible and depraved than a man in the depths of an ether binge, and I knew we'd get into that rotten stuff pretty soon. 

----
{image: http://upload.wikimedia.org/wikipedia/en/e/ec/Autrijus.jpg}
=== Gonzo Programming

We had two grammars of regexes, seventy-five levels of roles, five kinds of high-dimensional hyper operators, a precedence table half-full of symbols, and a whole multiply dispatched collection of methods, submethods, pointies, blocks... Also, an inferencer of subtypes, a metaoperator of reductions, a tree of macros, a set of disjoint junctions, and nine unboxed intrinsics. Not that we needed all that for the prototype, but once you get into a serious module collection, the tendency is to push it as far as you can. The only thing that really worried me was the junction. There is nothing in the world more helpless, irresponsible and depraved than a function in the depths of junctive autothreading, and I knew we'd get into that rotten stuff pretty soon.

+http:movies/oscon05-stevan.mp4

----
=== Gonzo Programming
{image: http://books-support.softbank.co.jp/pn/image/interview3.jpg}

* Definitive proof that the Perl 6 design team is on drugs:

+* From the `perl6-language@perl.org` mailing list

  On Thu, Mar 03, 2005 at 12:36:00PM -0800, Brian Ingerson wrote:
  > Thanks for the mind expanding reply.

  You're welcome.  Next time don't eat blue sugar cubes from my frig.  :-)
  
  Larry

----
== Thank you!

{image: http://perlcabal.org/~autrijus/images/bowing.jpg}

* Any questions?
