Syntax & Variables
Data Types
Section titled “Data Types”Tulpar supports the following data types:
| Type | Description | Example |
|---|---|---|
int | Integer numbers | int x = 42; |
float | Floating-point numbers | float pi = 3.14; |
str | UTF-8 strings | str name = "Hamza"; |
bool | Boolean values | bool flag = true; |
array | Mixed-type arrays | array mix = [1, "text", 3.14]; |
arrayInt | Type-safe integer arrays | arrayInt nums = [1, 2, 3]; |
arrayFloat | Type-safe float arrays | arrayFloat vals = [1.5, 2.5]; |
arrayStr | Type-safe string arrays | arrayStr names = ["Ali", "Veli"]; |
arrayBool | Type-safe boolean arrays | arrayBool flags = [true, false]; |
arrayJson | JSON-like objects | arrayJson obj = {"key": "value"}; |
Variables and Constants
Section titled “Variables and Constants”Variables are declared with their type:
// Variable declarationint x = 10;float y = 3.14;str name = "TulparLang";bool active = true;
// Compound assignmentx += 5; // x = 15x *= 2; // x = 30
// Increment/Decrementx++; // x = 31x--; // x = 30Comments
Section titled “Comments”Tulpar supports single-line and multi-line comments:
// Single-line comment
/* Multi-line block comment*/