babu-language
Version:
A fun programming language built on JavaScript. Created by Atikin Verse.
128 lines (95 loc) • 7.85 kB
Markdown
###🧙♂️ Babu Language
A fun, beginner-friendly, desi-style programming language built on top of JavaScript. With syntax inspired by casual Hindi phrases, Babu Language makes programming more relatable and enjoyable. Created by Atikin Verse.
## Snippets
This is simple code snippet extension for Babu Language projects.
| 🧠 **Babu Syntax** | 💻 **JavaScript Equivalent** |
|--------------------------------------- |--------------------------------------- |
| `bol babu "Hello"` | `console.log("Hello")` |
| `bol babu x + y` | `console.log(x + y)` |
| `le babu x = 5` | `let x = 5` |
| `const babu y = 10` | `const y = 10` |
| `var babu z = 15` | `var z = 15` |
| `agar babu (x > 3)` | `if (x > 3) {` |
| `nahi to babu` | `} else {` |
| `jab tak babu (x < 5)` | `while (x < 5) {` |
| `kaam babu greet(name)` | `function greet(name) {` |
| `wapis jao babu x * y` | `return x * y` |
| `kaam khatam babu` | `}` |
| `bula babu greet("Babu")` | `greet("Babu")` |
| `sahi babu` | `true` |
| `galat babu` | `false` |
| `padho file "data.txt"` | `fs.readFileSync("data.txt", "utf-8")` |
| `likho file "out.txt", "hello"` | `fs.writeFileSync("out.txt", "hello")` |
| `galti ho sakti hai babu` | `try {` |
| `pakdo babu (err)` | `} catch (err) {` |
| `koi ghalti babu "message"` | `throw new Error("message")` |
| `event babu click = bol babu "ok"` | `click = function() { console.log("ok") }` |
## Features
- Custom syntax with Indian flair
- Easy-to-use CLI tool
- VS Code extension for syntax highlighting and snippets
| 🧠 **Feature** | 💻 **Description** |
|--------------------------------------- |----------------------------------------------------------------------- |
| **Print Statements (`bol babu`)** | Print messages or values to the console using `console.log`. |
| **Variable Declaration (`le babu`)** | Declare variables using `let`, `const`, or `var`. |
| **Conditional Statements (`agar babu`)** | Use `if-else` conditions for logical branching. |
| **Loops (`jab tak babu`)** | Create `while` loops for repeated actions based on a condition. |
| **Function Declaration (`kaam babu`)** | Declare functions with or without arguments. |
| **Return Statements (`wapis jao babu`)** | Return a value from a function. |
| **Error Handling (`galti ho sakti hai babu`)** | Handle errors with `try-catch` blocks. |
| **Boolean Literals (`sahi babu`, `galat babu`)** | Use `true` and `false` for boolean logic. |
| **File Read (`padho file`)** | Read a file synchronously using Node.js `fs.readFileSync`. |
| **File Write (`likho file`)** | Write data to a file synchronously using Node.js `fs.writeFileSync`. |
| **Event Handling (`event babu`)** | Handle events (e.g., click) by defining functions for them. |
| **Function Calls (`bula babu`)** | Call functions with or without parameters. |
## Installation
| 🔧 **Step** | 📋 **Command / Description** |
|----------------------------------|-------------------------------------------------------------------------------|
| Clone the repository | `git clone https://github.com/your-username/babu-language.git` |
| Navigate to the project folder | `cd babu-language` |
| Install dependencies (if any) | `npm install` (optional — if CLI features/extensions added) |
| Run a Babu file | `node index.js path/to/file.babu` |
## 🚀 Getting Started
| 🔧 **Step** | 📋 **Description** |
|-------------------------------------------- |-------------------------------------------------------------------------------|
| **1. Create a `.babu` file** | Write your Babu code in a file named `hello.babu`. |
| **2. Sample Code** | `le babu name = "Babu"`,<br>`bol babu "Hello " + name` |
| **3. Run the Babu file** | Use the command `node index.js hello.babu` to transpile and execute the code. |
## Contribution
| 🙌 **How to Contribute** | 📝 **Details** |
|----------------------------------|------------------------------------------------------------------------------------|
| Fork the repository | Use the GitHub "Fork" button to create your own copy. |
| Create a new branch | Use a feature branch like `git checkout -b feature/my-feature` |
| Make your changes | Improve transpiler, add features, fix bugs, or update documentation. |
| Commit your changes | Write clear and meaningful commit messages. |
| Push to your fork | `git push origin feature/my-feature` |
| Submit a pull request | Go to the original repo and click "New Pull Request". |
### CLI Tool
```bash
npm install -g babu-language
###🔖 License
This project is licensed under the MIT License.
###👤 Author
Atikin Verse
Made with ❤️ in India
GitHub
Website coming soon..
## FOLLOW US ON For more information:
Join our social media for exciting updates, news, and insights! Follow us on :
<!--Table-->
| ACCOUNTS | USERNAME |
|------------ | -------------- |
| FACEBOOK | atikinverse |
| INSTAGRAM | atikinverse |
| LINKEDIN | atikinverse |
| TWITTER (X) | atikinverse |
| THREADS | atikinverse |
| PINTREST | atikinverse |
| QUORA | atikinverse |
| REDDIT | atikinverse |
| TUMBLR | atikinverse |
| SNAPCHAT | atikinverse |
| SKYPE | atikinverse |
| GITHUB | atikinverse |
Feel free to reach out if you have any questions or suggestions!
Happy Coding with Babu! 🚀