feat: Initial release of AiraLang (v1.2.0 Next-Gen Engine)
This commit is contained in:
commit
243b52e2cb
14 files changed
+1848
No files matched your search
@@ -0,0 +1,35 @@
|
||||
# ===================================================
|
||||
# π AiraLang Hello World & Feature Test
|
||||
# π Creator: Adam Eehan (Aira Group of Technology)
|
||||
# ===================================================
|
||||
|
||||
say "π Hello, World from AiraLang Engine!";
|
||||
say "======================================";
|
||||
|
||||
let creator = "Adam Boss";
|
||||
let role = "Founder & CEO, Aira Group of Technology";
|
||||
let version = 1.0;
|
||||
|
||||
say "π Author: " + creator;
|
||||
say "πΌ Role: " + role;
|
||||
say "β‘ Version: " + version;
|
||||
|
||||
# Math Operations
|
||||
let a = 50;
|
||||
let b = 25;
|
||||
let sum = a + b;
|
||||
say "π’ Math Check (50 + 25): " + sum;
|
||||
|
||||
# Conditional Logic
|
||||
if (sum >= 75) {
|
||||
say "β
Status: AiraLang Core Engine is 100% Online & Functional!";
|
||||
} else {
|
||||
say "β Status: Error";
|
||||
}
|
||||
|
||||
# Function Definition & Execution
|
||||
fn greet(name) {
|
||||
return "π₯ Welcome to your own programming language, " + name + "! π";
|
||||
}
|
||||
|
||||
say greet(creator);
|
||||
@@ -0,0 +1,101 @@
|
||||
# ==========================================================
|
||||
# π AiraLang v1.2.0 Advanced Engine Feature Test
|
||||
# π Creator: Adam Eehan (Aira Group of Technology)
|
||||
# ==========================================================
|
||||
|
||||
say "π₯ AiraLang v1.2.0 Next-Gen Features Test Starting...";
|
||||
say "======================================================";
|
||||
|
||||
# 1. Testing for..in loops with break and continue
|
||||
say "[1] Testing For..In Loops & Range:";
|
||||
let fruits = ["Apple", "Mango", "Banana", "Orange"];
|
||||
for f in fruits {
|
||||
say " π Fruit: " + f;
|
||||
}
|
||||
|
||||
say " Looping through range(1, 5):";
|
||||
for i in range(1, 6) {
|
||||
if (i == 3) {
|
||||
say " β‘ Skipping 3 (continue)";
|
||||
continue;
|
||||
}
|
||||
say " π’ Number: " + i;
|
||||
}
|
||||
|
||||
# 2. Testing String & List Methods
|
||||
say "------------------------------------------------------";
|
||||
say "[2] Testing Native String & List Methods:";
|
||||
let greeting = " aira technology group ";
|
||||
say " Original : '" + greeting + "'";
|
||||
say " Trimmed : '" + greeting.trim() + "'";
|
||||
say " Upper : " + greeting.trim().upper();
|
||||
say " Length : " + greeting.trim().length;
|
||||
|
||||
let langs = ["C++", "Python"];
|
||||
langs.push("AiraLang");
|
||||
say " Updated List: " + langs.join(" -> ");
|
||||
say " Contains Python? " + langs.contains("Python");
|
||||
|
||||
# 3. Testing Try..Catch & Throw
|
||||
say "------------------------------------------------------";
|
||||
say "[3] Testing Exception Handling (Try / Catch / Throw):";
|
||||
try {
|
||||
say " Trying risky operation...";
|
||||
throw "Fatal Memory Overflow Exception (Simulated)";
|
||||
say " This line should never print!";
|
||||
} catch (err) {
|
||||
say " π‘οΈ Caught Exception Successfully: " + err;
|
||||
}
|
||||
|
||||
# 4. Testing Object-Oriented Programming (OOP - Classes & Instances)
|
||||
say "------------------------------------------------------";
|
||||
say "[4] Testing OOP (Classes, Instances, This, Methods):";
|
||||
class Agent {
|
||||
fn init(name, rank, power) {
|
||||
this.name = name;
|
||||
this.rank = rank;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
fn introduce() {
|
||||
return "π Agent " + this.name + " | Rank: " + this.rank + " | Power: " + this.power;
|
||||
}
|
||||
|
||||
fn boost(amount) {
|
||||
this.power = this.power + amount;
|
||||
say " β‘ Power boosted! New power: " + this.power;
|
||||
}
|
||||
}
|
||||
|
||||
let boss = new Agent("Adam Eehan", "CEO & AI Architect", 100);
|
||||
say " " + boss.introduce();
|
||||
boss.boost(50);
|
||||
say " " + boss.introduce();
|
||||
|
||||
# 5. Testing Crypto / Hash Module
|
||||
say "------------------------------------------------------";
|
||||
say "[5] Testing Built-in Crypto Module:";
|
||||
import "crypto";
|
||||
let secret = "AdamBoss_AiraTech_2026";
|
||||
let hash_val = crypto.sha256(secret);
|
||||
let b64_val = crypto.b64encode(secret);
|
||||
say " Secret String : " + secret;
|
||||
say " SHA-256 Hash : " + hash_val;
|
||||
say " Base64 Encode : " + b64_val;
|
||||
say " Base64 Decode : " + crypto.b64decode(b64_val);
|
||||
|
||||
# 6. Testing HTTP Module (Status check)
|
||||
say "------------------------------------------------------";
|
||||
say "[6] Testing HTTP Module:";
|
||||
import "http";
|
||||
let test_url = "https://httpbin.org/get";
|
||||
try {
|
||||
say " Connecting to " + test_url + "...";
|
||||
let status_code = http.status(test_url);
|
||||
say " HTTP Response Status: " + status_code;
|
||||
} catch (net_err) {
|
||||
say " Network offline or error handled: " + net_err;
|
||||
}
|
||||
|
||||
say "======================================================";
|
||||
say "β
ALL ADVANCED FEATURES TESTED & 100% OPERATIONAL! π";
|
||||
@@ -0,0 +1,60 @@
|
||||
# ===================================================
|
||||
# [*] AiraLang v1.1.0 Standard Library & Modules Test
|
||||
# [*] Author: Adam Eehan (Aira Group of Technology)
|
||||
# ===================================================
|
||||
|
||||
say "[*] Testing Built-in Standard Library Modules...";
|
||||
say "-----------------------------------------------";
|
||||
|
||||
# 1. Math Module Test
|
||||
import "math";
|
||||
let sq = math.sqrt(64);
|
||||
let rnd = math.random(1, 100);
|
||||
say "[+] Math Sqrt(64) : " + sq;
|
||||
say "[+] Math Random(1-100) : " + rnd;
|
||||
say "[+] Math PI : " + math.pi;
|
||||
|
||||
# 2. Time Module Test
|
||||
import "time";
|
||||
let current_time = time.now();
|
||||
say "[+] Current Timestamp : " + current_time;
|
||||
|
||||
# 3. OS Module Test (Terminal commands)
|
||||
import "os";
|
||||
let kernel = os.cmd("uname -o");
|
||||
let user_dir = os.cwd();
|
||||
say "[+] OS Kernel : " + kernel;
|
||||
say "[+] Current Directory : " + user_dir;
|
||||
|
||||
# 4. File Module Test
|
||||
import "file";
|
||||
let test_file = "aira_temp.txt";
|
||||
file.write(test_file, "AiraLang File I/O Engine Working!");
|
||||
let read_back = file.read(test_file);
|
||||
say "[+] File Read Result : " + read_back;
|
||||
file.delete(test_file);
|
||||
say "[+] Temporary File Cleaned Up!";
|
||||
|
||||
# 5. Data Structures (Lists & Dictionaries)
|
||||
let profile = {
|
||||
"name": "Adam Boss",
|
||||
"role": "Founder & CEO",
|
||||
"power": 100
|
||||
};
|
||||
say "[+] Profile Name : " + profile["name"];
|
||||
say "[+] Profile Role : " + profile["role"];
|
||||
|
||||
let tools = ["AiraLang", "Termux", "CyberSecurity"];
|
||||
say "[+] First Tool : " + tools[0];
|
||||
append(tools, "NeuralEngine");
|
||||
say "[+] Updated Tools List : " + tools;
|
||||
|
||||
# 6. JSON Module Test
|
||||
import "json";
|
||||
let raw_json = '{"project": "AiraLang", "version": "1.1.0", "status": "Ready"}';
|
||||
let parsed = json.parse(raw_json);
|
||||
say "[+] JSON Parsed Project : " + parsed["project"];
|
||||
say "[+] JSON Parsed Version : " + parsed["version"];
|
||||
|
||||
say "-----------------------------------------------";
|
||||
say "[+] ALL BASIC MODULES TESTED & 100% OPERATIONAL!";
|
||||
Reference in new issue
Block a user