By Gaurab Chhetri - Personal Project

Bhanai - A Custom Programming Language with a Nepali Touch

Bhanai is a simple and intuitive programming language with a Nepali touch. It leverages Node.js under the hood for execution, allowing users to create `.bhn` files and run them seamlessly.

Bhanai began as a passion project during my exploration of language design and compiler concepts. Inspired by Bhai Lang 1, I wondered: what if programming felt closer to home, using the words we speak every day? That question became the seed for Bhanai.

At its core, Bhanai is a simple and intuitive programming language with Nepali-inspired syntax. Instead of let or const, you write rakha (to keep) and sadai_rakha (to always keep). Instead of if, you write yadi (if). To print output, you use bhanai (to speak). These cultural touches transform programming into something more familiar and engaging.

Built on Node.js, Bhanai supports the essentials:

You write code in a .bhn file and run it with the chalau command, making the experience both playful and practical.

Example Program

tippani This is a sample code for the Bhanai Programming Language
 
rakha("name", "Bhanai User")
sadai_rakha("PI", 3.14159)
 
rakha("sum", jod(10, 20))
bhanai("Hello, " + name + "! Sum of 10 and 20 is: " + sum)
 
# String manipulation
rakha("greeting", "Namaste")
rakha("fullGreeting", jodString(greeting, " Swagat chha Bhanai ma!"))
bhanai("Full Greeting: " + fullGreeting)
 
yadi age < 18:
    bhanai("Timro umar kam chha.")
athawa age == 18:
    bhanai("Timro umar 18 chha.")
aru:
    bhanai("Timro umar thik chha.")

Why It Matters

Bhanai is not about replacing existing languages, it’s about showing how code can carry culture. For programmers in Nepal, it a playful activity to write in the langugage they understand. For me, it was an opportunity to dive deep into how interpreters and execution environments work, and to build something end-to-end that reflects both engineering and identity.

The language currently supports only basic constructs, but I plan to expand it over time. Every new feature is not just an upgrade to Bhanai, but also a way for me to learn more about language design and compilers.

Resources

I used plenty of online resources while learning to build something like this. I am listing out a few for y'all, if you also wanted to learn building a programming language actually works.


👉 View on GitHub | NPM Package

💡 Contributions are welcome! If you’d like to add features, open a PR. And if you just enjoy the idea, leaving a ⭐ on the repo would mean a lot.

References

Footnotes

  1. https://bhailang.js.org/