SPVM(3)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’– Name πŸ’–

okay bestie, welcome to SPVM(3) β€” a User Contributed Perl Documentation page for SPVM - The SPVM Language ✨. This is the manual for SPVM, and it's lowkey giving "Perl, but statically typed" main character energy πŸ’….

✨ Description ✨

SPVM is a statically typed programming language that has Perl-like syntax. Literally Perl-like syntax, but with static types, no cap 🧚.

okay, real talk bestie: 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. So keep that in mind, fr fr 🫢.

πŸŽ€ Usage πŸŽ€

Okay, here's the vibe check for actually using SPVM. Buckle up πŸŽ€.

πŸ“ One Liner πŸ“

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"]);'

🌸 Executing An SPVM Program 🌸

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

πŸ¦‹ Generating An Executable File πŸ¦‹

Generate an executable file using spvmcc command:

spvmcc -B ~/.spvm_build -o ./hello --no-config hello.spvm

Run the executable file:

./hello

🧚 Calling An SPVM Method from Perl 🧚

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

πŸ”₯ Features πŸ”₯

SPVM is serving features, bestie:

  • 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.

🌈 Tutorial 🌈

Start here, bestie:

πŸ’œ Documents πŸ’œ

All SPVM Documents β€” the whole doc-verse:

  • 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 πŸ’…

  • Exchange APIs

⭐ Builder APIs ⭐

  • Builder APIs
  • Builder Utility APIs
  • Config Builder
  • SPVM Script Information

πŸ‘‘ Commands πŸ‘‘

  • spvm β€” Executing SPVM Programs
  • spvmcc β€” Generating Executable Files
  • spvmdist β€” Distributing SPVM Modules
  • spvmdeps β€” Class Dependencies Analyzer

🫢 Modules 🫢

πŸ¦‹ Examples πŸ¦‹

πŸ™ˆ Wiki πŸ™ˆ

πŸ’€ Repository πŸ’€

🌸 Author 🌸

Yuki Kimoto <kimoto.yuki@gmail.com> β€” the author, periodt ✨.

πŸ’– Core Developers πŸ’–

moti<motohiko.ave@gmail.com> β€” core dev, slay 🫢.

⭐ Contributors ⭐

These iconic humans contributed, and yes, every name is here:

Copyright (c) 2023 Yuki Kimoto

MIT License

That's the legal tea β˜•.

okay that's the whole manual, bestie πŸ’… β€” this page is from perl v5.42.2, dated 2026-02-03, and it's the SPVM(3) manual. mwah 🫢

πŸ“¦ where this page comes from