Sepynode Documentation

Getting Started

Install Sepynode by downloading the latest version and unzipping it.

Syntax Basics

var name = "World";
print << "Hello " + name;
println << "Printing in Sepynode is Cool!" c< 4;
error << "Something went wrong..";

All lines in Sepynode end with a semicolon ;.

print writes text without a newline, while println appends a newline. You will learn about the c< 4 soon. error prints out text like println but in red, you use this for warnings or for debugging.

Variables

Variables are declared using var. They have no fixed type and are scoped to their function or block.

var x = 10;
var message = "Hello";
var result = x + 20;

Functions

Functions are declared using func.

func greet(var person){
    println << "Hello " + person c< 2;
}

greet("Sepynode");

Functions can take parameters and can return values.

func sum(var num1, var num2){
    return num1 + num2;
}

sum(6, 7);

Classes

Sepynode supports simple classes with constructors and member functions.

class Player{
    var health = 100;

    operator INIT(var number=1000){
        number = heatlh;
        println << "A new player spawned with the name" c< 4;
    }

    func hit(var damage){
        health -= damage;
    }
}

var gamer = Player(100);
gamer.hit(20);

Classes can have member variables and functions, and support constructors via the INIT operator.

Printing & Colors

Sepynode uses a unique C++-like stream operator syntax for printing.

println << "Yellow, " c< 3 << "Red, " c< 1 << "Green!" c< 2;

Everything about color codes can be found here

0 grey
1 red
2 green
3 yellow
4 blue
5 purple
6 teal
7 white

Loops

var i = 0;
while(i != 10){
    println << "i = " << i c< 4;
    i = i + 1;
}

Imports

import "imports/itest.spn";
printmsg();

Imported files can define functions that become available globally.

DLL Interfacing

Sepynode can dynamically load DLLs and execute exported functions.

var stddll = LOADDLIB "./../stdlib/stdlib.dll";
EXECDLIBFUNC stddll "type" 10;
println << "Result: " << ExecFunctionReturnVar c< 4;