| Crates.io | ilm_core |
| lib.rs | ilm_core |
| version | 0.1.6 |
| created_at | 2025-03-01 21:51:29.347793+00 |
| updated_at | 2025-03-03 20:34:31.467484+00 |
| description | Core language logic for ilm programming |
| homepage | |
| repository | https://github.com/besaoct/ilm/tree/main/ilm_core |
| max_upload_size | |
| id | 1574042 |
| size | 84,955 |
ilm is a playful, Islamic-themed programming language designed for learning and experimentation. It integrates programming concepts with Islamic terminology, requiring every program to start with bismillah and end with alhamdulillah. The language uses Arabic-inspired keywords while maintaining full programming functionality. The file extension is .ilm, symbolizing "Ilm" (Knowledge).
| Keyword | Meaning | Equivalent |
|---|---|---|
bismillah |
Start of the program (Mandatory) | Program start |
alhamdulillah |
End of the program (Mandatory) | Program end |
| Keyword | Meaning | Equivalent |
|---|---|---|
maktub |
Declare a variable (mutable) | let, var |
qadr |
Declare a constant (immutable) | const, final |
hazf |
Delete a variable | del |
tajdid |
Reassign a variable | Assignment (=) |
| Keyword | Meaning | Equivalent |
|---|---|---|
qawl |
Print output (no newline) | print(), console.log() |
qawl_ |
Print output (with newline) | println(), console.log() + \n |
istima |
Take input from user | input(), scanf() |
kitaba |
Write to a file | write() |
qiraa |
Read from a file | read() |
| Keyword | Meaning | Equivalent |
|---|---|---|
takrar |
Loop (repeat something) | while, for |
khuruj |
Break (exit loop) | break |
istimrar |
Continue execution in loop | continue |
li_kull |
For-each loop | forEach |
| Keyword | Meaning | Equivalent |
|---|---|---|
idha |
If condition | if |
aw_idha |
Else if condition | else if |
illa |
Else condition | else |
intikhab |
Switch statement | switch |
hala |
Case in switch | case |
iftiradi |
Default case in switch | default |
khuruj |
Break in switch | break |
| Keyword | Meaning | Equivalent |
|---|---|---|
wazifa |
Define a function | def, function |
raj |
Return from function | return |
nidaa |
Call a function | Function call |
mukarrar |
Recursive function call | Recursion |
| Keyword | Meaning | Equivalent |
|---|---|---|
adad |
Number (integer/float) | int, float |
kalima |
String (text data) | string |
haqq |
Boolean true |
true |
baatil |
Boolean false |
false |
fard |
Single value (scalar) | Scalar type |
| Keyword | Meaning | Equivalent |
|---|---|---|
mashallah |
Success message | Success message |
inshallah_sabrun |
General error: "Patience, try again" | General error |
astaghfirullah |
Syntax error message | Syntax error |
inna_lillahi |
Runtime error message | Runtime error |
la_hawla |
Null/uninitialized variable error | Null error |
subhanallah |
Unexpected exception | Uncaught exception |
| Keyword | Meaning | Equivalent |
|---|---|---|
/* tafsir */ |
Multi-line & single-line comments | /* ... */ |
| Keyword | Meaning | Equivalent |
|---|---|---|
asghar |
Convert to lowercase | .toLowerCase() |
akbar |
Convert to uppercase | .toUpperCase() |
jam |
Sum of numbers in a list | sum() |
hijri_sana |
Get current Hijri year | getHijriYear() |
taftish |
Check if value exists in list | contains() |
tartib |
Sort a list | sort() |
qis |
Split a string | split() |
ilhiq |
Join strings or lists | join() |
| Keyword | Meaning | Equivalent |
|---|---|---|
saff |
List (array) | list, array |
idafa |
Append to a list | push(), append() |
istikhraj |
Remove from list | pop(), remove() |
toul |
Length of a list/string | len(), length |
wa |
Boolean logic: "and" | &&, and |
aw |
Boolean logic: "or" | ` |
laysa |
Boolean logic: "not" | !, not |
zawji |
Even number check | is_even() |
fardi |
Odd number check | is_odd() |
baqi |
Divide and return remainder | modulo, % |
miftah |
Dictionary / Object | dict, object |
fath |
Open a resource (file/socket) | open() |
ighlaq |
Close a resource | close() |
sabab |
Try-catch block (try) | try |
istithnaa |
Try-catch block (catch) | catch |
Below are the key functionalities of ilm with examples to demonstrate their usage.
Every program must begin with bismillah and end with alhamdulillah.
bismillah
qawl("Hello, World!");
alhamdulillah
Output: Hello, World!
maktub: Mutable variable declaration.tajdid: Reassign a variable.qadr: Immutable constant.bismillah
maktub x = 5;
tajdid x = 10;
qadr y = 15;
qawl(x + y);
alhamdulillah
Output: 25
qawl: Prints without newline.qawl_: Prints with newline (\n is also supported).istima: Takes user input.bismillah
maktub name = istima("What is your name? ");
qawl("Assalamu Alaikum, ");
qawl_(name);
qawl("How are you?\nToday is good.");
alhamdulillah
Input: Aisha
Output:
Assalamu Alaikum, Aisha
How are you?
Today is good.
+, -, *, /, % (via baqi).$variable or ${expression}.bismillah
maktub a = 4;
maktub b = 5;
qawl_("$a $b"); /* Prints values */
qawl_("${a + b}"); /* Prints sum */
qawl_("${4 * 3}"); /* Prints multiplication */
qawl_("${a - 2}"); /* Prints subtraction */
alhamdulillah
Output:
4 5
9
12
2
takrar: While loop.li_kull: For-each loop.bismillah
maktub i = 0;
takrar (i < 3) {
qawl_(i);
tajdid i = i + 1;
}
saff fruits = ["Tuffah", "Mawz", "Rumman"];
li_kull fruit in fruits {
qawl_(fruit);
}
alhamdulillah
Output:
0
1
2
Tuffah
Mawz
Rumman
idha, aw_idha, illa: If-else structure.bismillah
maktub num = 10;
idha (num > 0) {
qawl_("Positive");
} aw_idha (num < 0) {
qawl_("Negative");
} illa {
qawl_("Zero");
}
alhamdulillah
Output: Positive
wazifa: Define a function.nidaa: Call a function.bismillah
wazifa greet(name) {
raj "Assalamu Alaikum, " + name;
}
qawl_(nidaa greet("Zayd"));
alhamdulillah
Output: Assalamu Alaikum, Zayd
saff: List declaration.idafa: Append to list.tartib: Sort list.bismillah
saff numbers = [3, 1, 4];
idafa numbers 2;
tartib numbers;
qawl_(numbers);
alhamdulillah
Output: [1, 2, 3, 4]
sabab and istithnaa: Try-catch block.bismillah
sabab {
maktub x = 5 / 0;
} istithnaa {
qawl_("inna_lillahi");
}
alhamdulillah
Output: inna_lillahi
/* tafsir */: Single or multi-line comments.bismillah
/* tafsir: This is a greeting program */
qawl_("Assalamu Alaikum");
alhamdulillah
Output: Assalamu Alaikum
.ilm → Represents "Ilm" (Knowledge).