Skip to content

BraneScript Reference

BraneScript is a workflow language for orchestrating distributed computations. This page is a concise reference for the language syntax and features.

All statements end with a semicolon:

let x := 42;
println(x);
let name := "value"; // String
let count := 42; // Integer
let ratio := 3.14; // Real
let flag := true; // Boolean
let items := [1, 2, 3]; // Array

Reassignment:

let x := 1;
x := 2;
OperatorDescription
+Addition
-Subtraction
*Multiplication
/Division
%Modulo
OperatorDescription
==Equal
!=Not equal
<Less than
>Greater than
<=Less than or equal
>=Greater than or equal
OperatorDescription
&&And
`
!Not
if condition {
// ...
} else if other_condition {
// ...
} else {
// ...
}
while condition {
// ...
}
for item in collection {
// ...
}
import package_name;
let result := function_name(arg1, arg2);
func add(a, b) {
return a + b;
}
let data := new Data { name := "dataset_name" };
let result := process(data);
class Point {
x: Integer;
y: Integer;
}
let p := new Point { x := 10, y := 20 };
println(p.x);
let numbers := [1, 2, 3, 4, 5];
let first := numbers[0];
let length := len(numbers);
FunctionDescription
println(value)Print a value to output
len(array)Get array length
commit_result(name, value)Store a named result
// Single-line comment
/* Multi-line
comment */
let greeting := "Hello, " + "world!";
let length := len(greeting);
let s := to_string(42);
let n := to_int("42");
let f := to_real("3.14");