All Projects → yuki-kimoto → SPVM

yuki-kimoto / SPVM

Licence: other
SPVM Language

Programming Languages

c
50402 projects - #5 most used programming language
perl
6916 projects
Raku
181 projects
XS
67 projects
Yacc
648 projects
C++
36643 projects - #6 most used programming language

SPVM - SPVM Language

SPVM(Static Perl Virtual Machine) is a perl-ish static typed programing language. SPVM provides fast calculation, fast array operations, easy C/C++ binding, and creating executable files.

Installing SPVM

Install SPVM.

cpanm SPVM

Examples

Write a SPVM Module.

# lib/SPVM/MyMath.spvm
class MyMath {
  static method sum : int ($nums : int[]) {

    my $total = 0;
    for (my $i = 0; $i < @$nums; $i++) {
      $total += $nums->[$i];
    }

    return $total;
  }
}

Use the SPVM Module from Perl.

# sum.pl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";

use SPVM 'MyMath';

# Call method
my $total = SPVM::MyMath->sum([3, 6, 8, 9]);

print "$total\n";

Documents

Documents of SPVM language.

https://metacpan.org/pod/SPVM

Test Status

Tests
linux
macos
windows
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].