Compiler creation in progress https://github.com/Craigspaz/SPL-Compiler
Intended for serverside scripting for websites.
Print("Hello World");
var x = 1;
while(x <= 10);
Print(x);
endloop;
for(var y = 1; y <= 10; y = y + 1);
Print(y);
endloop;
function testFunction(var value, var other);
Print(value);
Print(other);
endfunc;
testFunction(5,"Pie");
The code below sets y to the memory address of x
var x = 10;
var y = @x;
The code below sets z to the value y points to
var x = 10;
var y = @x;
var z = ~y;
The code below sets x to the value 5
var x = 10;
var y = @x;
~y = 5;
//This is a comment. A semicolon is not required at the end of this comment because it is on it's own line
//Any line that starts with "//" is ignored
var x = 5; //This is also a comment but notice the semicolon at the end of this comment;
//The following line prints out the value of x
Print(x);
Content of testInclude.cr
function doesNotExistAnywhere();
Print("This is a function");
endfunc;
Content of test.cr
include "./testFolder/testInclude.cr";
doesNotExistAnywhere();
If test.cr is executed the following is the result
This is a function
var x = {};
append(x,"Appends this string to x");
var y = {6, "Hello", 2, 338, 29};
var x = y[1];
y[1] = 3;
Print(x); // This prints out "Hello";
Print(y[1]); // This prints out 3;