SPVM − The SPVM Language
SPVM is a statically typed programming language that has Perl−like syntax.
SPVM has not yet reached a stable release of version 1.0. For now, there is currently no policy to keep the backward compatibility <https://github.com/yuki-kimoto/SPVM/wiki/Backward-Compatibility>.
Run a one liner using spvm command.
# Hello World!
spvm −e 'say "Hello World!";';
Run a one liner with loading a class.
# foo,bar,baz
spvm −M Fn −e 'say
Fn−>join(",", ["foo",
"bar", "baz"]);'
Write a SPVM class named "hello.spvm" to print "Hello World!" using say operator.
# hello.spvm
say "Hello World!";
This class is an anon class and has "main" method that is an bootstrap method.
Run the SPVM program using spvm command.
spvm hello.spvm
Generate an executable file using spvmcc command.
spvmcc −B ˜/.spvm_build −o ./hello −−no−config hello.spvm
Run the executable file.
./hello
Write an SPVM class.
#
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;
}
}
Write a Perl program calling an SPVM method using exchange APIs.
# sum.pl
use FindBin;
use lib "$FindBin::Bin/lib";
use SPVM 'MyMath';
my $total = SPVM::MyMath−>sum([3, 6, 8, 9]);
print "$total\n";
Run the Perl program.
# Run
perl sum.pl
|
• |
Perl starndard functions and Perl standard modules. | ||
|
• |
Native threads and goroutines. | ||
|
• |
Executing SPVM programs | ||
|
• |
Generating an executable file | ||
|
• |
AOT(Ahead−of−time compilation) and JIT(Just−in−time compilation). | ||
|
• |
Static types, type inference and static analysis. | ||
|
• |
C and C++ binding and resource system for C and C++ libraries. | ||
|
• |
Perl binding for SPVM methods. | ||
|
• |
Perl−like syntax with class syntax. | ||
|
• |
High performance <https://github.com/yuki-kimoto/SPVM/wiki/Benchmark> |
|
• |
SPVM Tutorial <https://github.com/yuki-kimoto/SPVM/wiki/Tutorial> |
All SPVM Documents
|
• |
Language Specification |
•
|
Lexical Tokenization |
||||
|
• |
Syntax Parsing |
|||
|
• |
Class Definition |
|||
|
• |
Types |
|||
|
• |
Statements |
|||
|
• |
Operators |
|||
|
• |
Exception Handling |
|||
|
• |
Garbage Collection |
|||
|
• |
System Setting |
|||
|
• |
Native Classes
|
• |
Native Class Config |
|||
|
• |
Native APIs |
•
|
Runtime Native APIs |
||||
|
• |
Basic Type Native APIs |
|||
|
• |
Class Variable Native APIs |
|||
|
• |
Field Native APIs |
|||
|
• |
Method Native APIs |
|||
|
• |
Argument Native APIs |
|||
|
• |
Type Native APIs |
|||
|
• |
Compiler Native APIs |
|||
|
• |
Class File Native APIs |
|||
|
• |
String Buffer Native APIs |
|||
|
• |
Allocatord Native APIs |
|||
|
• |
Mutex Native APIs |
|||
|
• |
Internal Native APIs |
|||
|
• |
Resources
|
• |
Environment Variables |
|
• |
Exchange APIs |
|
• |
Builder APIs |
|||
|
• |
Builder Utility APIs |
|||
|
• |
Config Builder |
|||
|
• |
SPVM Script Information |
|
• |
spvm − Executing SPVM Programs |
|||
|
• |
spvmcc − Generating Executable Files |
|||
|
• |
spvmdist − Distributing SPVM Modules |
|||
|
• |
spvmdeps − Class Dependencies Analyzer |
|
• |
Standard Modules |
|||
|
• |
CPAN Modules <https://github.com/yuki-kimoto/SPVM/wiki/CPAN-Modules> |
|
• |
SPVM Test Cases <https://github.com/yuki-kimoto/SPVM/tree/doc/t/02_vm/lib/SPVM/TestCase> | ||
|
• |
Binding C/C++ Libraries <https://github.com/yuki-kimoto/SPVM/tree/doc/examples/native> |
|
• |
Wiki <https://github.com/yuki-kimoto/SPVM/wiki> |
SPVM − Github <https://github.com/yuki-kimoto/SPVM>
Yuki Kimoto <[email protected]>
moti<[email protected]>
|
• |
Mohammad S Anwar |
|||
|
• |
akinomyoga |
|||
|
• |
NAGAYASU Shinya |
|||
|
• |
Reini Urban |
|||
|
• |
chromatic |
|||
|
• |
Kazutake Hiramatsu |
|||
|
• |
Yasuaki Omokawa |
|||
|
• |
Suman Khanal |
|||
|
• |
Ryunosuke Murakami <https://github.com/ryun0suke22> |
|||
|
• |
Yoshiyuki Itoh <https://github.com/YoshiyukiItoh> |
|||
|
• |
Tore Aursand <https://github.com/toreau> |
|||
|
• |
greengorcer <https://github.com/greengorcer> |
Copyright (c) 2023 Yuki Kimoto
MIT License