Telephone +44(0)1524 64544
Email: info(at)shadowcat.co.uk

Sat Dec 22 00:30:00 2012

Slides for the talk pm-decon at fpw-2012

-

Postmodern
Deconstructionism

-

My favourite
programming
language

-

... is CPAN

-

"perl5 is just
syntax; CPAN
is the language"
(audreyt)

-

Devel::Declare

-

"perl5 is just
a VM; CPAN
is the language"

-

CPAN

-

Collaboration?

-

Independent
tacit
co-operation

-

Collaboration
like results

-

Emergent
behaviour

-

Culture
Ecosystem

-

Useful word:
agalmia
(lilo)

-

Modules
built on
modules
built on
modules
built on
modules

-

Culture
of sharing

-

Self nourishing
ecosystem

-

PAUSE indexed
distributions
by namespace

-

Dancer - 114

-

Dancer - 114
Mojo - 122

-

Dancer - 114
Mojo - 122
DBIx::Class - 133

-

Dancer - 114
Mojo - 122
DBIx::Class - 133
Moose - 308

-

Dancer - 114
Mojo - 122
DBIx::Class - 133
Moose - 308
Catalyst - 617

-

Interestingly

-

Dancer - 114
Mojo - 122
DBIx::Class - 133
Plack - 181
Moose - 308
Catalyst - 617

-

Plack? 181?
Already?

-

Stepping
back ...

-

Stepping
sideways

-

DBIx::Class

-

I wasn't
trying to
write an
ORM

-

I was
trying to
write an
ORM toolkit

-

Toolkit?

-

Idea: Build
the ORM that
suits your
project

-

Result?

-

COMPLETE
FAILURE

-

DBIx::Class::Core
was meant to be
an example

-

It became what
everybody used

-

SQL::Abstract

-

Adopted by
DBIx::Class and
DBIx::DataModel

-

People kept
writing more
SQL builders

-

Result?

-

PARTIAL
FAILURE

-

Mechanism
versus
policy

-

Syntax
is policy

-

Interface
is policy

-

Architecture
is policy

-

So is
everything
policy?

-

Sooooort
of ...

-

One layer's
policy

-

One layer's
policy is the
next layer's
mechanism

-

How do we
make that
explicit?

-

Back to
Plack

-

Back to
Catalyst

-

Catalyst::Engine::*

-

Years of
inviting
people to
steal them

-

Result?

-

COMPLETE
FAILURE

-

HTTP::Engine

-

Brave
attempt

-

Problem:
objects

-

Problem:
object
system
argument

-

Problem:
objects
codify
API

-

API is
interface

-

Interface
is policy

-

Result?

-

MOSTLY
FAILURE

-

Mojo

-

Originally
meant to be
a framework
toolkit

-

Mojolicious
as example

-

Less OO
heavy

-

Interesting
ideas

-

Problem:
Everybody
used the
example

-

Problem:
Blurred
branding

-

Result?

-

COMPLETE
FAILURE

-

(IN)COMPLETE
FAILURE

-

Framework - success
Toolkit - nice try

-

Plack

-

PSGI
protocol

-

Protocol?

-

A protocol
codifies an
interface

-

A protocol
codifies a
mechanism

-

PSGI.pod

-

Independent
protocol
definition

-

Plack as
reference
implementation

-

Plack as
toolkit only

-

Plack::Request
explicitly for
toolkits

-

Plack::Request
explicitly NOT
for application
code to use

-

Prevents
scope creep

-

Plack::Request
wraps $psgi_env

-

Explicitly
separate

-

Scope creep
prevented by
design

-

Plack
PSGI

-

Two
names

-

No branding
confusion

-

Some (minor)
non-Plack
implementations

-

Dual implementation
keeps you honest

-

PSGI

-

Hashref
Arrayref
Coderef

-

Simple
Explicit
Ugly

-

Ugly?

-

No sugar.
No syntax.

-

No sugar.
No syntax.
No policy.

-

Policy provided
by frameworks

-

Catalyst
Dancer
Web::Simple
Mojolicious

-

No arguing
who owns an
object

-

... because
PSGI does not
provide any
objects ...

-

Result?

-

181 distributions
match /^Plack/

-

Fast growth.
Wide adoption
by frameworks.

-

COMPLETE
SUCCESS

-

Summary
of why?

-

Defined protocol

-

Defined protocol
Multiple implementations

-

Defined protocol
Multiple implementations
Clear branding

-

Defined protocol
Multiple implementations
Clear branding
Scope creep inhibited

-

Defined protocol
Multiple implementations
Clear branding
Scope creep inhibited
Policy forced outside

-

Other
areas

-

I am working
on Web::Dispatch

-

Dispatch tree
system designed
to sit underneath
framework syntax

-

I am working
on Data::Query

-

General data
filtering and
transformation
approach

-

(will one day
be PSGI for
SQL ... I hope)

-

Other
areas

-

CLI
applications

-

87 Getopt
distributions

-

Lots of
command /
subcommand
distributions

-

WHYYYY

-

Somebody needs
to invent PCLI

-

... and
miyagawa's
too busy

-

... maybe
you should
try? :)

-

Ecosystems
on top of
ecosystems
on top of
ecosystems
on top of
ecosystems

-

Turtles
all the
way down

-

Modules
all the
way down

-

CPAN
all the
way down

-

The short
guide to
Plackification

-

Define a protocol
Separate the implementation
Brand clearly
Inhibit scope creep
Force policy outside

-

Define a protocol
Separate the implementation
Brand clearly
Inhibit scope creep
Force policy outside
... profit?

-

Try it.

-

It just
might work.

-

Thank You
IRC:mst
mst@shadowcat.co.uk
@shadowcat_mst