IlmLang (ilm)
IlmLang is an Islamic programming language created by Masud Shafin Ahmed (@besaoct) out of boredom. Written purely in Rust, it blends programming concepts with Islamic terminology, offering a unique and fun way to code. This is version 0.1, an early but functional release.
Features
IlmLang currently supports the following syntax:
bismillah
maktub real_name = "Shafin"; // Declare a variable
maktub a = 4; // Integer variable
maktub b = 2;
// ignore this line // Single line comment
istima userName; // Read user input into a variable
qawl_("\nPrinting user input: $userName"); // Print with newline
qawl_("$a, $b - ${a + b}, ${a * b}, ${a / b}, ${a % b}"); // Interpolation with expressions
qawl_(" ${6+6}"); // Simple expression evaluation
qawl_("Assalamu'Alaikum $real_name"); // Greeting with variable
tajdid real_name = "Ahmed"; // Reassign a variable
qawl("$real_name with new line without using qawl_\n"); // Print without newline function
qawl("Assalamu'Alaikum $real_name");
/*
This is a
comment block.
It will not be executed.
*/
alhamdulillah
Syntax Explanation
bismillah: Marks the start of the program (likemain()in other languages).maktub: Declares a variable (e.g.,maktub a = 4;is likelet a = 4;in Rust).istima: Reads user input into a variable.qawl: Prints output without a newline.qawl_: Prints output with a newline.${expression}: Evaluates expressions inside strings (e.g.,${a + b}).tajdid: Reassigns a variable’s value./* */: Block comments, ignored by the interpreter.//: Single line comment, ignored by the interpreter.alhamdulillah: Marks the end of the program.
This example demonstrates variable declaration, input/output, string interpolation, and comments.
Prerequisites
Since IlmLang is written in pure Rust, you’ll need the following to run it:
-
Rust: The Rust programming language and its package manager, Cargo.
-
Install Rust via rustup:
|-
Follow the prompts, then run:
-
Verify installation:
-
-
-
A Terminal: Any terminal to execute commands (e.g., Terminal on macOS/Linux, Command Prompt/PowerShell on Windows).
-
VS Code (Optional): For syntax highlighting support (see commands below).
Installation
To install IlmLang, use Cargo to fetch and build it from crates.io:
-
This installs the
milafbinary (version0.1) to~/.cargo/bin/. -
Ensure
~/.cargo/bin/is in your PATH:-
If not, add it (e.g., in
~/.bashrcor~/.zshrc):
-
Verify installation:
- Output:
0.1
Commands
IlmLang provides the following commands via the milaf CLI:
-
Run a Program:
-
Example:
- Runs the
.ilmfile and outputs the result (e.g., “Masha’Allah!” on success).
- Runs the
-
-
Check Version:
- Output:
0.1
- Output:
-
Show Help:
-
Displays usage and available commands:
)
-
-
Enable VS Code Syntax Highlighting:
- Installs the IlmLang VS Code extension for syntax highlighting and file icons.
- After running, restart VS Code to see
.ilmfiles highlighted (e.g., comments dimmed, keywords colored).
Example Usage
-
Create a file
example.ilmwith the code above. -
Run it:
-
Sample interaction:
> ilm <enter |
-
About the Author
IlmLang is a passion project by Masud Shafin Ahmed (@besaoct), created for fun and to explore programming with an Islamic twist. Follow the project on GitHub: github.com/besaoct/ilm.