AltFLang is a small, complete programming language with Hindi-rooted keywords. Write rakho, agar and karya — a real lexer, parser and interpreter run it instantly in your browser. No install, no account, no server.
// AltFLang — likho jaise bolte ho.
rakho naam = "Duniya";
rakho ginti = 3;
karya namaste(kisko) {
lautao "Namaste, " + kisko + "!";
}
chalo (rakho i = 0; i < ginti; i = i + 1) {
bol(namaste(naam), "(" + shabd(i + 1) + ")");
}
agar (ginti > 2) {
bol("Teen baar bol diya.");
} warna {
bol("Aur bolna hai?");
}AltFLang started as an answer to a simple question: what if the keywords matched the language you think in?
rakho, bol, agar, warna, jab_tak, karya, lautao. Fifteen keywords make up the entire language — most people can read an AltFLang program before they have read the docs.
A hand-written lexer, parser and tree-walking interpreter, all in client-side JavaScript. There is no compile server and no execution API, so your code never leaves the tab.
Closures, recursion, arrays, objects, a small standard library, and errors that report the exact line and column instead of failing silently.
AltFLang is not shorter than JavaScript, and it does not pretend to be. It is the same control flow, the same semantics — with the vocabulary swapped for one that a Hindi speaker can read at a glance.
function fizzBuzz(limit) {
for (let i = 1; i <= limit; i++) {
if (i % 15 === 0) {
console.log("FizzBuzz");
} else if (i % 3 === 0) {
console.log("Fizz");
} else if (i % 5 === 0) {
console.log("Buzz");
} else {
console.log(i);
}
}
}
fizzBuzz(15);karya fizzBuzz(seema) {
chalo (rakho i = 1; i <= seema; i = i + 1) {
agar (i % 15 == 0) {
bol("FizzBuzz");
} warna agar (i % 3 == 0) {
bol("Fizz");
} warna agar (i % 5 == 0) {
bol("Buzz");
} warna {
bol(i);
}
}
}
fizzBuzz(15);Fifteen keywords and a small standard library. If you know what these mean, you know AltFLang.
| Keyword | What it does | In JavaScript |
|---|---|---|
| rakho | Declare a variable | let |
| pakka | Declare a constant | const |
| bol | Print to the console | console.log |
| agar / warna | Branch on a condition | if / else |
| jab_tak | Loop while a condition holds | while |
| chalo | Counted loop | for |
| karya | Define a function | function |
| lautao | Return a value | return |
| bhang / aage | Break out / skip ahead | break / continue |
| sahi / galat | Boolean literals | true / false |
| khali | The empty value | null |
Plus built-ins for length, type checks, list operations and maths: lambai, prakar, jodo, nikalo, sankhya, shabd, samay and ganit. Full reference lives in the playground’s docs panel.
The playground opens with a working program, a full editor and the language reference one click away. Nothing to install.
Launch the PlaygroundAltFLang is v1.0 and still growing. Leave your email and we’ll send you early access when new keywords and playground features land.