I start to post the entries of "Python/numpy porting to Perl" in DEV Community

I start to post the entries of "Python/numpy porting to Perl" in DEV Community.

Yuki Kimoto - DEV Community.


Class::Plain supports Role using Role::Tiny


use Class::Plain;
  
role Some::Role {
  
  method foo { ... }
    
  method bar { ... }
}
 
class Some::Class : does(Some::Role) {
  method foo { ... }
    
  # baz is wrapped in the …

Class::Plain - Class Syntax for Hash-Based Perl OO

Class::Plain provides a class syntax for the hash-based Perl OO.

Usage

use Class::Plain;
 
class Point {
  field x;
  field y;
   
  method new : common {
    my $self = $class->SUPER::new(@_);
     
    $self->{x} //= 0;
    $self->{y} //= 0;
     
    return $self;
  }
   
  method move {
    my ($x, $y) = @_;
     
    $self->{x} += $x;
    $self->{y} += $y;
  }
   
  method describe {
    print "A point at ($self->{x}, $self->{y})\n";
  }
}
 
my $point = Point->new(x => 5, y => 10);
$point->describe;

In…

How does SPVM resolve the problems of Perl numeric operations?

How does SPVM resolve the problems of Perl numeric operations?

I hear Perl have the problems of numeric operation.

I realized this problems, and try to resolve them using SPVM. (SPVM is yet experimental release).

What is SPVM?

SPVM is a programing language to provide fast static-typed numeric operation and array operations into Perl.

I'm writing SPVM Language Specification now.

Do you want to use static typed numeric arra…

The progress of the new class feature of Perl

I introduce the progress of the new class feature of Perl. If you are interested in the progress of the new class feature of Perl, please see the following topics.

p5p Mailing List

Pre-PR Preview of `use feature 'class'`

Trial of the implementation

leonerd/perl5/feature-class | Github

Specification

Corinna RFC

In the current spec, the new…