Hindi Programming Language

Minimal statically‑typed language inspired by Hindi keywords, built for teaching programming fundamentals.

Introduction

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.

Types & Keywords

The language is statically typed. Declare a variable with its type, an identifier, and an initial value:

number age = 21;
shabd  naam = "Abhishek";
TypeKeywordDescription
NumbernumberSigned 32‑bit integer.
StringshabdUTF‑16 text.
BooleanhaanYaNaatrue / false
NullkhaaliExplicit empty value.
ArraysoochiOrdered collection.
ObjectcheezKey–value map.

Print values to the output panel with dikhao(expr);.

Basic Syntax

Operators

CategorySymbolExample
Addition+a + b
Subtraction-a - b
Multiplication*a * b
Division/a / b

Code Examples

Print your name

shabd naam = "Sita";
dikhao(naam);

Simple arithmetic

number x = 4;
number y = 5;
number sum = x + y;
dikhao(sum);

Booleans & null

haanYaNaa flag = true;
khaali kuch = null;
dikhao(flag);
dikhao(kuch);

Conditional Statements

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.

Extended Data Types

Examples of how to use arrays and objects in Hindi Lang:

Array (soochi)

soochi numbers = [1, 2, 3];
dikhao(numbers);

Object (cheez)

cheez student = {
  naam: "Abhishek",
  umra: 20
};
dikhao(student);