Minimal statically‑typed language inspired by Hindi keywords, built for teaching programming fundamentals.
Hindi Lang aims to lower the barrier to entry for beginners by allowing them to write code using familiar Hindi‑based keywords while still respecting common programming structures. Programs are parsed with ohm‑js and executed directly in the browser.
The language is statically typed. Declare a variable with its type, an identifier, and an initial value:
number age = 21;
shabd naam = "Abhishek";
Type | Keyword | Description |
---|---|---|
Number | number | Signed 32‑bit integer. |
String | shabd | UTF‑16 text. |
Boolean | haanYaNaa | true / false |
Null | khaali | Explicit empty value. |
Array | soochi | Ordered collection. |
Object | cheez | Key–value map. |
Print values to the output panel with dikhao(expr);
.
;
.//
.Category | Symbol | Example |
---|---|---|
Addition | + | a + b |
Subtraction | - | a - b |
Multiplication | * | a * b |
Division | / | a / b |
shabd naam = "Sita";
dikhao(naam);
number x = 4;
number y = 5;
number sum = x + y;
dikhao(sum);
haanYaNaa flag = true;
khaali kuch = null;
dikhao(flag);
dikhao(kuch);
The agar
keyword is used for conditional logic similar to if
in other languages. Use warna
for else:
number score = 80;
agar (score > 50) {
dikhao("Pass");
} warna {
dikhao("Fail");
}
Curly braces are used to define blocks of code for each branch.
Examples of how to use arrays and objects in Hindi Lang:
soochi numbers = [1, 2, 3];
dikhao(numbers);
cheez student = {
naam: "Abhishek",
umra: 20
};
dikhao(student);