SlideShare a Scribd company logo
1 of 74
Corinna Status
Update
Modern OOP is coming to Perl
Curtis “Ovid” Poe
https://allaroundtheworld.fr/
https://ovid.github.io/
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Question Policy
• Please hold them to the end
• Unless something is completely incomprehensible
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Dedication
David
Adler Jeff Goff
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Sparky
What is Corinna?
https://github.com/Ovid/Cor
(This talk is not a tutorial on Corinna)
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
The Lisp
Curse
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
The Lisp
Perl Curse
(edited)
Since making Perl object systems is not
hard, many Perl hackers have done so.
More to the point, many individual Perl
hackers have done so. Programs written
by individual hackers tend to follow the
scratch-an-itch model. These programs
will solve the problem that the hacker is
having without necessarily making the
software more useful to others. This
means that these one-man-band
projects tend to solve eighty-percent of
the problem.
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
• bless
• @ISA
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
• bless–We have methods!
• @ISA–Where are the methods?
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
• bless–We have methods subroutines!
• @ISA–Where are the methods subroutines?
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
package Name;
sub new {
my ( $class, %arg_for ) = @_;
return bless {
name => $arg_for{name},
title => $arg_for{title},
}, $class;
}
sub _title { $_[0]->{tilte} }
sub _name { $_[0]->{name} }
sub name {
my $self = shift;
my $title = $self->_title;
my $name = $self->_name;
return $title ? "$title $name"
: $name;
}
1;
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
my $ovid = Name->new( name => 'Ovid' );
my $doctor = Name->new(
title => 'Dr.',
name => 'Who',
);
say $ovid->name; # Ovid
say $doctor->name; # Dr. Who
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOP
(Today)
package Name;
sub new {
my ( $class, %arg_for ) = @_;
return bless {
name => $arg_for{name},
title => $arg_for{title},
}, $class;
}
sub _title { $_[0]->{tilte} }
sub _name { $_[0]->{name} }
sub name {
my $self = shift;
my $title = $self->_title;
my $name = $self->_name;
return $title ? "$title $name"
: $name;
}
1;
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna
class Name {
field $name :param;
field $title :param { undef };
method name () {
return $title ? "$title $name" : $name;
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Core
OOPS
package Name;
sub new {
my ( $class, %arg_for ) = @_;
return bless {
name => $arg_for{name},
title => $arg_for{title},
}, $class;
}
sub _title { $_[0]->{tilte} }
sub _name { $_[0]->{name} }
sub name {
my $self = shift;
my $title = $self->_title;
my $name = $self->_name;
return $title ? "$title $name"
: $name;
}
1;
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna
class Name {
field $name :param;
field $title :param { undef };
method name () {
return $Title ? "$tilte $name" : $name;
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
80+ OOP
systems
on the
CPAN
Mo
Mu
Mic
Moo
Mew
Dios
Moose
Moops
Moxie
reform
Spiffy
Zydeco
HO::Class
Class::LOP
Evo::Class
Class::Dot
Class::Ref
Class::Std
Mojo::Base
Eixo::Base
Class::Root
Class::Easy
Class::Core
Class::Base
Class::Lite
Class::Lego
Class::GAPI
Class::Slot
Class::Tiny
Class::Gomor
Class::Field
Rose::Object
Class::Maker
Class::HPLOO
Class::Frame
Class::Class
Class::Simple
Class::Attrib
Class::Closure
Class::Methods
Class::Builder
Class::Declare
Class::Accessor
Class::Contract
Class::Generate
Class::InsideOut
Acme::Class::Std
Class::Anonymous
Class::Classless
Class::Std::Fast
Class::Framework
Class::Autoclass
Class::Methodist
Bubblegum::Class
Object::LocalVars
Object::InsideOut
Class::AutoAccess
Class::Prototyped
Class::Structured
Class::NamedParms
Class::Constructor
AI::FreeHAL::Class
Class::BuildMethods
Lexical::Attributes
Class::AccessorMaker
Class::IntrospectionMe
thods
Class::MakeMethods::Te
mplate::InsideOut
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Dios
Damian
Conway
class Identity is Trackable {
shared Num %!allocated_IDs;
shared Num $.prev_ID is rw;
func _allocate_ID() {
while (1) {
lex Num $ID = rand;
return $prev_ID =$ID if !$allocated_IDs{$ID}++;
}
}
has Num $.ID = _allocate_ID();
has Str $.name //= '<anonymous>';
has Passwd $!passwd;
method identify (Str $pwd --> Str) {
return "$name [$ID]" if $pwd eq $passwd;
}
submethod DESTROY {
say "Bye, $name!";
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Zydeco
Toby Inkster
class Person {
has name ( type => Str, required => true );
has gender ( type => Str );
factory new_man (Str $name) {
return $class->new(name => $name, gender => 'male');
}
factory new_woman (Str $name) {
return $class->new(name => $name, gender => 'female');
}
method greet (Person *friend, Str *greeting = "Hello") {
printf("%s, %s!n", $arg->greeting, $arg->friend->name);
}
coerce from Str via from_string {
return $class->new(name => $_);
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Why do they stand out?
They didn’t limit themselves to what Perl can do today
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna
The Corinna
Team
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
field $created :reader { time };
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value ); # add to front
}
method get ($key) {
if ( $cache>exists($key) ) {
my $value = $cache->get($key);
$self->set( $key, $value ); # add to front
return $value;
}
return;
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
How Did We Get Here?
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Ovid’s
Sponsor
• All Around the World
• https://allaroundtheworld.fr/
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Paul Evans’
Sponsors
Sponsor Amount
Oetiker+Partner
AG
1000 CFH
Perl-Verein
Schweiz
3000 CHF
Deriv Ongoing
Anonymous …
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna Team/Influencers/Contributors
(Incomplete list by first name)
• Curtis “Ovid” Poe
• Damian Conway
• Dan Book (Grinnz)
• Graham Knop (haarg)
• Harald Jörg
• Matt Trout
• Paul Evans
• Sawyer X
• Stevan Little
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
History
• March 2006: Stevan Little releases Moose 0.1
• March 2010: Stevan Little releases Moose 1.0
• June 2017: Stevan releases Moxie
• June 2019: Ovid starts working on Corinna (née Cor)
• August 2019: Riga Perl Conference. Sawyer X blows my mind
• October 2019: First public announcement of Corinna
• October 2019: Paul Evans starts work on Object::Pad test bed
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Moxie
package Point {
use Moxie;
extends 'Moxie::Object';
has x => ( default => sub { 0 } );
has y => ( default => sub { 0 } );
sub x : ro;
sub y : ro;
sub clear ($self) {
$self->@{ 'x', 'y' } = (0, 0);
}
}
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
Corinna
class Point {
field ( $x, $y ) :param :reader {0};
method clear () { $x = 0; $y = 0; }
}
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
Pre-History
• Based on Keyword::Declare
• Implementation + Test Suite
• Influenced by Moxie ideals
• Heavily reflected Moose heritage
• Lost when a pipe burst in our house
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Sawyer X Arrives
• 2019 Riga Perl Conference
• Sawyer X tells me to ditch the implementation
• “Design something great.”
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Early
Work
Ovid
class Cache::LRU {
use Hash::Ordered;
has cache => (default => sub { Hash::Ordered->new });
has max_size => (default => sub { 20 });
method set ( $key, $value ) {
if ( self->cache->exists($key) ) {
self->cache->delete($key);
}
elsif ( self->cache->keys > self->max_size ) {
self->cache->shift;
}
self->cache->set( $key, $value );
}
method get ($key) {
if ( self->cache->exists($key) ) {
my $value = self->cache->get($key);
self->set( $key, $value ); # add to front
return $value;
}
return;
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Features
• Cleaner syntax
• self as a keyword
• Methods and subroutines are no longer the same thing
• Encapsulation by default (but my design was bad)
• No declarative way to expose state (another design flaw)
• Lexical variables for state were considered (but I considered them
“unperlish”)
• Paul “LeoNerd” Evans argued for lexical variables for state (he was
right)
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna
The Corinna
Team
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value ); # add to front
}
method get ($key) {
if ( $cache>exists($key) ) {
my $value = $cache->get($key);
$self->set( $key, $value ); # add to front
return $value;
}
return;
}
} 30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Moose
Damnit,
Stevan
package Cache::LRU {
use Moose;
use Hash::Ordered;
use namespace::autoclean;
has '_cache' => (
is => 'ro',
init_arg => undef,
default => sub { Hash::Ordered->new },
);
has 'max_size' => ( is => 'ro', default => 20 );
sub set {
my ( $self, $key, $value ) = @_;
if ( $self->_cache->exists($key) ) {
$self->_cache->delete($key);
}
elsif ( $self->_cache->keys >= $self->max_size ) {
$self->_cache->shift;
}
$self->_cache->set( $key, $value );
}
sub get {
my ( $self, $key ) = @_;
$self->_cache->get($key)
if ( $self->_cache>exists($key) ) {
my $value = $self->_cache->get($key);
$self->set( $key, $value ); # add to front
return $value;
}
}
__PACKAGE__->meta->make_immutable;
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Objections
1. bless is good enough for me
2. Moo/se won. It should be in core
3. Same ideas, different syntax
4. How can I debug encapsulated objects?
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
1. bless is good enough for
me
• We’re not removing bless.
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
2. Moo/se won. It should be in
core
• A popular minority view
• They're great, mature modules, but …
• The authors, Stevan Little (Moose) and Matt Trout (Moo) aren’t arguing
for this
• P5P doesn’t want them
• They’re hobbled by the current limitations of Perl
See also: https://ovid.github.io/articles/why-is-perl-not-putting-
moose-in-the-core.html
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Current Limitations of Perl
• Methods are subroutines
• Classes are packages
• No native state
• No native encapsulation
• No native delegation
• No differentiation between class methods and instance methods
• Classes are not “first-class” types
• … and on and on and on
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
3. Same ideas,
different syntax
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
3. Same
ideas,
different
syntax
• We’ve been explaining the difference for years
• It’s hard to keep explaining, so you point them to
the RFC
• But this is really important, so here goes…
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
Background
• Based on decades of personal OOP experience
• Supported by Stevan Little (creator of Moose)
• Supported by Matt Trout (creator of Moo)
• Supported by Damian Conway (designer of Raku and SPEC OOP
systems)
• Ideas from far too many books, papers, and articles on OOP and
type systems
• Designed to create a “Perlish” OOP system
• Subject to two DMCA takedown notices from an OnlyFans “artist” 30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
237th time’s the
charm!
3. Same ideas, different syntax
Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
Chris “Peregrin” Prather to P5P
• Class composition: “Design Patterns: Elements of Reusable Object-
Oriented Software”, published literally 4 days after Perl 5.000 says
to prefer composition to inheritance.
• Perl’s only native solution to reusable behavior is inheritance.
• Perl has no native solution to encapsulation (there are complex
workarounds)
Source: https://markmail.org/message/pxmkevqe7qg7tld2, June
19, 2021
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Native
composition
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value );
}
…
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Native state
and
composition
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value );
}
…
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Native state,
encapsulation
, and
composition
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
method set ( $key, $value ) {
if ( $cache->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value );
}
…
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Runtime
failures
package Cache::LRU {
use Moose;
use Hash::Ordered;
has '_cache' => (
is => 'ro',
init_arg => undef,
default => sub {Hash::Ordered->new},
);
has 'max_size' => (
is => 'ro',
default => 20,
);
sub set ( $self, $key, $value ) {
if ($self->_cahce->exists($key)) {
$self->_cache->delete($key);
}
…
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Become
Compile-time
failures
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
method set ( $key, $value ) {
if ( $cach->exists($key) ) {
$cache->delete($key);
}
elsif ( $cache->keys > $max_size ) {
$cache->shift;
}
$cache->set( $key, $value );
}
…
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Fields no
longer
exposed
by
default.
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
…
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
init_arg
=> undef
no longer
needed
class Cache::LRU :version(v0.1.0) {
use Hash::Ordered;
field $cache { Hash::Ordered->new };
field $max_size :param :reader { 20 };
…
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Methods
are not
subs
class Some::Class :version(v0.1.0) {
use Some::Module 'set';
method set ( $key, $value ) {
if ( set( … ) ) {
# subroutine called, not the method
}
…
}
…
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Methods
are not
subs
This might not make to the 1st
version.
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
4. Debugging encapsulated
objects
• The MOP will allow encapsulation violation
• It will be harder to do
• Violating encapsulation becomes the last choice, not the first
• Data::Printer, Data::Dumper, the debugger, and other tools
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna is Simple!
Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
Four Little Words
• class
• role
• field
• method
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
blogs.perl.org
• A dream realized
• A dream resyntaxed
• A (not so) simple matter of privacy
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
use feature "class";
• perldoc -f class
• perldoc -f role
• perldoc -f field
• perldoc -f method
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Modifiers
• class My::Class :isa(Other::Class)
• role My::Role :does(Other::Role)
• field $name :param :reader
• method frobnicate :common
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
January 16, 2022
Corinna RFC Accepted
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Accepted with Caveats
• Corinna was not completely accepted
• Smaller, easier to test features, one at a time
• A Minimally Minimum Viable Product (MMVP)
Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
Who?
• Paul Evans—LeoNerd
• Object::Pad
• Future::AsyncAwait
• Syntax::Keyword::Try
• Much more
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
The MMVP Steps
1. Classes
2. Inheritance
3. Roles
4. Field modifiers
5. Field initializer blocks
6. Meta-Object Protocol (MOP)
7. Method modifiers
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Perl Steering Council Meeting 2022-03-11
“Paul let us know that he’s now got a sponsor to cover his
initial Corinna implementation work, and his plan is to
land the first stage at the start of the 5.37 dev cycle.”
https://www.nntp.perl.org/group/perl.perl5.porters/2022/03/msg263374.html
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Timefram
e
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
None
Almost three years of design
(based on years of prototypes)
Make it right, not make it now
Questions?
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
TYPES?
Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
Corinna +
Types!
• Early work had types
• Everybody wants them
• All of the designers said “no”
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
The Problem
with Types
• Variable declarations
• Field declarations
• Subroutine arguments
• Method arguments
• Casting
• … and more ???
Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
The Problem
with Types
• Built-in Types?
• Int, Float, Char, etc.
• User-defined Types?
• Classes
• Subtypes
Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
NO TYPES 😢
Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
But …
Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
IMMUTABLE
OBJECTS
Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
class Name {
field $name :param;
field $title :param { undef };
method name () {
return $title ? "$title $name" : $name;
}
}
30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
Type Library
package Our::Types {
use Less::Boilerplate;
use Type::Library -base;
use Type::Utils -all;
use Type::Params;
our @EXPORT_OK;
BEGIN {
extends qw(
Types::Standard
Types::Common::Numeric
Types::Common::String
);
push @EXPORT_OK => qw/compile compile_named/;
}
}
1;
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/
Corinna +
Types
class Name {
use Our::Types qw(NonEmptyStr Maybe compile);
field $name :param;
field $title :param { undef };
ADJUST {
state $check = compile(NonEmptyStr,Maybe[NonEmptyStr]);
$check->( $name, $title );
}
method name () {
return $title ? "$title $name" : $name;
}
}
30 mars 2022
Copyright 2022, http://www.allaroundtheworld.fr/

More Related Content

Similar to Corinna Status 2022.pptx

Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked aboutacme
 
Midgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsMidgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsHenri Bergius
 
コードの動的生成のお話
コードの動的生成のお話コードの動的生成のお話
コードの動的生成のお話鉄次 尾形
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony TechniquesKris Wallsmith
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntityBasuke Suzuki
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebMikel Torres Ugarte
 
Version Control with Puppet
Version Control with PuppetVersion Control with Puppet
Version Control with PuppetPuppet
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetWalter Heck
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetOlinData
 
Schema design short
Schema design shortSchema design short
Schema design shortMongoDB
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
Mysqlnd Async Ipc2008
Mysqlnd Async Ipc2008Mysqlnd Async Ipc2008
Mysqlnd Async Ipc2008Ulf Wendel
 
Corinna-2023.pptx
Corinna-2023.pptxCorinna-2023.pptx
Corinna-2023.pptxCurtis Poe
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony AppsKris Wallsmith
 
Lecture 17 - PHP-Object-Orientation.pptx
Lecture 17 - PHP-Object-Orientation.pptxLecture 17 - PHP-Object-Orientation.pptx
Lecture 17 - PHP-Object-Orientation.pptxDavidLazar17
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2Elizabeth Smith
 

Similar to Corinna Status 2022.pptx (20)

Ten modules I haven't yet talked about
Ten modules I haven't yet talked aboutTen modules I haven't yet talked about
Ten modules I haven't yet talked about
 
Midgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applicationsMidgard2 - Content Repository for mobile applications
Midgard2 - Content Repository for mobile applications
 
コードの動的生成のお話
コードの動的生成のお話コードの動的生成のお話
コードの動的生成のお話
 
Os Davis
Os DavisOs Davis
Os Davis
 
jQuery Loves You
jQuery Loves YoujQuery Loves You
jQuery Loves You
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Introducing CakeEntity
Introducing CakeEntityIntroducing CakeEntity
Introducing CakeEntity
 
Charla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo WebCharla EHU Noviembre 2014 - Desarrollo Web
Charla EHU Noviembre 2014 - Desarrollo Web
 
Version Control with Puppet
Version Control with PuppetVersion Control with Puppet
Version Control with Puppet
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Lithium Best
Lithium Best Lithium Best
Lithium Best
 
Schema design short
Schema design shortSchema design short
Schema design short
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
Augeas @RMLL 2012
Augeas @RMLL 2012Augeas @RMLL 2012
Augeas @RMLL 2012
 
Mysqlnd Async Ipc2008
Mysqlnd Async Ipc2008Mysqlnd Async Ipc2008
Mysqlnd Async Ipc2008
 
Corinna-2023.pptx
Corinna-2023.pptxCorinna-2023.pptx
Corinna-2023.pptx
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Lecture 17 - PHP-Object-Orientation.pptx
Lecture 17 - PHP-Object-Orientation.pptxLecture 17 - PHP-Object-Orientation.pptx
Lecture 17 - PHP-Object-Orientation.pptx
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
 

More from Curtis Poe

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
life-off-earth.pptx
life-off-earth.pptxlife-off-earth.pptx
life-off-earth.pptxCurtis Poe
 
Rescuing a-legacy-codebase
Rescuing a-legacy-codebaseRescuing a-legacy-codebase
Rescuing a-legacy-codebaseCurtis Poe
 
Perl 6 For Mere Mortals
Perl 6 For Mere MortalsPerl 6 For Mere Mortals
Perl 6 For Mere MortalsCurtis Poe
 
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteDisappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteCurtis Poe
 
How to Fake a Database Design
How to Fake a Database DesignHow to Fake a Database Design
How to Fake a Database DesignCurtis Poe
 
Are Managers An Endangered Species?
Are Managers An Endangered Species?Are Managers An Endangered Species?
Are Managers An Endangered Species?Curtis Poe
 
The Lies We Tell About Software Testing
The Lies We Tell About Software TestingThe Lies We Tell About Software Testing
The Lies We Tell About Software TestingCurtis Poe
 
A/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youA/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youCurtis Poe
 
Test::Class::Moose
Test::Class::MooseTest::Class::Moose
Test::Class::MooseCurtis Poe
 
A Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassA Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassCurtis Poe
 
Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Curtis Poe
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::ClassCurtis Poe
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in PerlCurtis Poe
 
Inheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionInheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionCurtis Poe
 
Inheritance Versus Roles
Inheritance Versus RolesInheritance Versus Roles
Inheritance Versus RolesCurtis Poe
 
Turbo Charged Test Suites
Turbo Charged Test SuitesTurbo Charged Test Suites
Turbo Charged Test SuitesCurtis Poe
 

More from Curtis Poe (18)

How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
life-off-earth.pptx
life-off-earth.pptxlife-off-earth.pptx
life-off-earth.pptx
 
Rescuing a-legacy-codebase
Rescuing a-legacy-codebaseRescuing a-legacy-codebase
Rescuing a-legacy-codebase
 
Perl 6 For Mere Mortals
Perl 6 For Mere MortalsPerl 6 For Mere Mortals
Perl 6 For Mere Mortals
 
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, KeynoteDisappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
Disappearing Managers, YAPC::EU 2014, Bulgaria, Keynote
 
How to Fake a Database Design
How to Fake a Database DesignHow to Fake a Database Design
How to Fake a Database Design
 
Are Managers An Endangered Species?
Are Managers An Endangered Species?Are Managers An Endangered Species?
Are Managers An Endangered Species?
 
The Lies We Tell About Software Testing
The Lies We Tell About Software TestingThe Lies We Tell About Software Testing
The Lies We Tell About Software Testing
 
A/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell youA/B Testing - What your mother didn't tell you
A/B Testing - What your mother didn't tell you
 
Test::Class::Moose
Test::Class::MooseTest::Class::Moose
Test::Class::Moose
 
A Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::ClassA Whirlwind Tour of Test::Class
A Whirlwind Tour of Test::Class
 
Agile Companies Go P.O.P.
Agile Companies Go P.O.P.Agile Companies Go P.O.P.
Agile Companies Go P.O.P.
 
Econ101
Econ101Econ101
Econ101
 
Testing With Test::Class
Testing With Test::ClassTesting With Test::Class
Testing With Test::Class
 
Logic Progamming in Perl
Logic Progamming in PerlLogic Progamming in Perl
Logic Progamming in Perl
 
Inheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth VersionInheritance Versus Roles - The In-Depth Version
Inheritance Versus Roles - The In-Depth Version
 
Inheritance Versus Roles
Inheritance Versus RolesInheritance Versus Roles
Inheritance Versus Roles
 
Turbo Charged Test Suites
Turbo Charged Test SuitesTurbo Charged Test Suites
Turbo Charged Test Suites
 

Recently uploaded

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 

Recently uploaded (20)

Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 

Corinna Status 2022.pptx

  • 1. Corinna Status Update Modern OOP is coming to Perl Curtis “Ovid” Poe https://allaroundtheworld.fr/ https://ovid.github.io/ 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 2. Question Policy • Please hold them to the end • Unless something is completely incomprehensible 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 3. Dedication David Adler Jeff Goff 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/ Sparky
  • 4. What is Corinna? https://github.com/Ovid/Cor (This talk is not a tutorial on Corinna) 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 5. The Lisp Curse 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 6. The Lisp Perl Curse (edited) Since making Perl object systems is not hard, many Perl hackers have done so. More to the point, many individual Perl hackers have done so. Programs written by individual hackers tend to follow the scratch-an-itch model. These programs will solve the problem that the hacker is having without necessarily making the software more useful to others. This means that these one-man-band projects tend to solve eighty-percent of the problem. 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 7. Perl Core OOP (Today) • bless • @ISA 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 8. Perl Core OOP (Today) • bless–We have methods! • @ISA–Where are the methods? 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 9. Perl Core OOP (Today) • bless–We have methods subroutines! • @ISA–Where are the methods subroutines? 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 10. Perl Core OOP (Today) package Name; sub new { my ( $class, %arg_for ) = @_; return bless { name => $arg_for{name}, title => $arg_for{title}, }, $class; } sub _title { $_[0]->{tilte} } sub _name { $_[0]->{name} } sub name { my $self = shift; my $title = $self->_title; my $name = $self->_name; return $title ? "$title $name" : $name; } 1; 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 11. Perl Core OOP (Today) my $ovid = Name->new( name => 'Ovid' ); my $doctor = Name->new( title => 'Dr.', name => 'Who', ); say $ovid->name; # Ovid say $doctor->name; # Dr. Who 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 12. Perl Core OOP (Today) package Name; sub new { my ( $class, %arg_for ) = @_; return bless { name => $arg_for{name}, title => $arg_for{title}, }, $class; } sub _title { $_[0]->{tilte} } sub _name { $_[0]->{name} } sub name { my $self = shift; my $title = $self->_title; my $name = $self->_name; return $title ? "$title $name" : $name; } 1; 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 13. Corinna class Name { field $name :param; field $title :param { undef }; method name () { return $title ? "$title $name" : $name; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 14. Perl Core OOPS package Name; sub new { my ( $class, %arg_for ) = @_; return bless { name => $arg_for{name}, title => $arg_for{title}, }, $class; } sub _title { $_[0]->{tilte} } sub _name { $_[0]->{name} } sub name { my $self = shift; my $title = $self->_title; my $name = $self->_name; return $title ? "$title $name" : $name; } 1; 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 15. Corinna class Name { field $name :param; field $title :param { undef }; method name () { return $Title ? "$tilte $name" : $name; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 16. 80+ OOP systems on the CPAN Mo Mu Mic Moo Mew Dios Moose Moops Moxie reform Spiffy Zydeco HO::Class Class::LOP Evo::Class Class::Dot Class::Ref Class::Std Mojo::Base Eixo::Base Class::Root Class::Easy Class::Core Class::Base Class::Lite Class::Lego Class::GAPI Class::Slot Class::Tiny Class::Gomor Class::Field Rose::Object Class::Maker Class::HPLOO Class::Frame Class::Class Class::Simple Class::Attrib Class::Closure Class::Methods Class::Builder Class::Declare Class::Accessor Class::Contract Class::Generate Class::InsideOut Acme::Class::Std Class::Anonymous Class::Classless Class::Std::Fast Class::Framework Class::Autoclass Class::Methodist Bubblegum::Class Object::LocalVars Object::InsideOut Class::AutoAccess Class::Prototyped Class::Structured Class::NamedParms Class::Constructor AI::FreeHAL::Class Class::BuildMethods Lexical::Attributes Class::AccessorMaker Class::IntrospectionMe thods Class::MakeMethods::Te mplate::InsideOut 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 17. Dios Damian Conway class Identity is Trackable { shared Num %!allocated_IDs; shared Num $.prev_ID is rw; func _allocate_ID() { while (1) { lex Num $ID = rand; return $prev_ID =$ID if !$allocated_IDs{$ID}++; } } has Num $.ID = _allocate_ID(); has Str $.name //= '<anonymous>'; has Passwd $!passwd; method identify (Str $pwd --> Str) { return "$name [$ID]" if $pwd eq $passwd; } submethod DESTROY { say "Bye, $name!"; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 18. Zydeco Toby Inkster class Person { has name ( type => Str, required => true ); has gender ( type => Str ); factory new_man (Str $name) { return $class->new(name => $name, gender => 'male'); } factory new_woman (Str $name) { return $class->new(name => $name, gender => 'female'); } method greet (Person *friend, Str *greeting = "Hello") { printf("%s, %s!n", $arg->greeting, $arg->friend->name); } coerce from Str via from_string { return $class->new(name => $_); } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 19. Why do they stand out? They didn’t limit themselves to what Perl can do today 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 20. Corinna The Corinna Team class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; field $created :reader { time }; method set ( $key, $value ) { if ( $cache->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); # add to front } method get ($key) { if ( $cache>exists($key) ) { my $value = $cache->get($key); $self->set( $key, $value ); # add to front return $value; } return; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 21. How Did We Get Here? 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 22. Ovid’s Sponsor • All Around the World • https://allaroundtheworld.fr/ 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 23. Paul Evans’ Sponsors Sponsor Amount Oetiker+Partner AG 1000 CFH Perl-Verein Schweiz 3000 CHF Deriv Ongoing Anonymous … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 24. Corinna Team/Influencers/Contributors (Incomplete list by first name) • Curtis “Ovid” Poe • Damian Conway • Dan Book (Grinnz) • Graham Knop (haarg) • Harald Jörg • Matt Trout • Paul Evans • Sawyer X • Stevan Little 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 25. History • March 2006: Stevan Little releases Moose 0.1 • March 2010: Stevan Little releases Moose 1.0 • June 2017: Stevan releases Moxie • June 2019: Ovid starts working on Corinna (née Cor) • August 2019: Riga Perl Conference. Sawyer X blows my mind • October 2019: First public announcement of Corinna • October 2019: Paul Evans starts work on Object::Pad test bed 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 26. Moxie package Point { use Moxie; extends 'Moxie::Object'; has x => ( default => sub { 0 } ); has y => ( default => sub { 0 } ); sub x : ro; sub y : ro; sub clear ($self) { $self->@{ 'x', 'y' } = (0, 0); } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 27. Corinna class Point { field ( $x, $y ) :param :reader {0}; method clear () { $x = 0; $y = 0; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 28. Pre-History • Based on Keyword::Declare • Implementation + Test Suite • Influenced by Moxie ideals • Heavily reflected Moose heritage • Lost when a pipe burst in our house 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 29. Sawyer X Arrives • 2019 Riga Perl Conference • Sawyer X tells me to ditch the implementation • “Design something great.” 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 30. Early Work Ovid class Cache::LRU { use Hash::Ordered; has cache => (default => sub { Hash::Ordered->new }); has max_size => (default => sub { 20 }); method set ( $key, $value ) { if ( self->cache->exists($key) ) { self->cache->delete($key); } elsif ( self->cache->keys > self->max_size ) { self->cache->shift; } self->cache->set( $key, $value ); } method get ($key) { if ( self->cache->exists($key) ) { my $value = self->cache->get($key); self->set( $key, $value ); # add to front return $value; } return; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 31. Features • Cleaner syntax • self as a keyword • Methods and subroutines are no longer the same thing • Encapsulation by default (but my design was bad) • No declarative way to expose state (another design flaw) • Lexical variables for state were considered (but I considered them “unperlish”) • Paul “LeoNerd” Evans argued for lexical variables for state (he was right) 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 32. Corinna The Corinna Team class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; method set ( $key, $value ) { if ( $cache->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); # add to front } method get ($key) { if ( $cache>exists($key) ) { my $value = $cache->get($key); $self->set( $key, $value ); # add to front return $value; } return; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 33. Moose Damnit, Stevan package Cache::LRU { use Moose; use Hash::Ordered; use namespace::autoclean; has '_cache' => ( is => 'ro', init_arg => undef, default => sub { Hash::Ordered->new }, ); has 'max_size' => ( is => 'ro', default => 20 ); sub set { my ( $self, $key, $value ) = @_; if ( $self->_cache->exists($key) ) { $self->_cache->delete($key); } elsif ( $self->_cache->keys >= $self->max_size ) { $self->_cache->shift; } $self->_cache->set( $key, $value ); } sub get { my ( $self, $key ) = @_; $self->_cache->get($key) if ( $self->_cache>exists($key) ) { my $value = $self->_cache->get($key); $self->set( $key, $value ); # add to front return $value; } } __PACKAGE__->meta->make_immutable; } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 34. Objections 1. bless is good enough for me 2. Moo/se won. It should be in core 3. Same ideas, different syntax 4. How can I debug encapsulated objects? 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 35. 1. bless is good enough for me • We’re not removing bless. 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 36. 2. Moo/se won. It should be in core • A popular minority view • They're great, mature modules, but … • The authors, Stevan Little (Moose) and Matt Trout (Moo) aren’t arguing for this • P5P doesn’t want them • They’re hobbled by the current limitations of Perl See also: https://ovid.github.io/articles/why-is-perl-not-putting- moose-in-the-core.html 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 37. Current Limitations of Perl • Methods are subroutines • Classes are packages • No native state • No native encapsulation • No native delegation • No differentiation between class methods and instance methods • Classes are not “first-class” types • … and on and on and on 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 38. 3. Same ideas, different syntax 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 39. 3. Same ideas, different syntax • We’ve been explaining the difference for years • It’s hard to keep explaining, so you point them to the RFC • But this is really important, so here goes… 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 40. Background • Based on decades of personal OOP experience • Supported by Stevan Little (creator of Moose) • Supported by Matt Trout (creator of Moo) • Supported by Damian Conway (designer of Raku and SPEC OOP systems) • Ideas from far too many books, papers, and articles on OOP and type systems • Designed to create a “Perlish” OOP system • Subject to two DMCA takedown notices from an OnlyFans “artist” 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 41. 237th time’s the charm! 3. Same ideas, different syntax Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
  • 42. Chris “Peregrin” Prather to P5P • Class composition: “Design Patterns: Elements of Reusable Object- Oriented Software”, published literally 4 days after Perl 5.000 says to prefer composition to inheritance. • Perl’s only native solution to reusable behavior is inheritance. • Perl has no native solution to encapsulation (there are complex workarounds) Source: https://markmail.org/message/pxmkevqe7qg7tld2, June 19, 2021 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 43. Native composition class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; method set ( $key, $value ) { if ( $cache->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); } … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 44. Native state and composition class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; method set ( $key, $value ) { if ( $cache->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); } … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 45. Native state, encapsulation , and composition class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; method set ( $key, $value ) { if ( $cache->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); } … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 46. Runtime failures package Cache::LRU { use Moose; use Hash::Ordered; has '_cache' => ( is => 'ro', init_arg => undef, default => sub {Hash::Ordered->new}, ); has 'max_size' => ( is => 'ro', default => 20, ); sub set ( $self, $key, $value ) { if ($self->_cahce->exists($key)) { $self->_cache->delete($key); } … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 47. Become Compile-time failures class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; method set ( $key, $value ) { if ( $cach->exists($key) ) { $cache->delete($key); } elsif ( $cache->keys > $max_size ) { $cache->shift; } $cache->set( $key, $value ); } … 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 48. Fields no longer exposed by default. class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; … } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 49. init_arg => undef no longer needed class Cache::LRU :version(v0.1.0) { use Hash::Ordered; field $cache { Hash::Ordered->new }; field $max_size :param :reader { 20 }; … } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 50. Methods are not subs class Some::Class :version(v0.1.0) { use Some::Module 'set'; method set ( $key, $value ) { if ( set( … ) ) { # subroutine called, not the method } … } … } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 51. Methods are not subs This might not make to the 1st version. 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 52. 4. Debugging encapsulated objects • The MOP will allow encapsulation violation • It will be harder to do • Violating encapsulation becomes the last choice, not the first • Data::Printer, Data::Dumper, the debugger, and other tools 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 53. Corinna is Simple! Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
  • 54. Four Little Words • class • role • field • method 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 55. blogs.perl.org • A dream realized • A dream resyntaxed • A (not so) simple matter of privacy 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 56. use feature "class"; • perldoc -f class • perldoc -f role • perldoc -f field • perldoc -f method 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 57. Modifiers • class My::Class :isa(Other::Class) • role My::Role :does(Other::Role) • field $name :param :reader • method frobnicate :common 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 58. January 16, 2022 Corinna RFC Accepted 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 59. Accepted with Caveats • Corinna was not completely accepted • Smaller, easier to test features, one at a time • A Minimally Minimum Viable Product (MMVP) Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
  • 60. Who? • Paul Evans—LeoNerd • Object::Pad • Future::AsyncAwait • Syntax::Keyword::Try • Much more 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 61. The MMVP Steps 1. Classes 2. Inheritance 3. Roles 4. Field modifiers 5. Field initializer blocks 6. Meta-Object Protocol (MOP) 7. Method modifiers 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 62. Perl Steering Council Meeting 2022-03-11 “Paul let us know that he’s now got a sponsor to cover his initial Corinna implementation work, and his plan is to land the first stage at the start of the 5.37 dev cycle.” https://www.nntp.perl.org/group/perl.perl5.porters/2022/03/msg263374.html 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 63. Timefram e 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/ None Almost three years of design (based on years of prototypes) Make it right, not make it now
  • 64. Questions? 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 66. Corinna + Types! • Early work had types • Everybody wants them • All of the designers said “no” 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 67. The Problem with Types • Variable declarations • Field declarations • Subroutine arguments • Method arguments • Casting • … and more ??? Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
  • 68. The Problem with Types • Built-in Types? • Int, Float, Char, etc. • User-defined Types? • Classes • Subtypes Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
  • 69. NO TYPES 😢 Copyright 2022, http://www.allaroundtheworld.fr/ March 30, 2022
  • 70. But … Copyright 2022, http://www.allaroundtheworld.fr/ 30 mars 2022
  • 72. class Name { field $name :param; field $title :param { undef }; method name () { return $title ? "$title $name" : $name; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 73. Type Library package Our::Types { use Less::Boilerplate; use Type::Library -base; use Type::Utils -all; use Type::Params; our @EXPORT_OK; BEGIN { extends qw( Types::Standard Types::Common::Numeric Types::Common::String ); push @EXPORT_OK => qw/compile compile_named/; } } 1; 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/
  • 74. Corinna + Types class Name { use Our::Types qw(NonEmptyStr Maybe compile); field $name :param; field $title :param { undef }; ADJUST { state $check = compile(NonEmptyStr,Maybe[NonEmptyStr]); $check->( $name, $title ); } method name () { return $title ? "$title $name" : $name; } } 30 mars 2022 Copyright 2022, http://www.allaroundtheworld.fr/

Editor's Notes

  1. Apologies, I must leave tomorrow (scheduling conflict)
  2. Confession: my first versions of Corinna had the same flaw.
  3. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  4. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  5. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  6. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  7. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  8. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  9. Offers modern OO facilites *and* is uses UNIVERSAL::Object for newer OO frameworks to be built on top of it!
  10. Instead of my coding limitations, I would be limited by my imagination
  11. Same ideas, different syntax: not offering anything new
  12. These are many positive side-effects emerging from one simple design change.
  13. These are many positive side-effects emerging from one simple design change.
  14. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,
  15. Most OOP systems in Perl are built on top of this. No built-in notion of state or encapsulation,