Back to blog
·8 min read

Building Vaani — A Programming Language Where You Code in Hindi

programming-languageshindiopen-sourcevaani

What if print("Hello World") looked like this instead?

दिखाएं("नमस्ते दुनिया!")

That single line is valid code in Vaani (वाणी) — a programming language I built where every keyword, built-in function, and even your variable names are in Hindi. Not a toy. Not a syntax skin. A full language with classes, inheritance, exception handling, file I/O, list comprehensions, lambdas, and a module system.

This post is about why I built it, the design decisions that shaped it, and what it looks like to solve real problems in Hindi.

Why build a Hindi programming language?

Programming is one of the most powerful forms of literacy in the modern world. But the door to that literacy is guarded by English. Every mainstream language — Python, JavaScript, Java, Rust — requires you to think in English keywords before you can express a single idea.

For the 600+ million Hindi speakers in the world, this creates an unnecessary cognitive barrier. A student in Lucknow learning to code must simultaneously learn programming concepts and a foreign vocabulary. while means nothing to them until they learn English. But जबतक? That's a word they already know — it means "as long as."

Vaani removes that barrier entirely. It's a language where the syntax is Hindi, the keywords are Hindi, and English variable names aren't just discouraged — they're not allowed. If you try to write count = 5, the interpreter rejects it. You must write गिनती = 5. This isn't a restriction; it's a design philosophy. The entire programming experience should feel native to a Hindi speaker.

The language at a glance

Vaani maps one-to-one with programming concepts you'd find in Python, but expressed entirely in Hindi. Here's a quick keyword comparison:

| Python | Vaani | Meaning | |--------|-------|---------| | if | यदि | "if" | | else | अन्यथा | "otherwise" | | while | जबतक | "as long as" | | for...in | के_लिए...में | "for...in" | | def | कार्य | "function/task" | | class | वर्ग | "class/category" | | return | वापस | "return/back" | | True / False | सत्य / असत्य | "truth / untruth" | | None | कुछ_नहीं | "nothing" | | try / except | कोशिश / अपवाद | "try / exception" | | import | आयात | "import" | | print | दिखाएं | "show" | | self | स्व | "self" |

The language uses Python-style indentation for blocks (no braces, no end keywords), full Unicode/Devanagari support throughout, and has zero external dependencies — it runs on the Python standard library alone.

Code examples

Let me walk through progressively more complex examples to show what Vaani can actually do.

Hello World

दिखाएं("नमस्ते दुनिया!")

One line. No imports, no boilerplate. दिखाएं means "show" — the Hindi equivalent of print.

Functions

कार्य अभिवादन(नाम):
    दिखाएं("नमस्ते " + नाम + "!")

अभिवादन("राज")
अभिवादन("प्रिया")

कार्य जोड़(संख्या1, संख्या2):
    वापस संख्या1 + संख्या2

योग = जोड़(10, 20)
दिखाएं(योग)

कार्य means "function" or "task." वापस means "return." जोड़ means "add." योग means "sum." Every identifier reads naturally in Hindi.

Lists and loops

संख्या_सूची = [1, 2, 3, 4, 5]
दिखाएं(संख्या_सूची)

के_लिए संख्या में संख्या_सूची:
    दिखाएं(संख्या * 2)

संख्या_सूची means "number list." के_लिए...में is "for...in." The loop reads almost like a Hindi sentence: "for number in number-list, show number times 2."

Classes and inheritance

वर्ग मूल:
    कार्य प्रारंभ(स्व):
        स्व.नाम = "मूल"

    कार्य दिखाएं_नाम(स्व):
        दिखाएं(स्व.नाम)

वर्ग व्युत्पन्न(मूल):
    कार्य प्रारंभ(स्व):
        स्व.नाम = "व्युत्पन्न"

वस्तु = व्युत्पन्न()
वस्तु.दिखाएं_नाम()

वर्ग = class. मूल = base. व्युत्पन्न = derived. प्रारंभ = init. स्व = self. वस्तु = object. This is full OOP — constructor methods, instance attributes, single inheritance, method resolution — all in Hindi.

Exception handling

कोशिश:
    संख्या = 10 / 0
    दिखाएं("यह नहीं दिखेगा")
अपवाद:
    दिखाएं("त्रुटि पकड़ी गई!")

कोशिश = try. अपवाद = exception. त्रुटि पकड़ी गई = "error caught." Vaani also supports अंततः (finally) blocks for cleanup.

A real program: Sudoku solver

This is where it gets interesting. Vaani isn't limited to textbook exercises. Here's a Sudoku solver that uses the module system, backtracking, and real algorithmic logic — entirely in Hindi:

आयात यादृच्छिक
आयात ग्रिड_उपयोगिता जैसा ग्रिड

कार्य समाधान(पट):
    स्थान = ग्रिड.खाली_स्थान(पट)
    यदि स्थान == कुछ_नहीं:
        वापस सत्य
    पंक्ति = स्थान[0]
    स्तम्भ = स्थान[1]
    के_लिए मान में श्रेणी(1, 10):
        यदि ग्रिड.वैध_चाल(पट, पंक्ति, स्तम्भ, मान):
            ग्रिड.मान_सेट(पट, पंक्ति, स्तम्भ, मान)
            यदि समाधान(पट):
                वापस सत्य
            ग्रिड.मान_सेट(पट, पंक्ति, स्तम्भ, 0)
    वापस असत्य

कार्य मुख्य():
    पट = यादृच्छिक_पजल()
    दिखाएं("चयनित सुडोकू:")
    ग्रिड.पट_छापो(पट)
    यदि समाधान(पट):
        दिखाएं("समाधान:")
        ग्रिड.पट_छापो(पट)
    अन्यथा:
        दिखाएं("सुडोकू का समाधान नहीं मिला")

मुख्य()

Read that code. समाधान = solution. खाली_स्थान = empty place. वैध_चाल = valid move. पंक्ति = row. स्तम्भ = column. Even if you don't know Hindi, you can see the structure of a backtracking solver. If you do know Hindi, this reads like natural language describing an algorithm.

This uses Vaani's module system (आयात...जैसा = import...as), which lets you organize code across files just like Python.

Design decisions

A few choices I made early on that shaped everything:

Python-compatible semantics. Under the hood, Vaani's runtime behavior mirrors Python. Lists are lists. Dicts are dicts. Integer division, truthiness, scoping rules — they all work the way a Python programmer would expect. This means concepts transfer cleanly if a Vaani programmer later moves to Python.

Zero dependencies. Vaani runs on nothing but the Python standard library. No C extensions, no pip installs, no build chain. Run install.sh and you're done. This matters a lot when your target audience might be on a school computer in a small town.

Indentation, not braces. Hindi is written left-to-right like English, so indentation-based syntax works naturally. It also means less syntax to learn — no curly braces, no semicolons, no end keywords.

What Vaani supports today

The language is more complete than you might expect from a personal project:

  • Full arithmetic, comparison, and logical operators
  • Variables with complete Unicode/Devanagari support
  • यदि/अन्यथा_यदि/अन्यथा (if/elif/else) chains
  • जबतक (while) and के_लिए (for) loops with तोड़ो/जारी (break/continue)
  • Functions (कार्य) with parameters, return values, and recursion
  • Lambda expressions
  • Classes (वर्ग) with constructors, methods, and inheritance
  • Lists, dictionaries, tuples, and sets — all with Hindi method names (जोड़ें, निकालो, कुंजियाँ, मान)
  • List/dict/set comprehensions
  • Exception handling (कोशिश/अपवाद/अंततः)
  • File I/O (खोलें = open)
  • Module system (आयात, जैसा)
  • Interactive REPL for experimentation
  • 26 example programs and comprehensive documentation

The bigger picture

Vaani started as a question: What if programming felt native to Hindi speakers? But it connects to a larger idea I care about — that the tools we build shape who gets to participate in building the future.

There are roughly 1.5 billion people across the Hindi belt of India who grow up thinking, dreaming, and problem-solving in Hindi. Programming shouldn't require them to first pass through the filter of English fluency. Vaani is my small contribution to removing that filter.

The project is open-source and available on GitHub. I'd love contributions — whether that's new built-in functions, better error messages in Hindi, or ports to other Indic languages.

If you try it out, let me know what you build. The best programs are the ones I haven't imagined yet.


Vaani (वाणी) means "voice" or "speech" in Hindi and Sanskrit. It felt right for a language that's trying to give voice to a new generation of programmers.



Thanks for reading. Follow me for more.

← More posts