OSPL
A programming language with a Rust-based interpreter.
Building
Running Programs
Alternative commands:
exeorr- run a file with statementsrun-expr- run a file as an expressionrun-stmt- run a file as a single statement
Syntax
Comments:
#for line comments*****multiline*****for block comments
Variables:
def x = 10;
x = 20; # reassignment
Functions:
def add = fn((a, b), c) {
return a + b + c;
};
Control flow:
if condition {
# code
} else if other {
# code
} else {
# code
};
select value {
case (pattern) {
# code
}
case (_) {
# default case
}
};
loop {
# infinite loop
};
VS Code Extension
Install the .vsix file for syntax highlighting.
or compile it with:
cd vscode/ospl-vscode && npx vsce package | cat