SPVM

 view release on metacpan or  search on metacpan

lib/SPVM.pm  view on Meta::CPAN

use 5.008007;
package SPVM;
use strict;
use warnings;

use SPVM::Global;

our $VERSION = "0.990025001";

require XSLoader;
XSLoader::load('SPVM', $VERSION);

sub import {
  my ($class, $class_name) = @_;
  
  my ($file, $line) = (caller)[1, 2];
  
  if (defined $class_name) {
    SPVM::Global::build_class($class_name, $file, $line);
  }
}

sub api { SPVM::Global::api() }

1;

=encoding utf8

=head1 Name

SPVM - The SPVM Language

=begin html

<img src="https://github.com/yuki-kimoto/SPVM/raw/master/logo/spvm_logo.jpg" width="80px" alt="SPVM cat">

=end html

=head1 Description

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 L<backward compatibility|https://github.com/yuki-kimoto/SPVM/wiki/Backward-Compatibility>.

=head1 Usage

=head2 One Liner

Run a one liner using L<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"]);'

=head2 Executing An SPVM Program

Write a L<SPVM class|SPVM::Document::Language::Class> named C<hello.spvm> to print "Hello World!" using L<the say operator|SPVM::Document::Language::Operators/"say Operator">.

  # hello.spvm
  class {
    static method main : void () {
      
      say "Hello World!";
    }
  }

This class is an L<anon class|SPVM::Document::Language::Class/"Anon Class"> and has C<main> method that is an L<bootstrap method|SPVM::Document::Language::Class/"Bootstrap Method">.

Run the SPVM program using L<spvm> command.

  spvm hello.spvm



( run in 1.382 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )