SPVM is the language to speed up numerical operation and array operation in Perl.

SPVM is deveoped little by little. I don't know it will be success to embded SPVM to Perl , but I introduce SPVM in this entry.



SPVM-solo



SPVM means Static Perl Virtual Matchine. This is Perlish static typed language.

Today I will introduce the test script. All variables have a static type and automatic type conversion is not done. Variable declaration can be omitted because it has type inference. It is designed to be same as Perl language as possible.

package Main { sub main () : int {

my $num1 = 2;

my $num2 = 5;



my $num3 = sum($num1, $num2);



std::println_int($num3);



return 0;

} sub sum ($num1 : int, $num2 : int) : int {

my $num3 = $num1 + $num2;



return $num3;

}

}



The output result is as follows.

7

Looking at the file "Test.spvm", you can see the functions currently implemented.