GitHub - toaha63/KalpanaLang: A Bangla Programming Language Interpreter.

KalpanaLang - Programming in Your Native Language🧑‍đŸ’ģ

mascot Click here to read README in Bangla

KalpanaLang is an interpreter-based programming language designed to allow programmers to write code in their native language. The initial version supports Bengali (Bangla) as the primary language with translations from English, Russian, and Hindi.

Features

  • Native Language Support: Write code in Bengali (with English, Russian, and Hindi translations)
  • Rich Standard Library: Includes common programming constructs and algorithms
  • Multi-language Input: Automatically detects and translates from English, Russian, or Hindi to Bengali
  • Array Operations: Built-in support for arrays with sorting and searching algorithms
  • Interactive Input: Get user input with type checking

Language Syntax

Data Types

  • āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž (Integer)
  • āĻ­āĻ—ā§āύāĻžāĻ‚āĻļ (Float/Double)
  • āĻŦāĻžāĻ•ā§āϝ (String)
  • āĻŦ⧁āϞāĻŋāϝāĻŧāĻžāύ (Boolean)

Control Structures

  • āϝāĻĻāĻŋ (if)
  • āϝāĻĻāĻŋāĻŦāĻž (else if)
  • āĻŦāĻž (else)
  • āϞ⧁āĻĒ (for/while loop)
  • āĻ­āĻžāϙ⧋ (break)
  • āĻāĻĄāĻŧāĻžāĻ“ (continue)

Functions

  • āĻĢāĻžāĻ‚āĻļāύ (function)
  • āĻĢ⧇āϰāϤ (return)
  • āĻ–āĻžāϞāĻŋ (void)

Arrays

  • āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻžāϰ_āĻ…ā§āϝāĻžāϰ⧇ (Integer array)
  • āĻ­āĻ—ā§āύāĻžāĻ‚āĻļ⧇āϰ_āĻ…ā§āϝāĻžāϰ⧇ (Float array)
  • āĻŦāĻžāĻ•ā§āϝ⧇āϰ_āĻ…ā§āϝāĻžāϰ⧇ (String array)
  • āĻŦ⧁āϞāĻŋāϝāĻŧāĻžāύ⧇āϰ_āĻ…ā§āϝāĻžāϰ⧇ (Boolean array)
  • āĻ…ā§āϝāĻžāϰ⧇āϰ_āφāĻ•āĻžāϰ (Array size)
  • āĻŦāĻžāĻŦāϞ_āϏāĻ°ā§āϟ (Bubble sort)
  • āϕ⧁āχāĻ•_āϏāĻ°ā§āϟ (Quick sort)
  • āĻŦāĻžāχāύāĻžāϰāĻŋ_āϏāĻžāĻ°ā§āϚ (Binary search)

Built-in functions:

  • āĻŦāĻ¨ā§āϧ (exit)
  • āĻ•āύāϏ⧋āϞ_āĻŽā§āϛ⧋ (clearConsole)
  • āĻ­ā§āϝāĻžāϰāĻŋāϝāĻŧ⧇āĻŦāϞ_āĻŽā§āϛ⧋ (delete_var)
  • āĻĒā§āϰ⧇āϏ⧇_āĻĨāĻžāĻŽā§‹ (stopOnEnter)
  • āĻĒā§āϰ⧇āϏ⧇_āĻļ⧇āώ (hold)
  • āĻĨāĻžāĻŽā§‹ (sleep)

Library support

  • math.klm

Getting Started

Prerequisites

  • Java 21 or higher

Running the Interpreter

  1. Clone this repository
  2. Compile the Java files:
  3. Create a source file (e.g., Demo.kls) with your code
  4. Run the interpreter:
  5. To run jar file directly:
    java -jar KalpanaLang.jar Demo.kls
  6. Or, you can run directly by calling Makefile:
    make
    
    make run FILE=Demo.kls
    
    make clean

Example Programs

Hello World

Fibonacci Series

āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž n = 10;
āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻžāϰ_āĻ…ā§āϝāĻžāϰ⧇ fib[n];

fib[1] = 1;
fib[2] = 1;

āϞ⧁āĻĒ (āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž i = 3; i <= n; i++)
{
    fib[i] = fib[i-1] + fib[i-2];
}

āϞ⧁āĻĒ (āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž i = 1; i <= n; i++)
{
    āĻĻ⧇āĻ–āĻžāĻ“(fib[i]);
}

Function Example

āĻĢāĻžāĻ‚āĻļāύ āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž factorial(āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž n)
{
    āϝāĻĻāĻŋ (n == 0)
    {
        āĻĢ⧇āϰāϤ 1;
    }
    āĻĢ⧇āϰāϤ n * factorial(n - 1);
}

āĻĻ⧇āĻ–āĻžāĻ“(factorial(5));

Supported Language Translations

English Bengali Russian Hindi
print āĻĻ⧇āĻ–āĻžāĻ“ ĐŋĐĩŅ‡Đ°Ņ‚ŅŒ ā¤ĒāĨā¤°ā¤ŋā¤‚ā¤Ÿ
integer āĻĒā§‚āĻ°ā§āĻŖāϏāĻ‚āĻ–ā§āϝāĻž ҆ĐĩĐģ ā¤ĒāĨ‚⤰āĨā¤Ŗā¤žā¤‚⤕
float āĻ­āĻ—ā§āύāĻžāĻ‚āĻļ Đ´Ņ€ĐžĐąŅŒ ⤭ā¤ŋ⤍āĨā¤¨
string āĻŦāĻžāĻ•ā§āϝ ŅŅ‚Ņ€ĐžĐēа ⤏āĨā¤ŸāĨā¤°ā¤ŋ⤂⤗
if āϝāĻĻāĻŋ ĐĩҁĐģи ⤅⤗⤰
else āĻŦāĻž иĐŊĐ°Ņ‡Đĩ ⤔⤰
function āĻĢāĻžāĻ‚āĻļāύ Ņ„ŅƒĐŊĐēŅ†Đ¸Ņ ā¤Ģ⤂⤕āĨā¤ļ⤍

Project Structure

KalpanaLang/
├── Main.java               - Main entry point
├── KalpanaLang.jar         -Signed jar file of interpreter
├── LICENSE                 - License file
├── Demo.kls                - An example of my language, kls means KalpanaLangSource
├── math.klm                - A math library for interpreter. klm means KalpanaLangModiule
├── Makefile                - Automatic source building
└── README.md               - This file

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Inspired by the need for native language programming tools.
  • Built with Java for portability and performance.

Project Team

Core Development:

  • Hasin Israk (Toaha) - Author, Main Programmer

Documentation:

  • Fabiha Islam (Deeba).
  • Hafsa Akter.
  • Ritu Moni.

Quality Assurance & Bug Fixing:

  • Akash Mitro (Nill).
  • Sifat Hossen.
  • Sojib Islam (Akash).

Project Management:

  • Lamia Akter - Version Control.
  • Sarmin Akter - Version Control.
  • Siam Hossen - Class Manager, Mascot Designer.

Research & Development:

  • Sahanaj Mim - JDK Selection.
  • Avijit Dewry - Utility Function.

Special Thanks To:

  • All beta testers and early adopters.
  • The open source community for their invaluable resources.

Known bugs:

  1. Need to update language pack in class LanguageTranslator.

Used Tools & Technologies

  1. Termux.
  2. OpenJDK 21.
  3. QuickEdit.
  4. Memory Card.

Warning âš ī¸

  • Building from source can be cause an Error. To solve it, replace, __COMPILE_TIMESTAMP__ to accual date-time when you're building.

This project is the result of collaborative effort from all team members who contributed their time, skills, and creativity to make KalpanaLang a reality.

Note

A special edition will be release in memory of the "Milestone School and College" plain crash tragedy. Decicated to all my brother & sisters â¤ī¸. Please pray for them.