naharul-lang-cli
v1.0.0
Published
Naharul Lang - Bangla-flavored toy programming language. File extension: .ni
Maintainers
Readme
Naharul Lang 🇧🇩
Bangla-flavored toy programming language. File extension: .ni
bhailang theke inspired hoye banano - kintu nijer keyword shoho.
Install
npm install -g naharul-lang-cliRun kora
naharul amar-code.niSyntax
Program structure
Shob program naharul start diye shuru hoy ar naharul end diye shesh hoy.
naharul start
...code...
naharul endPrint kora
bolo naharul "Hello World!";
bolo naharul "Value:", a;Variable
Kono special keyword lagena, shoja = diye assign korle hobe.
a = 10;
b = "ekta string";
c = true;
d = null;If / Else-if / Else
jodi (boyosh < 13) {
bolo naharul "Bacha";
} abar (boyosh < 20) {
bolo naharul "Teenager";
} nahola {
bolo naharul "Boro manush";
}Loop (for)
easy loop (i = 0; i < 10; i = i + 1) {
bolo naharul i;
}Break
thamo; likhle loop ba switch theke bairer hoye jaben.
easy loop (i = 0; i < 10; i = i + 1) {
jodi (i == 5) {
thamo;
}
bolo naharul i;
}Function
faa welcome(naam) {
bolo naharul "Welcome,", naam;
}
welcome("Naharul");Switch case
switch on(din) {
1:
bolo naharul "Sombar";
thamo;
2:
bolo naharul "Mongolbar";
thamo;
default:
bolo naharul "Janina";
}True / False / Null
a = true;
b = false;
c = null;Keyword Table
| Keyword | Kaaj |
|---|---|
| naharul start | Program shuru |
| naharul end | Program shesh |
| bolo naharul | Print kora |
| jodi | if |
| abar | else if |
| nahola | else |
| easy loop() | for loop |
| true | boolean true |
| false | boolean false |
| thamo | break |
| null | empty/faka value |
| faa | function declare |
| switch on() | switch-case |
| default | switch er default case |
Operators
+ - * / % == != < > <= >= && || !
Examples
examples/ folder e kichu sample code ache:
hello.ni- shoja print + variableif-else.ni- jodi/abar/naholaloop.ni- easy loop + thamofunction.ni- faa functionswitch.ni- switch on()
License
MIT
