LambdaScript
Protocol
A statically-typed, high-performance language designed for the CodeStitcher Neural Engine. Execute code directly in the browser.
Basic Syntax
- Statements end with a semicolon
; - Output uses the stream operator
<< - Comments use double slashes
//
hello_world.ls
// This is a LambdaScript comment
print << "Neural Link Established.";
print << 2026;
Variables & Types
LambdaScript is statically typed. You must declare the type.
data_types.ls
int score = 100;
float pi = 3.14159;
string status = "Active";
boolean isOnline = true;
print << "Status: " + status;
print << "Score: " + score;
Control Flow
Supports if, else, while, and standard logical operators.
logic_gate.ls
int power = 85;
if (power > 90) {
print << "Critical Mass!";
} else {
print << "Systems Nominal.";
}
int count = 3;
while (count > 0) {
print << "Countdown: " + count;
count = count - 1;
}
Functions
Functions define logic blocks. Use the arrow -> to specify return types.
recursion.ls
func factorial(int n) -> int {
if (n == 1) { return 1; }
return n * factorial(n - 1);
}
int result = factorial(5);
print << "Factorial of 5 is: " + result;
Arrays
Store lists of data using square brackets [].
arrays.ls
int[] data = [10, 20, 30, 40];
print << "Original: " + data[1];
// Update Value
data[1] = 999;
print << "Updated: " + data[1];
Structures
Define custom data types using struct.
structs.ls
struct Point {
int x;
int y;
}
Point p = Point(10, 20);
print << "X Coordinate: " + p.x;
print << "Y Coordinate: " + p.y;