DEV Community

Cover image for Bhailang Is The New Programming Language Written In TypeScript
Prakash Mishra
Prakash Mishra

Posted on

Bhailang Is The New Programming Language Written In TypeScript

Currently, we have more than 9000 programming languages but Bhailang is the funniest and most enjoyable programming language in the world.

Bhailang is the new programming language written in TypeScript which is created by two Indian Software Developers from Grow and Amazon.

Let’s get to know more about Bhailang.

What is BhaiLang?

Image description

Bhailang is a dynamically typed toy programming language, based on an inside joke, written in Typescript. It was created by 2 Indian software developers Rishabh Tripathi and Aniket Singh.

Actually, In Hindi, the meaning of “Bhai” is a brother, and to use this language you have to start with “Hi Bhai” and end with “Bye Bhai”. You just have to write all the code inside these tags other than that it’s not valid(see on the image).

How it’s Created: BhaiLang?

Image description

The actual Idea for “Bhailang” originated from an internal joke a couple of years back when they had just started programming, since then, this idea was lurking around in the back of their heads.
Finally, a couple of weeks back they have started the development work, and here is the new programming language i.e. BhaiLang. Bhailang is simple and made for fun toy language, which is written in typescript.

Check out their LinkedIn post: Click Here.

Check out their github code: Click Here.

BhaiLang also provides a playground where you can play with the codes. Let’s see how you can declare variables, types, conditionals, loops, and many more.

General

hi bhai is the entry point for the program and all programs must end with bye bhai. Anything outside of it will be ignored.

This will be ignored
hi bhai
// Write code here
bye bhai
This too
Enter fullscreen mode Exit fullscreen mode

Variables

Variables can be declared using bhai ye hai.

hi bhai
  bhai ye hai a = 10;
  bhai ye hai b = "two";
  bhai ye hai c = 15;
  a = a + 1;
  b = 21;
  c *= 2;
bye bhai
Enter fullscreen mode Exit fullscreen mode

Types

Numbers and strings are like other languages. Null values can be denoted using nalla. sahi and galat are the boolean values.

hi bhai
  bhai ye hai a = 10;
  bhai ye hai b = 10 + (15*20);
  bhai ye hai c = "two";
  bhai ye hai d = 'ok';
  bhai ye hai e = nalla;
  bhai ye hai f = sahi;
  bhai ye hai g = galat;
bye bhai
Enter fullscreen mode Exit fullscreen mode

Built-ins

Use bol bhai to print anything to console.

hi bhai
  bol bhai "Hello World";
  bhai ye hai a = 10;
  {
    bhai ye hai b = 20;
    bol bhai a + b;
  }
  bol bhai 5, 'ok', nalla , sahi , galat;
bye bhai
Enter fullscreen mode Exit fullscreen mode

Conditionals

Bhailang supports a simple if-else construct, agar bhai the block will execute if the condition is sahi and warna bhai the block will execute if the condition is galat.

hi bhai
  bhai ye hai a = 10;
  agar bhai (a < 25) {
   bol bhai "a is less than 25";
  } warna bhai {
   bol bhai "a is greater than or equal to 25";
  }
bye bhai
Enter fullscreen mode Exit fullscreen mode

Loops

Statements inside jab tak bhai blocks are executed as long as a specified condition evaluates to sahi.

If the condition becomes galat, the statement within the loop stops executing, and control passes to the statement following the loop. Use bas kar bhai to break the loop and agla dekh bhai to continue within the loop.

hi bhai
  bhai ye hai a = 0;
  jab tak bhai (a < 10) {
   a += 1;
   agar bhai (a == 5) {
    bol bhai "andar se bol bhai ", a;
    agla dekh bhai;
   }
   agar bhai (a == 6) {
    bas kar bhai;
   }
   bol bhai a;
  }
  bol bhai "done";
bye bhai
Enter fullscreen mode Exit fullscreen mode

What do you think about this new programming language? For me, it’s one of the funniest languages to code and also the easiest way to write code.

If you’d like to see some more articles, be sure to read more blogs so you can keep up to date with the latest design tutorials and tricks.

Read more.

Top comments (0)