Operators

Operator reference for the Tish language.

Arithmetic

OpMeaningExample
+Add (numbers) / concat (strings)a + b
-Subtracta - b
*Multiplya * b
/Dividea / b
%Modulusa % b
**Exponentiation (right-associative)a ** b

Bitwise (32-bit integer semantics)

OpMeaning
&AND
|OR
^XOR
~NOT
<<Left shift
>>Right shift (signed / arithmetic)
>>>Unsigned (logical) right shift

Operands are coerced with JavaScript's ToInt32 / ToUint32modulo 2³², not a saturating clamp — so values outside the int32 range wrap exactly like JavaScript (4294967295 >>> 0 === 4294967295, -1 >>> 0 === 4294967295, 2147483648 | 0 === -2147483648). Shift counts are masked to the low 5 bits (1 << 35 === 8). This makes hashing/crypto code that relies on >>> 0 to stay in the unsigned 32-bit range behave identically across the interpreter, the bytecode VM (including the JIT), and native (Rust) builds.

Equality and comparison

OpMeaningNotes
===Strict equalityNo coercion
!==Strict inequalityNo coercion
< <= > >=Comparison

Tish has no loose equality (==).

Logical

OpMeaning
&&Logical AND
||Logical OR
!Logical NOT

Other

OpMeaningExample
? :Conditional (ternary)a ? b : c
??Nullish coalescinga ?? b
?.Optional chaininga?.b
++ --Increment / decrement (postfix and prefix)x++, --x
+= -= *= /= %=Compound assignmentx += 5

Improve this documentation