• Stars
    star
    127
  • Rank 282,790 (Top 6 %)
  • Language
    Rust
  • License
    MIT License
  • Created about 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dynamically typed bangla programming language written in rust

Introduction

Pakhi is a dynamically typed, general purpose programming language with Bangla alphabet written in rust.

Language basics


PrimitiveTypes

  • _āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž
  • _āĻŦā§āĻ˛āĻŋā§ŸāĻžāĻ¨
  • _āĻ¸ā§āĻŸā§āĻ°āĻŋāĻ‚
  • _āĻ˛āĻŋāĻ¸ā§āĻŸ
  • _āĻ°ā§‡āĻ•āĻ°ā§āĻĄ
  • _āĻĢāĻžāĻ‚
  • _āĻļā§‚āĻ¨ā§āĻ¯

Variable declaration

āĻ¨āĻžāĻŽ āĻŽāĻžāĻ¸ = ā§§;

Print statement

āĻĻā§‡āĻ–āĻžāĻ“ āĻŽāĻžāĻ¸;

If-else statement

āĻ¯āĻĻāĻŋ āĻŽāĻžāĻ¸ == ā§§ {
    āĻĻā§‡āĻ–āĻžāĻ“ "āĻœāĻžāĻ¨ā§ā§ŸāĻžāĻ°āĻŋ";
} āĻ…āĻĨāĻŦāĻž {
    āĻĻā§‡āĻ–āĻžāĻ“ "āĻœāĻžāĻ¨āĻž āĻ¨ā§‡āĻ‡";
}

List

āĻ¨āĻžāĻŽ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž = [ā§§, ā§¨, ā§Š, ā§Ē, ā§Ģ];
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž[ā§Ļ];

Record

āĻ¨āĻžāĻŽ āĻ¤āĻĨā§āĻ¯ =  @{
    "āĻ¨āĻžāĻŽ" -> "āĻ¸āĻŋāĻĢāĻžāĻ¤",
    "āĻŦā§ŸāĻ¸" -> ā§Ēā§¨,
    "āĻĢā§‹āĻ¨-āĻ¨āĻžāĻŽā§āĻŦāĻžāĻ°" -> ["ā§Ļā§§ā§­ā§§ā§§ā§§ā§§ā§§ā§§ā§§ā§§", "ā§Ļā§§ā§­ā§Šā§Šā§Šā§Šā§Šā§Šā§Šā§Š"],
};
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻ¨āĻžāĻŽ"];
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻŦā§ŸāĻ¸"];
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻĢā§‹āĻ¨-āĻ¨āĻžāĻŽā§āĻŦāĻžāĻ°"];

Loop statement

āĻ¨āĻžāĻŽ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž = [ā§§, ā§¨, ā§Š, ā§Ē, ā§Ģ];
āĻ¨āĻžāĻŽ āĻ‡āĻ¨ā§āĻĄā§‡āĻ•ā§āĻ¸ = ā§Ļ;
āĻ¨āĻžāĻŽ āĻ¯ā§‹āĻ—āĻĢāĻ˛ = ā§Ļ;
āĻ˛ā§āĻĒ {
    āĻ¯āĻĻāĻŋ āĻ‡āĻ¨ā§āĻĄā§‡āĻ•ā§āĻ¸ > ā§Ē {
        āĻĨāĻžāĻŽāĻžāĻ“;
    }
    āĻ¯ā§‹āĻ—āĻĢāĻ˛ = āĻ¯ā§‹āĻ—āĻĢāĻ˛ + āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž[āĻ‡āĻ¨ā§āĻĄā§‡āĻ•ā§āĻ¸];
    āĻ‡āĻ¨ā§āĻĄā§‡āĻ•ā§āĻ¸ = āĻ‡āĻ¨ā§āĻĄā§‡āĻ•ā§āĻ¸ + ā§§;
} āĻ†āĻŦāĻžāĻ°;
_āĻĻā§‡āĻ–āĻžāĻ“ "āĻĢāĻ˛āĻžāĻĢāĻ˛ = ";
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¯ā§‹āĻ—āĻĢāĻ˛;

Function declaration and function call

āĻĢāĻžāĻ‚ āĻœā§‹ā§œ(āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž) {
  āĻ¯āĻĻāĻŋ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž % ā§¨ == ā§Ļ {
    āĻĻā§‡āĻ–āĻžāĻ“ "āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžāĻŸāĻŋ āĻœā§‹ā§œ";
  } āĻ…āĻĨāĻŦāĻž {
    āĻĻā§‡āĻ–āĻžāĻ“ "āĻ¸āĻ‚āĻ–ā§āĻ¯āĻžāĻŸāĻŋ āĻŦāĻŋāĻœā§‹ā§œ";
  }
} āĻĢā§‡āĻ°āĻ¤;

āĻ¨āĻžāĻŽ āĻ¸ = ā§Ēā§¨;
āĻœā§‹ā§œ(āĻ¸);

Importing modules

Every pakhi source file is a module. Module can be imported with realtive path or absolute path.
Module import syntax: āĻŽāĻĄāĻŋāĻ‰āĻ˛ āĻŽāĻĄāĻŋāĻ‰āĻ˛-āĻ¨āĻžāĻŽ = "āĻŽāĻĄāĻŋāĻ‰āĻ˛-āĻĒāĻžāĻĨ";
Module use syntax: āĻŽāĻĄāĻŋāĻ‰āĻ˛-āĻ¨āĻžāĻŽ/āĻŽāĻĄāĻŋāĻ‰āĻ˛ā§‡āĻ°-āĻĢāĻžāĻ‚āĻļāĻ¨();

# āĻāĻŸāĻž āĻšāĻšā§āĻ›ā§‡ āĻ°ā§āĻŸ āĻŽāĻĄāĻŋāĻ‰āĻ˛ āĻĢāĻžāĻ‡āĻ˛: main.pakhi #
āĻŽāĻĄāĻŋāĻ‰āĻ˛ āĻŽā§āĻ¯āĻžāĻĨ = "math.pakhi";
āĻ¨āĻžāĻŽ āĻŦāĻžāĻšā§ = ā§Š;
āĻ¨āĻžāĻŽ āĻ•ā§āĻˇā§‡āĻ¤ā§āĻ°āĻĢāĻ˛ = āĻŽā§āĻ¯āĻžāĻĨ/āĻŦāĻ°ā§āĻ—(āĻŦāĻžāĻšā§);
āĻĻā§‡āĻ–āĻžāĻ“ āĻ•ā§āĻˇā§‡āĻ¤ā§āĻ°āĻĢāĻ˛;
# 
āĻāĻŸāĻž āĻšāĻšā§āĻ›ā§‡ āĻŽā§āĻ¯āĻžāĻĨ āĻŽāĻĄāĻŋāĻ‰āĻ˛ āĻĢāĻžāĻ‡āĻ˛: math.pakhi
āĻ°ā§āĻŸ āĻŽāĻĄāĻŋāĻ‰āĻ˛ āĻāĻ‡ āĻĢāĻžāĻ‡āĻ˛ āĻāĻ° āĻŦāĻ°ā§āĻ— āĻĢāĻžāĻ‚āĻļāĻ¨āĻ•ā§‡ āĻ‡āĻŽā§āĻĒā§‹āĻ°ā§āĻŸ āĻ•āĻ°ā§‡āĻ›ā§‡āĨ¤ 
#
āĻĢāĻžāĻ‚ āĻŦāĻ°ā§āĻ—(āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž) {
    āĻĢā§‡āĻ°āĻ¤ āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž * āĻ¸āĻ‚āĻ–ā§āĻ¯āĻž;
} āĻĢā§‡āĻ°āĻ¤;

Comment block

# āĻāĻ• āĻ˛āĻžāĻ‡āĻ¨ āĻ•āĻŽā§‡āĻ¨ā§āĻŸ #

# 
āĻŽāĻžāĻ˛āĻŸāĻŋ āĻ˛āĻžāĻ‡āĻ¨
āĻ•āĻŽā§‡āĻ¨ā§āĻŸ
#

# āĻ°ā§‡āĻ•āĻ°ā§āĻĄ āĻĄāĻŋāĻ•ā§āĻ˛ā§‡ā§ŸāĻžāĻ° āĻ•āĻ°āĻž #
āĻ¨āĻžāĻŽ āĻ¤āĻĨā§āĻ¯ =  @{
    "āĻ¨āĻžāĻŽ" -> "āĻ¸āĻŋāĻĢāĻžāĻ¤",
    "āĻŦā§ŸāĻ¸" -> ā§Ēā§¨,
    "āĻĢā§‹āĻ¨-āĻ¨āĻžāĻŽā§āĻŦāĻžāĻ°" -> ["ā§Ļā§§ā§­ā§§ā§§ā§§ā§§ā§§ā§§ā§§ā§§", "ā§Ļā§§ā§­ā§Šā§Šā§Šā§Šā§Šā§Šā§Šā§Š"],
};
#
āĻ°ā§‡āĻ•āĻ°ā§āĻĄ āĻĨā§‡āĻ•ā§‡ āĻŦā§āĻ¯āĻ•ā§āĻ¤āĻŋāĻ°
āĻ¨āĻžāĻŽ, āĻŦā§ŸāĻ¸, āĻĢā§‹āĻ¨ āĻ¤āĻĨā§āĻ¯
āĻĒā§āĻ°āĻŋāĻ¨ā§āĻŸ āĻ•āĻ°āĻž
#
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻ¨āĻžāĻŽ"];
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻŦā§ŸāĻ¸"];
āĻĻā§‡āĻ–āĻžāĻ“ āĻ¤āĻĨā§āĻ¯["āĻĢā§‹āĻ¨-āĻ¨āĻžāĻŽā§āĻŦāĻžāĻ°"];

Builtin functions and constants


How to get pakhi on my computer?

  • Download only pakhi-setup.exe from Assets
  • Complete setup
  • Write a pakhi program (Use any example from above)
  • Open Pakhi and browse source file
  • Run your program (extension should be .pakhi)
  • To run pakhi program from cmd or powershell add C:\Program Files\Pakhi\bin to your path environment variable. Note: Bangla text will not show properly

Supported by JetBrains