Name

SPVM - SPVM Language

Caution

SPVM is not yet 1.0 release. SPVM is quit often changed without warnings until I feel the implementation is enough good.>

Usage

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;
  }
}

Call the SPVM method 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";

Description

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.

Document

SPVM documents.

Tutorial

SPVM Tutorial.

Language Specification

SPVM Language Specification.

Standard Modules

SPVM Standard Modules.

Exchange APIs

SPVM Exchange APIs is functions to convert between Perl data structures and SPVM data structures.

Native Module

The native module is the module that is implemented by native language such as C language or C++.

Native APIs

SPVM native APIs are public APIs that are used in native language sources such as C language or C++.

Resource

A resource is a native module that contains a set of sources and headers of native language such as C language or C++.

Creating Executable File

spvmcc is the compiler and linker to create the executable file from SPVM source codes.

Creating SPVM Distribution

spvmdist is the command to create SPVM distribution.

Benchmark

SPVM performance benchmarks.

Environment Variables

SPVM_BUILD_DIR

SPVM building directory to build precompile and native methods. If the SPVM_BUILD_DIR environment variable is not set, the building of precompile and native methods fails.

bash:

export SPVM_BUILD_DIR=~/.spvm_build

csh:

setenv SPVM_BUILD_DIR ~/.spvm_build

SPVM_CC_DEBUG

Print debug messages of SPVM::Builder::CC to stderr.

SPVM_CC_FORCE

Force the compilation and the link of SPVM::Builder::CC.

Repository

Github

Bug Report

GitHub Issue

Support

Github Discussions

Author

Yuki Kimoto <kimoto.yuki@gmail.com>

Core Developers

moti<motohiko.ave@gmail.com>

Contributors

  • Mohammad S Anwar

  • akinomyoga

  • NAGAYASU Shinya

  • Reini Urban

  • chromatic

  • Kazutake Hiramatsu

  • Yasuaki Omokawa

  • Suman Khanal

Copyright & LICENSE

Copyright 2018-2022 Yuki Kimoto, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.