Prexonite Script
Prexonite Script (or PXS for short) is a high level programming language targeted at the Prexonite scripting engine.
function main
{
println("Hello World");
}
{
println("Hello World");
}
PXS is...
- Inspired by C-family syntax (more specifically ECMAScript)
- Procedural
- An interface to most .NET classes*
- Dynamic
*: There is only limited support for generics and features not available through reflection.PXS is not...
- A replacement for any .NET language
- Especially fast due to it's high level of abstraction
- Safe**
**: The engine requires Reflection and IO permissions so malicious code can access most of the base class library.PXS features...
- Duck typing
- Unlimited redefinition of symbols
- Nested functions (closures)
- Functions as first class objects (lambda expressions)
Name SampleCode;
Description "Some sample code to show off";
Author SealedSun;
Add System to Imports;
Entry start
function start
{
//Define the variable num in the scope of "start"
var num;
//Define a nested function
function sayHello does
Console::WriteLine("Hello $num");
//Call the function several times while altering the variable num
for(num = 0; num <5; i++)
sayHello;
}
Description "Some sample code to show off";
Author SealedSun;
Add System to Imports;
Entry start
function start
{
//Define the variable num in the scope of "start"
var num;
//Define a nested function
function sayHello does
Console::WriteLine("Hello $num");
//Call the function several times while altering the variable num
for(num = 0; num <5; i++)
sayHello;
}
Lines 1-7 are meta statements. Some of those statements are pure decoration (Name, Description and Author) while others affect runtime behaviour (Entry and Imports).The first statement in the function is a local variable declaration.The next line is a nested function definition. Note that the nested function does not conatain its own definition of the variable i but instead uses the definition of the outer function.Next is a conventional for-loop.The last statement, the loop body, is a call to the nested function sayHello. Note that Prexonite Script does not force you to add empty parentheses. The syntax for getting function references would be "->sayHello".