This document provides updates on the status of Corinna, Perl's new object system. It discusses the seven stages of Corinna's development, including that classes and inheritance are complete. It provides an example of a Cache class written using Corinna syntax. The document notes that Corinna will introduce new programming idioms that developers do not yet know. It also references resources for learning to build a roguelike game in Perl.
2. All Around the World
Curtis “Ovid” Poe
https://allaroundtheworld.fr/
https://fosstodon.org/@ovid
https://bsky.app/profile/ovid.bsky.social
https://twitter.com/OvidPerl
ovid@allroundtheworld.fr
curtis.poe@gmail.com
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
8. Perl’s Lambda
my @fs = map { my $i = $_; sub ($arg) { $i + $arg } } 0 .. 9;
say $fs[3](4);
# 7
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
9. Python’s Lambda
fs = [(lambda n: i + n) for i in range(10)]
print(fs[3](4))
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
10. Python’s Lambda
fs = [(lambda n: i + n) for i in range(10)]
print(fs[3](4))
# 13
https://math.andrej.com/2009/04/09/pythons-lambda-is-broken/
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
11. Python’s Lambda
fs = [(lambda n, i=i: i + n) for i in range(10)]
print(fs[3](4))
# 7
https://math.andrej.com/2009/04/09/pythons-lambda-is-broken/
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
12. Perl’s Lambda
my @fs = map { sub ($arg) { $arg + $_ } } 0 .. 9;
say $fs[3](4);
# Use of uninitialized value $_ in addition (+) at …
# 4
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
13. Reversing a List in Prolog
reverse([],[]).
reverse([Head|Tail],Reversed) :-
reverse(Tail,ReversedTail),
append(ReversedTail,[Head],Reversed).
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
14. Reversing a List in Prolog—O(n2)
reverse([],[]).
reverse([Head|Tail],Reversed) :-
reverse(Tail,ReversedTail),
append(ReversedTail,[Head],Reversed).
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
15. Reversing a List in Prolog—O(n)
accRev([],Accumulator,Accumulator).
accRev([Head|Tail],Accumulator,Reversed):-
accRev(Tail,[Head|Accumulator],Reversed).
reverse(List,Reversed) :- accRev(List,[],Reversed).
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
16. HelloPain.java
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame("Hello, Verbosity!");
JLabel lblText = new JLabel("Hello World!", SwingConstants.CENTER);
frame.setMinimumSize(new Dimension(800, 400));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.getContentPane().add(lblText);
frame.pack();
frame.setVisible(true);
}
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
17. HelloPain.java
public class HelloWorld {
public static void main(String[] args) {
JFrame frame = new JFrame("Hello, Verbosity!");
JLabel lblText = new JLabel("Hello World!", SwingConstants.CENTER);
frame.setMinimumSize(new Dimension(800, 400))
.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
.getContentPane().add(lblText);
frame.pack()
.setVisible(true);
}
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
18. HelloPain.java
I called this SwingChains
It actually worked
It actually was stupid
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
20. Before try/catch
sub do_it {
my ($args) = @_;
my $result;
eval { $result = might_die($args) };
if ($@) { ... }; # wrong
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
21. Before try/catch
sub do_it {
my ($args) = @_;
my $result;
eval { $result = might_die($args); 1 } or do { ... };
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
22. try/catch
use Try::Tiny;
sub do_it($args) {
my $result;
try { $result = might_die($args) }
catch { ... }; <--- ARGH!
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
23. We replaced …
sub do_it {
my ($args) = @_;
my $result;
eval { $result = might_die($args); 1 } or do { ... };
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
24. Try::Tiny versus …
package Try::Tiny; use 5.006; our $VERSION = '0.31'; use strict; use warnings; use Exporter 5.57 'import'; our @EXPORT =
our @EXPORT_OK = qw(try catch finally); use Carp; $Carp::Internal{+__PACKAGE__}++; BEGIN { my $su = $INC{'Sub/Util.pm'}
&& defined &Sub::Util::set_subname; my $sn = $INC{'Sub/Name.pm'} && eval { Sub::Name->VERSION(0.08) }; unless ($su ||
$sn) { $su = eval { require Sub::Util; } && defined &Sub::Util::set_subname; unless ($su) { $sn = eval { require
Sub::Name; Sub::Name->VERSION(0.08) }; } } *_subname = $su ? &Sub::Util::set_subname : $sn ? &Sub::Name::subname : sub
{ $_[1] }; *_HAS_SUBNAME = ($su || $sn) ? sub(){1} : sub(){0}; } my %_finally_guards; sub try (&;@) { my ( $try,
@code_refs ) = @_; my $wantarray = wantarray; my ( $catch, @finally ) = (); foreach my $code_ref (@code_refs) { if (
ref($code_ref) eq 'Try::Tiny::Catch' ) { croak 'A try() may not be followed by multiple catch() blocks' if $catch;
$catch = ${$code_ref}; } elsif ( ref($code_ref) eq 'Try::Tiny::Finally' ) { push @finally, ${$code_ref}; } else { croak(
'try() encountered an unexpected argument (' . ( defined $code_ref ? $code_ref : 'undef' ) . ') - perhaps a missing
semi-colon before or'); } } _subname(caller().'::try {...} ' => $try) if _HAS_SUBNAME; local $_finally_guards{guards} =
[ map Try::Tiny::ScopeGuard->_new($_), @finally ]; my $prev_error = $@; my ( @ret, $error ); my $failed = not eval { $@
= $prev_error; if ( $wantarray ) { @ret = $try->(); } elsif ( defined $wantarray ) { $ret[0] = $try->(); } else {
$try->(); }; return 1; }; $error = $@; $@ = $prev_error; if ( $failed ) { push @$_, $error for
@{$_finally_guards{guards}}; if ( $catch ) { for ($error) { return $catch->($error); } } return; } else { return
$wantarray ? @ret : $ret[0]; } } sub catch (&;@) { my ( $block, @rest ) = @_; croak 'Useless bare catch()' unless
wantarray; _subname(caller().'::catch {...} ' => $block) if _HAS_SUBNAME; return ( bless($block, 'Try::Tiny::Catch'),
@rest,); } sub finally (&;@) { my ( $block, @rest ) = @_; croak 'Useless bare finally()' unless wantarray;
_subname(caller().'::finally {...} ' => $block) if _HAS_SUBNAME; return ( bless($block, 'Try::Tiny::Finally'), @rest,);
} { package Try::Tiny::ScopeGuard; use constant UNSTABLE_DOLLARAT => ("$]" < '5.013002') ? 1 : 0; sub _new { shift;
bless [ @_ ]; } sub DESTROY { my ($code, @args) = @{ $_[0] }; local $@ if UNSTABLE_DOLLARAT; eval { $code->(@args); 1; }
or do { warn "Execution of finally() block $code resulted in an exception, which " . '*CAN NOT BE PROPAGATED* due to
fundamental limitations of Perl. ' . 'Your program will continue as if this event never took place. ' . "Original
exception text follows:nn" . (defined $@ ? $@ : '$@ left undefined...') . "n" ; } } }
eval { ... }
or do { ... };
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
25. Try::Tiny issues
Can’t return from inside the code blocks
Clumsy to step into the code blocks
Forgetting the trailing semicolon
Error line number often misleading
Slow!
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
26. Try::Tiny issues
Can’t return from inside the code blocks
Clumsy to step into the code blocks
Forgetting the trailing semicolon
Error line number often misleading
Slow!
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
IT WAS EASIER
TO GET THE
CORRECT
BEHAVIOR
27. try/catch
use Try::Tiny;
sub do_it($args) {
my $result;
try { $result = might_die($args) }
catch { ... };
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
28. try/catch
use Feature::Compat::Try; # v5.14.0 and above
sub do_it($args) {
my $result;
try { $result = might_die($args) }
catch ($error) { ... }
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
29. try/catch
use Feature::Compat::Try; # v5.14.0 and above
sub do_it($args) {
my $result;
try { $result = might_die($args) }
catch ($error) { ... }
return $result;
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
30. try/catch
sub do_it($args) {
try { return might_die($args) }
catch ($error) { ... }
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
31. try/catch
sub do_it($args) {
try { return might_die($args) }
catch ($error) { ... }
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
32. Go With The Flow
•Not about verbosity
•It’s about correctness
•Using a language/tool’s strengths
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
34. Corinna
Bringing modern OOP to Perl
Largest change to the language in three decades
Being implemented in the core now
leonerd++
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
35. Corinna Team/Influencers
(Incomplete list by first name)
Curtis “Ovid” Poe
Damian Conway
Dan Book
Graham Knop
Harald Jörg
Matt Trout
Paul Evans
Sawyer X
Stevan Little
13 août 2023 COPYRIGHT 2022, HTTP://WWW.ALLAROUNDTHEWORLD.FR/
36. Corinna Today
class Cache::LRU {
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param = 20;
method exists ($key) {
return $cache->exists($value);
}
method set ( $key, $value ) {
$cache->unshift( $key, $value );
if ( $cache->keys >= $max_size ) {
$cache->pop;
}
}
method get($key) {
return unless $cache->exists($key);
my $value = $cache->get($key);
$self->set( $key, $value );
return $value;
}
}
Sanity-checking removed to reduce
code size.
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
37. Instead of …
1. bless
2. @ISA
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
41. KIM Grammar
KEYWORD IDENTIFIER MODIFIERS? SETUP?
class Cache::LRU {
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param = 20;
…
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
42. KIM Grammar
KEYWORD IDENTIFIER MODIFIERS? SETUP?
class Cache::LRU {
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param = 20;
…
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
43. KIM Grammar
KEYWORD IDENTIFIER MODIFIERS? SETUP?
class Cache::LRU {
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param = 20;
…
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
44. KIM Grammar
KEYWORD IDENTIFIER MODIFIERS? SETUP?
class Cache::LRU {
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param = 20;
…
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
45. The Seven
Stages
Perl v5.38.0
July 3rd, 2023
1.Classes (done)
2.Inheritance (done)
3.Roles
4.Convenience attributes*
5.Field initializer blocks (done)
6.MOP
7.Method modifiers
https://github.com/Ovid/Cor/blob/master/rfc/mvp.md
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
46. The Seven
Stages
Perl v5.38.0
July 3rd, 2023
We’re going to learn new idioms
We don’t (yet) know what they are
It’s going to be challenging
https://github.com/Ovid/Cor/blob/master/rfc/mvp.md
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
48. Chris Prather—Rogue
Setup — https://chris.prather.org/perl-roguelike-part-0.html
Movement — https://chris.prather.org/perl-roguelike-part-1.html
Entities and Obstacles — https://chris.prather.org/perl-roguelike-part-2.html
Generative Dungeon — https://chris.prather.org/perl-roguelike-part-3.html
Field of View — https://chris.prather.org/perl-roguelike-part-4.html
Enemies — https://chris.prather.org/perl-roguelike-part-5.html
Combat — https://chris.prather.org/perl-roguelike-part-6.html
And more!
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
49. Nice, clean code
class MeleeAttackAction :isa(Action) {
use Games::Dice qw(roll);
field $defender :param;
method perform() {
my $attacker = $self->entity;
my $attack_roll = roll('1d20') + $attacker->stats->attack;
my $defense_roll = roll('1d20') + $defender->stats->armor;
if ( $attack_roll > $defense_roll ) {
$defender->stats->change_hp($defense_roll - $attack_roll);
}
return;
}
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
50. Stevan Little-Actor
Event Loop Orchestra — https://github.com/stevan/ELO
Porting to Corinna — https://github.com/stevan/Stella
All in One Gist —
https://gist.github.com/stevan/06a091d8ce775181e8c023864
beba173
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
51. Nice, clean code
class PingPong :isa(Stella::Actor) {
use Stella::Util::Debug; # import LOG_LEVEL, INFO, WARN, etc.
field $name :param; # so I can identify myself in the logs
field $max :param; # the max number of ping/pong(s) to allow
# counters for ping/pong(s)
field $pings = 0;
field $pongs = 0;
field $logger;
ADJUST {
# create a logger if logging is enabled
$logger = Stella::Util::Debug->logger if LOG_LEVEL;
}
method Ping ($ctx, $message) {
if ($pings < $max) {
...
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
52. Nice, clean code
sub init ($ctx) {
# spawn 10 sets of Ping/Pong actors
foreach my $i ( 1 .. 10 ) {
# give them a random max-pings
my $max = int(rand(10));
my $Ping = $ctx->spawn( PingPong->new( name => "Ping($i)", max => $max ) );
my $Pong = $ctx->spawn( PingPong->new( name => "Pong($i)", max => $max ) );
# start up this pair ...
$Ping->send( $Pong, Stella::Event->new( symbol => *PingPong::Pong ) );
}
}
Stella::ActorSystem->new( init => &init )->loop;
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
53. Principle of Parsimony
We made mistakes
We don’t know what they are
We had to be conservative
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
55. Your Data is Not Yours
GDPR
PII
PCI-Compliance
“Right to be forgotten”
Numerous US state-level laws
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
56. Costs
Development—How much does it cost to remove your data?
Personnel—How many more people do you need to manage
that data?
Reputation—If you get it wrong, people get mad
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
60. Lattice-based
Cryptography
Developed in1996 by Miklós Ajtai
Cannot be decrypted quantum computers
2006, Craig Gentry, homomorphic encryption
This is not how he did it
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
69. Perl 8 WHAT’S NEXT?
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
70. What do we want?
Concurrency
Multisubs/methods
Metaprogramming
Applications
Core Exceptions
Core Stack Traces
Graphics/GUIs
Data Types
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
71. What do we want?
Concurrency
Multisubs/methods
Metaprogramming
Applications***
Exceptions
Core Stack Traces
Graphics/GUIs
Data Types ← ← ← ← ← ← ←
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
72. perldoc –f my
my VARLIST
my TYPE VARLIST
my VARLIST : ATTRS
my TYPE VARLIST : ATTRS
A "my" declares the listed variables to be
local (lexically) to the enclosing block,
file, or "eval". If more than one variable
is listed, the list must be placed in …
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
74. Yes, please!
my INT @array = (4,5,6);
$array[1] = "foo"; # BOOM!
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
75. Cache::LRU
class Cache::LRU { # this example is NAÏVE!
use Hash::Ordered;
field $cache = Hash::Ordered->new;
field $max_size :param :reader = 20;
method set( $key, $value ) {
$cache->unshift( $key, $value );
if ( $cache->keys > $max_size ) {
$cache->pop;
}
}
method get($key) {
return unless $cache->exists($key);
my $value = $cache->get($key);
$self->set( $key, $value );
return $value;
}
}
No data control
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
76. Cache::LRU
package Cache::LRU;
use Hash::Ordered;
sub new ( $class, $max_size ) {
bless {
cache => Hash::Ordered->new,
max_size => $max_size,
} => $class;
}
sub _cache ($self) { $self->{cache} }
sub max_size ($self) { $self->{max_size} }
sub set ( $self, $key, $value ) {
$self->_cache->unshift( $key, $value );
if ( $self->_cache->keys > $self->max_size ) {
$self->_cache->pop;
}
}
sub get ( $self, $key ) {
return unless $self->_cache->exists($key);
my $value = $self->_cache->get($key);
$self->set( $key, $value );
return $value;
}
No data control
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
77. Oops
What if we pass a reference for $max_size? if ($num_keys > $max_size) {...}
$cache->set( %value, $key ) silently succeeds.
$cache->get( %value ) fails for the wrong reasons
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
78. Boundaries
Fixed by checking your data.
You would never write code like that.
What about the people who use your code?
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
79. Cache::LRU
package Cache::LRU;
use Hash::Ordered;
sub new ( $class, $max_size ) {
bless {
cache => Hash::Ordered->new,
max_size => $max_size,
} => $class;
}
sub _cache ($self) { $self->{cache} }
sub max_size ($self) { $self->{max_size} }
sub set ( $self, $key, $value ) {
$self->_cache->unshift( $key, $value );
if ( $self->_cache->keys > $self->max_size ) {
$self->_cache->pop;
}
}
sub get ( $self, $key ) {
return unless $self->_cache->exists($key);
my $value = $self->_cache->get($key);
$self->set( $key, $value );
return $value;
}
No data control
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
80. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, UINT $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) UINT { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU] | VOID
{
...
}
sub get(OBJ[Cache::LRU] $self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
81. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, UINT $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) UINT { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU] | VOID
{
...
}
sub get(OBJ[Cache::LRU] $self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
82. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, PosInt $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) UINT { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU] | VOID
{
...
}
sub get(OBJ[Cache::LRU] $self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
83. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, UINT $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) UINT { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU] | VOID
{
...
}
sub get(OBJ[Cache::LRU] $self, SRE $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
84. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, PosInt $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) PosInt { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU]|void
{
...
}
sub get(OBJ[Cache::LRU] $self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
85. Let’s Dream
package Cache::LRU;
sub new (CLASS[Cache::LRU] $class, UINT $max_size) {
...
}
sub _cache ($self) { ... }
sub max_size (OBJ[Cache::LRU] $self) UINT { ... }
sub set (OBJ[Cache::LRU] $self, STR $key, DEF $value)
OBJ[Cache::LRU] | VOID
{
...
}
sub get(OBJ[Cache::LRU] $self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
86. Let’s Dream
package Cache::LRU;
sub new ($class, UINT $max_size ) {
...
}
sub _cache ($self) { ... }
sub max_size ($self) { ... }
sub set ($self, STR $key, DEF $value){
...
}
sub get($self, STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
87. Let’s Dream
class Cache::LRU;
field $cache = HashOrdered->new;
field UINT $max_size :param = 20;
method set (STR $key, DEF $value){
...
}
method get(STR $key) !VOID {
...
}
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
89. Oshun
Orisha (deity) of the Nigerian Yoruba
River deity. Fertility goddes:!s.
Depicted as protector, savior, or nurturer
https://www.britannica.com/topic/Oshun
Image CC by 3.0. Sailko, Candomblé nel Museu Afro-Brasileiro, Salvador
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
90. Oshun Will Protect Your Data
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
91. Ceçi n’est pas un type
“Computer scientists have discussions about type systems.
Computer programmers have screaming matches.”
–Ovid, 9 CE (±~2K years)
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
94. Oshun History
First pass was a December 23, 2022 gist
Followed by an email to Damian
“I am not competant to design a type system.” (Ovid)
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
95. PPC Process
Send pre-PPC email to P5P list
Summarize the problem
Present your solution
Get it summarily rejected with a “this should be a CPAN module
first.”
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
96. PPC Process
Send pre-PPC email to P5P list
Summarize the problem
Present your solution
Get it summarily rejected with a “this should be a CPAN module
first.”
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
97. Oshun History
Damian’s first design arrived January 9, 2023
Months of discussion tweaking the design
Damian wrote Data::Checks
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
98. Data::Checks use Data::Checks;
sub total :returns(INT) ($times :of(UINT)) {
my $total :of(INT) = 0;
foreach my $i (1..$times) {
$total += get_result($i);
}
return $total;
}
Not on the CPAN!
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
100. Oshun Team
Branislav Zahradník (happy-barney)
Chris Prather (perigrin)
Curtis Poe (Ovid)
Dr. Damian Conway (thoughtstream)
Elvin Aslanov (rwp0)
Peter Mottram (syspete)
Dr. Ruud van Tol (druud)
Toby Inkster (tobyink)
Veesh Goldman (rabbiveesh)
Yves Orton (demerphq)
13 août 2023 COPYRIGHT 2022, HTTP://WWW.ALLAROUNDTHEWORLD.FR/
101. Why do we need this?
Safer code
Keep Perl 5.0’s Promise
Self-documenting
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
102. Summary
Corinna is partially implemented in Perl core
We’re going to have to relearn how we do OO
We might get data checks in the future
COPYRIGHT 2023, CC BY 4.0. ALL AROUND THE WORLD.
When I hit C, I didn’t understand why we didn’t have line numbers.
By “lambda”, we often refer to subroutines (the map block) which create and return anonymous subroutines. Comes from Alonzo’s Church’s “lambda calculus” in the 1930s. Unlike Turing’s stateful machine, the lambda calculus was stateless, but Turing complete.
Note: it’s possible, but awkward, to get multi-statement lambda in Python.In Perl, we use lambdas all the time (even if we don’t call them that), but it’s trickier in Python.
Note: it’s possible, but awkward, to get multi-statement lambda in Python.In Perl, we use lambdas all the time (even if we don’t call them that), but it’s trickier in Python.
Code blocks, not statement blocks, so you can’t return.
Syntax::Keyword::Try::Deparse
The ”done” items will be in Perl 5.38
The ”done” items will be in Perl 5.38
YAGNI. Single inheritance. Inheriting from non-Cor. Protected methods.
Politicians are paying more attention. More public pressure. Getting expensive for companies.
Brussels, 22 May - Following the EDPB’s binding dispute resolution decision of 13 April 2023, Facebook received a 1.2 billion euro fine following an inquiry into its Facebook service, by the Irish Data Protection Authority (IE DPA). This fine, which is the largest GDPR fine in history.
This is one way this could be done. Your data is never decrypted! Not proven to be unbreakable. Most libraries not prod-ready. They’re slow.
<secret>
Performance
Data Integrity
<secret>
Performance
Data Integrity
It’s one of those ideas that’s obvious, but only in retrospect. I thought about a Perl prototype.
Greater scalability (and the timing of the web) is what made Perl great.
Mo/ose has isa. The biggest benefit (to me) of Moose is the biggest weakness of Corinna.
When was the last time you saw a test verifying that a Java signature protected the code?