Operators
Bnlang has a deliberately small operator set. Symbolic operators (+, ==, <, …) are identical in English and Bangla code; the only operators that have a Bangla form are the logical word operators (and/এবং, or/অথবা, not/না).
Quick reference
| Category | Operators |
|---|---|
| Arithmetic | + - * / % |
| Comparison | == != < <= > >= |
| Logical (word) | and / এবং, or / অথবা, not / না |
| Assignment | = |
| Member / index / call | . [ ] ( ) |
| String concat | + |
Arithmetic
print(2 + 3); // 5
print(10 - 4); // 6
print(3 * 4); // 12
print(10 / 3); // 3.333...
print(10 % 3); // 1
print(-5); // -5 (unary minus)
There are no ++ / -- operators. Write i = i + 1 instead.
There are no compound-assignment operators (+=, -=, *=, etc.). Write the full form: x = x + 1.
Comparison
print(2 == 2); // true
print(2 != 3); // true
print(2 < 3); // true
print(2 <= 2); // true
There is no === / !==. Equality is ==, and it does not implicitly coerce types — 1 == "1" is false. Use the comparison that fits your data.
Logical word operators
Logical operators are spelled out as words. Both English and Bangla forms parse to the same token.
var a = true;
var b = false;
print(a and b); // false
print(a or b); // true
print(not a); // false
// Bangla forms — same meaning, same parsing
print(a এবং b); // false
print(a অথবা b); // true
print(না a); // false
There are no &&, ||, ! symbolic logical operators. Use the words.
There are no bitwise operators (&, |, ^, ~, <<, >>). If you need bit manipulation, do the arithmetic explicitly ((x / 2) % 2 for "bit 1 set", etc.).
Assignment
var x = 10;
x = x + 1; // ordinary assignment
print(x); // 11
Just =. No compound forms.
Member access, index, call
var user = { name: "Alice", roles: ["admin", "editor"] };
print(user.name); // member access
print(user["name"]); // map index (same as .name)
print(user.roles[0]); // list index
print(user.roles.length); // intrinsic property
var greet = function (n) { return "hi " + n; };
print(greet("Alice")); // function call
String concatenation
+ doubles as string concatenation when at least one side is a string:
print("hello, " + "world"); // "hello, world"
print("count: " + 42); // "count: 42"
There is no string-interpolation syntax (no backtick template strings). Use + or pass multiple args to print(...).
What's not here
If you're coming from JavaScript or Python, here's what Bnlang doesn't ship:
===/!==— only==/!=.&&,||,!— useand,or,not.??,?.,?:(ternary) — useif/else.++,--,+=,-=, etc. — write the full assignment.&,|,^,~,<<,>>— no bitwise ops.typeof,instanceof,in,delete,void,new— not operators (no operator-keywords beyondand/or/not). Use thetype()built-in instead oftypeof.- Backtick template strings — use
+.