Language Basics

Keywords Reference

BanglaCode keywords are written in Banglish (Bengali words using English/Latin script). This makes it easy to type on any keyboard while remaining familiar to Bengali speakers.

Complete Keyword Table

KeywordBengali MeaningEnglish EquivalentDescription
dhorohold/letvar/letVariable declaration
sthirfixed/constantconstConstant declaration (immutable)
bishwoworld/globalglobalGlobal variable declaration
jodiififConditional statement
naholeelse/otherwiseelseElse branch
jotokkhonas long aswhileWhile loop
ghuriyerotating/loopingforFor loop
kajwork/taskfunctionFunction declaration
feraoreturn/give backreturnReturn from function
sreniclass/categoryclassClass declaration
shurustart/beginconstructorConstructor method
notunnewnewCreate instance
eithisthisCurrent instance reference
sottitruthtrueBoolean true
mitthafalse/liefalseBoolean false
khaliemptynullNull value
ebongandandLogical AND
baororLogical OR
nanot/nonotLogical NOT
thamostopbreakBreak from loop
chharoskip/leavecontinueContinue to next iteration
anobringimportImport module
pathaosendexportExport symbol
hisabeasasAlias for imports
instanceofinstance checkinstanceofCheck class instance
deleteremovedeleteDelete property/index
chestatry/attempttryTry block
dhoro_bhulcatch errorcatchCatch block
sheshend/finishfinallyFinally block
felothrowthrowThrow exception
bikolpoalternativeswitchSwitch statement
khetrecasecaseSwitch case
manchitodefaultdefaultDefault switch branch
proyasheffort/attemptasyncAsync function declaration
opekhawait/awaitawaitWait for promise
utpadanproduce/yieldyieldYield next value from generator
paogetgetClass getter
setsetsetClass setter

Keywords by Category

Variable Declaration

1// dhoro - declare a mutable variable (like let/var)
2dhoro naam = "Rahim";
3dhoro boyosh = 25;
4
5// sthir - declare a constant (cannot be changed)
6sthir PI = 3.14159;
7sthir MAX_SIZE = 100;
8
9// bishwo - declare a global variable (accessible everywhere)
10bishwo counter = 0;
11
12kaj increment() {
13 counter = counter + 1; // Modifies global
14}
15
16increment();
17dekho(counter); // 1

Boolean & Null Literals

1// sotti - true
2dhoro isValid = sotti;
3
4// mittha - false
5dhoro isComplete = mittha;
6
7// khali - null
8dhoro data = khali;

Logical Operators

1// ebong - logical AND
2jodi (age >= 18 ebong hasLicense) {
3 dekho("Can drive");
4}
5
6// ba - logical OR
7jodi (isAdmin ba isModerator) {
8 dekho("Has access");
9}
10
11// na - logical NOT
12jodi (na isBlocked) {
13 dekho("User is active");
14}

Conditionals

1// jodi - if
2// nahole - else
3dhoro score = 85;
4
5jodi (score >= 90) {
6 dekho("Excellent!");
7} nahole jodi (score >= 70) {
8 dekho("Good job!");
9} nahole {
10 dekho("Keep trying!");
11}

Loops

1// jotokkhon - while loop
2dhoro i = 0;
3jotokkhon (i < 5) {
4 dekho(i);
5 i = i + 1;
6}
7
8// ghuriye - for loop
9ghuriye (dhoro j = 0; j < 5; j = j + 1) {
10 dekho(j);
11}
12
13// thamo - break out of loop
14// chharo - continue to next iteration
15ghuriye (dhoro k = 0; k < 10; k = k + 1) {
16 jodi (k == 3) {
17 chharo; // Skip 3
18 }
19 jodi (k == 7) {
20 thamo; // Stop at 7
21 }
22 dekho(k);
23}

Functions

1// kaj - function declaration
2// ferao - return value
3kaj add(a, b) {
4 ferao a + b;
5}
6
7kaj greet(naam) {
8 dekho("Namaskar,", naam);
9}
10
11// Call functions
12dhoro sum = add(5, 3);
13greet("Rahim");

Generators

1// kaj* - generator function
2// utpadan - yield next value
3kaj* count(max) {
4 dhoro i = 0;
5 jotokkhon (i < max) {
6 utpadan i;
7 i = i + 1;
8 }
9}
10
11dhoro g = count(3);
12dekho(g.next()["value"]); // 0
13dekho(g.next()["value"]); // 1
14dekho(g.next()["value"]); // 2

Classes & OOP

1// sreni - class
2// shuru - constructor
3// notun - new instance
4// ei - this (current instance)
5
6sreni Car {
7 shuru(brand, model) {
8 ei.brand = brand;
9 ei.model = model;
10 }
11
12 kaj getInfo() {
13 ferao ei.brand + " " + ei.model;
14 }
15}
16
17dhoro myCar = notun Car("Toyota", "Corolla");
18dekho(myCar.getInfo());

Modules

math.bangbanglacode
1// pathao - export
2pathao kaj add(a, b) {
3 ferao a + b;
4}
5
6pathao dhoro PI = 3.14159;
main.bangbanglacode
1// ano - import
2// hisabe - as (alias)
3ano "math.bang" hisabe math;
4
5dekho(math.add(5, 3));
6dekho(math.PI);

Error Handling

1// chesta - try
2// dhoro_bhul - catch
3// shesh - finally
4// felo - throw
5
6chesta {
7 dhoro result = riskyOperation();
8} dhoro_bhul (error) {
9 dekho("Error:", error);
10} shesh {
11 dekho("Cleanup done");
12}
13
14// Throw custom error
15kaj validateAge(age) {
16 jodi (age < 0) {
17 felo "Age cannot be negative";
18 }
19}

Async/Await

1// proyash - async (marks a function as asynchronous)
2// opekha - await (waits for a promise to resolve)
3
4// Declare async function
5proyash kaj fetchData() {
6 opekha ghumaao(1000); // Sleep for 1 second
7 ferao "Data fetched";
8}
9
10// Use async/await
11proyash kaj main() {
12 dekho("Starting...");
13 dhoro result = opekha fetchData();
14 dekho(result); // Data fetched
15}
16
17main();
18
19// Parallel execution with sob_proyash
20proyash kaj loadAll() {
21 dhoro results = opekha sob_proyash([
22 fetchData(),
23 fetchData(),
24 fetchData()
25 ]);
26 dekho("All done!", results);
27}

For detailed async/await documentation and examples, see the Async/Await guide.

Reserved Words

All 31 keywords are reserved and cannot be used as variable names, function names, or identifiers. Attempting to use a keyword as an identifier will result in a syntax error.