The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SPVM::Guides::LanguageSpecification - The SPVM 1.0 Language Specification

DESCRIPTION

The SPVM 1.0 Language Specification is described in this document. SPVM is in beta testing for the 1.0 release. Language specifications are subject to change without warning.

SPVM Language is designed to be used from Perl. Perl can call SPVM subroutines.

SPVM Language provides fast array operation and fast numeric calculation.

SPVM subroutines is executed by the SPVM Runtime. its can be converted to shared libraries or DLL.

SPVM Language can be converted to machine codes, and you can execute them as a single executable.

Executables contain not only Unix/Linux/macOS/ios executable, but also Windows Native Executable,

C99 compliant

C99-compliant compiler and runtime

The source code for the SPVM compiler and SPVM runtime is written in C and conforms to C99.

Note that this does not mean that the user cannot call C versions other than C99 (C11, GNU extensions, etc.) or code written in C ++ from SPVM. This means that the SPVM compiler and runtime must be C99 compliant.

Correspondence of type with C99

The SPVM type exactly matches the following C99 types:

SPVM type C99 type Description
byte int8_t SPVM byte type matches C99 int8_t type.
short int16_t SPVM short type matches the C99 int16_t type.
int int32_t SPVM int type matches the C99 int32_t type.
long int64_t SPVM long type matches C99 int64_t type.
float float SPVM float type matches the C99 float type.
double double SPVM double type matches C99 double.
Object type void* SPVM object type matches the C99 void* type.
Multiple numeric type Numeric array type that matches tye type and the length of the fields of SPVM multiple numeric type

For example, if the multiple numeric type is

package Point_2i: mulnum_t {has x: int; has y: int;}

It matches the type declared in C99

int32_t var[2];

Parsing

comment

POD

package

module

Permission

Package variables

field

subroutine

Enumeration

BEGIN block

Lexical variable

block

scope

Array

value

An array of values

reference

warning

Exception handling

Callback

Week reference

formula

literal

Fat Comma

String

Undefined value

operator

Operator precedence

Sentence

Type

Type inference

Type conversion

Thread safe

Automatically loaded modules

Restriction