Our Objective: To explore what this new programming language, “Bhailang” has to offer.

With "Bhailang", learn Programming the easy and fun way
With “Bhailang”, learn Programming the easy and fun way

Ever since I found out about Bhailang, I wanted to document my excitement about it. So finally I am writing about something for which I was very curious. Recently, 2 young Indian men from the Computer Science Background, developed a language called “Bhailang”. Rishabh and Ankit, the developers, have come up with something no one has ever thought of before.

Have you ever thought of writing a program in your native language? No, Right! But that’s what they have achieved by making “bhailang”. Bhailang is a toy programming language that is written in TypeScript. Bhailang employs code from the Hindi local lingo. The fun part about the language is the involvement of the word “Bhai” in every instruction.

Meaning of Bhailang

In India, Hindi is the native language of people. And Bhai in the Hindi language is used for “Brother”. So the language is based on the “bro-talk” and that is the primary reason why it is gaining so much popularity among netizens all over the world.

The Creators of Bhailang

Bhailang is developed by two Indian developers, Aniket Singh from Amazon and Rishabh Tripathi from Groww. I have provided their Github profiles at the end of the article.

The Inspiration Behind Bhailang

So as per Aniket, the language was inspired by some internal joke between him and the other creator, Rishabh. They gave up on the idea of developing a whole new programming language, thinking it would be too difficult and time-consuming. But when they started their journey of developing this language, they were surprised to know that it was quite a fun job.

Let’s Talk About The Syntax

Here comes the most interesting and my favorite part of the language. Like any other programming language, this language also has its syntax. The syntax is so simple and readable that a person who hasn’t seen a single line of code in his entire life can surely understand this. The syntax is filled with the word “Bhai” in each command. So if you want to write something in this language, you have to start with “hi bhai” and end it with “bye bhai”, just like how you talk to people in person. The casual syntax of the language makes it unique and approachable in so many ways.

Syntax of Bhailang Programming Language
Syntax of Bhailang Programming Language

What Makes Bhailang Unique?

Everything about the language is impressive, be it the name, syntax, or even the inspiration. Let me point out some of the cool highlights of this language:

  • Accessibility: People who doesn’t understand english but wanted to code, can definately give it a try.
  • Native Language: More than 528 million people speak Hindi and thus Bhailang will cater a large section of the society. The words used in building this langauge are common hindi words, that we ought to speak frequently.s
  • Readability: Connecting to the above mentioned points, the syntax of the language will make it easier to read and understand the language.
  • Easy to Remember: Since it is based on our mother tongue and how we interect with others everyday, it becomes easy to remember.
  • The Fun Errors: Using Bhailang and not talking about the error messages is no justice at all. So errors that the language throws when the program can not get executed because of some mistake, it shows very clever and savage messages to the developer, like Arre Bhai Bhai Bhai, kya kar rha hai tu??

Installing Bhailang

It is available as a package of the node. So make sure to install node and npm beforehand.

  • Once you have node and npm installed, open your command prompt.
  • Just type in the following command in the cmd.
npm i -g bhailang
  • Using the above command, Bhailang will be successfully installed as a global package in your system.

Writing our First Program

Bhailang is a fun way to learn the foundations of a programming language. So let us just dive in and start learning it. Do not worry if you are a noob or a newbie in programming, Bhailang is here acting as a savior for all of us.

General Rules

Entry and Exit Point

  • hi bhai” is the entrypoint and “bye bhai” is the exitpoint. Anything written outside these two will not be considered.
hi bhai
  //Code here
bye bhai

Defining a Variable

Defining a variable is very interesting. You need to add “bhai ye hai” before the variable name and its value.

hi bhai
  bhai ye hai name = "Techbit";
bye bhai

Data Types

Since the language has used the Hindi language, the data types can also be declared using some of commonly-used Hindi words like so:

  • For Null value: nalla
  • For Boolean Value:
    • True: sahi
    • False: galat
hi bhai
  bhai ye hai a = 1;
  bhai ye hai b = 1 + (5*2);
  bhai ye hai c = "one";
  bhai ye hai d = 'happy';
  bhai ye hai e = nalla;
  bhai ye hai f = sahi;
  bhai ye hai g = galat;
bye bhai

To Print

As we use statements like console.log or print in other programming languages, we have the same thing here but in Hindi with a touch of humor. To print anything to console, type in “bol bhai“.

hi bhai
 bol bhai "Techit";
bye bhai

Conditional Statements

This super-fun language also supports the if-else-else if ladder, but of course with a Hindi twist to it. The syntax for the same is as follows:

  • if is written as “agar bhai
  • else is written as “nahi to bhai
  • else if as “warna bhai” 
hi bhai
    bhai ye hai name= "techbit";
    agar bhai(name=="tech"){
    bol bhai "Correct!";}
    nahi to bhai(name=="techbit"){
    bol bhai "You're Right!";}
    warna bhai{
    bol bhai "Sab Galat Guess!";}
bye bhai
Output of the above Code:
 You're Right!

Since the name variable matches the condition given in the else, it executes the “else”/ “nahi to bhai” condition from the ladder.

Loops

Loops in Bhailang follow the same principle as any other programming language. The while condition is named “jab tak bhai“. Statements inside this block will be executed as long as they are true/sahi. If the condition becomes false/galat, the statement within the loop stops executing. Now the statement following the loop will be considered.

  • Use bas kar bhai to break the loop.
  • And agla dekh bhai to continue within loop.
hi bhai
  bhai ye hai num = 0;
  jab tak bhai (num < 20) {
   a += 1;
   agar bhai (num == 10) {
    bol bhai num;
    agla dekh bhai;
   }
   agar bhai (num == 15) {
    bas kar bhai;
   }
   bol bhai num;
  }
  bol bhai "done";
bye bhai
Output of the above Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
done

Conclusion

And with that, we’ve come to an end of this article. So in my opinion, Bhailang is going to be a very popular and loved language among people, especially the youth programmers who are keen to learn to program but don’t want the typical syntax too. Starting with this language and a well-known language like Python together can help in a better understanding of the concepts. As Bhailang is relatable and easily readable by most Indians, so it can provide a wonderful native language reference to the actual programming concepts. The use of the native language is surely a USP and can motivate a large number of people to learn to program.

Disadvantages

Although it is just a toy programming language as of now, some of its unique features will only work against it. It is too soon to comment on it, but still, I consider these are some of the disadvantages of this language:

  • It comes with a very casual approach.
  • It can not be understood by the non-Hindi speakers of the world.

I can not think of any other demerit other than these two. In my opinion, it is a very exciting and fun way to enter into the field of development and programming. I am truly impressed and thrilled to try out Bhailang for making some small fun projects and share them with you guys here. And I am happy to admit that with considerable improvements, it can become a strong and professional language. Learning with a bit of humor is such a good & healthy concept and programming can not get more compelling than this.

Some Important Links:

If you have enjoyed reading this article, then don’t miss out on these:

Thank you so much for reading the article. Make sure to comment down below if you have any doubt regarding anything stated above, or if you want to contribute to the article.

Let’s get connected on our Socials as well:


Vaishali Rastogi

Hey There! I am Vaishali Rastogi and I am a tech-researcher. I've been doing writing for a good 4-5 years, so here I am now. Working on my own website to make people digitally aware of the updates in technology.

2 Comments

Get More Info · March 24, 2022 at 12:42 am

Nice post. I learn something totally new and challenging on websites
I stumbleupon on a daily basis. It’s always exciting
to read articles from other writers and use a little something from other
websites.

Leave a Reply

Avatar placeholder

Your email address will not be published.

1 × four =