"Rishtey mein toh hum tumhare compiler lagte hain!"
AmitabhC is an esoteric programming language where every keyword is an Amitabh Bachchan film, character, or dialogue. Variables are VIJAY. Constants are DON. Errors are iconic dialogues. This isn't just a language — it's a statement.
npm install -g amitabhcamitabhc run hello.amitabhc
amitabhc repl # Interactive mode
amitabhc examples # List examples
amitabhc test # Run 60 testsOr use the web playground — no install needed:
LIGHTS
CAMERA
BOLO "Namaste, Duniya!"
ACTION
LIGHTS
CAMERA
VIJAY hero = "Amitabh"
DON FILMS = 200
BOLO "Star: ${hero}, Films: ${FILMS}"
VIJAY top[] = {"Deewar", "Sholay", "Don", "Agneepath"}
HAR EK film MEIN top
BOLO " ${film}"
KHATAM
ACTION
LIGHTS
CAMERA
NAAM factorial(n)
AGAR n <= 1
WAPAS 1
BAS
WAPAS n * factorial(n - 1)
PURA
BOLO "10! = ${factorial(10)}"
ACTION
LIGHTS
CAMERA
AGNEEPATH
VIJAY x = 10 / 0
MRITYU err
BOLO "Caught: ${err}"
PRATIGYA
BOLO "Cleanup done"
KHATAM
ACTION
LIGHTS
CAMERA
VIJAY grade = "A"
KBC_SAWAAL grade
OPTION "A"
BOLO "Excellent!"
OPTION "B"
BOLO "Good"
SAHI_JAWAB
BOLO "Keep trying"
AGLE_SAWAAL
ACTION
PROGRAM: LIGHTS ... CAMERA ... ACTION
VARIABLE: VIJAY x = 10
CONSTANT: DON PI = 3.14
ARRAY: VIJAY a[] = {1, 2, 3}
DICT: VIJAY d = DEEWAR_BANAO{"k": "v"}
PRINT: BOLO "text"
INPUT: SUNO variable
IF: AGAR cond ... NAHI TOH ... BAS
FOR: BAAR BAAR N MEIN i ... KHATAM
WHILE: JAB TAK cond ... RAHEGA
DO-WHILE: ZANJEER_LOOP ... TAB TAK cond
FOR-EACH: HAR EK x MEIN arr ... KHATAM
FUNCTION: NAAM f(a, b) ... WAPAS val ... PURA
TRY-CATCH: AGNEEPATH ... MRITYU e ... PRATIGYA ... KHATAM
SWITCH: KBC_SAWAAL val ... OPTION x ... SAHI_JAWAB ... AGLE_SAWAAL
BREAK: DEEWAR
CONTINUE: SILSILA
TRUE: SHAKTI
FALSE: KAALIA
NULL: LAAWARIS
6 namespaces, each named after an Amitabh Bachchan film:
| Namespace | Film | Purpose | Methods |
|---|---|---|---|
| SHAHENSHAH | Shahenshah (1988) | Strings | length, uppercase, lowercase, contains, replace, trim, split, reverse, repeat, ... (19 total) |
| COOLIE | Coolie (1983) | Math | abs, floor, ceil, round, sqrt, pow, min, max, random, sin, cos, tan, log, PI, E |
| KHAZANA | Treasure | Arrays | length, push, pop, shift, unshift, slice, join, reverse, includes, indexOf, concat, sort |
| NASEEB | Naseeb (1981) | Time | abhi, saal, mahina, din, ghanta, minute, second, tarikh, waqt, timestamp |
| ZANJEER | Zanjeer (1973) | Types | type, isAnk, isShabd, isKhazana, isShaktiKaalia, isLaawaris, isDeewar, toAnk, toShabd, toShaktiKaalia |
| DEEWAR | Deewar (1975) | Dicts | keys, values, hasKey, remove, size, merge |
When your code fails, AmitabhC delivers Amitabh dialogues:
| Error | Dialogue |
|---|---|
| Undefined variable | "Don ko pakadna mushkil hi nahi, naamumkin hai!" |
| Stack overflow | "Deewar bahut oonchi ho gayi!" |
| Division by zero | "Zero se divide kaise kar sakte hain?" |
| Constant reassignment | "Main aaj bhi phenke hue paise nahin uthata!" |
| Type mismatch | "Aaj mere paas type hai, tumhare paas kya hai?" |
| Array out of bounds | "Hum jahan khade hote hain, line wahi se shuru hoti hai!" |
| Feature | AmitabhC | ArnoldC | LOLCODE |
|---|---|---|---|
| Theme | Amitabh Bachchan | Schwarzenegger | Internet memes |
| Variables | VIJAY x = 5 |
DECLARE x |
I HAS A x ITZ 5 |
BOLO "text" |
TALK TO THE HAND "text" |
VISIBLE "text" |
|
| Functions | NAAM ... PURA |
N/A | HOW IZ I ... IF U SAY SO |
| Error handling | AGNEEPATH / MRITYU |
N/A | N/A |
| Namespaces | 6 built-in | N/A | N/A |
| Dictionaries | DEEWAR_BANAO{...} |
N/A | N/A |
| Switch-case | KBC_SAWAAL |
N/A | N/A |
| Do-while | ZANJEER_LOOP |
N/A | N/A |
| Runtime | Browser + Node.js CLI | JVM | Interpreter |
Syntax highlighting and 20+ snippets for .amitabhc files. See vscode-extension/.
- Language Bible — Complete specification
- Tutorial — Step-by-step learning guide
- Cheat Sheet — Quick reference
- API Reference — All functions documented
- Examples — 15+ example programs
npm test # or
node tests/run_tests.js60 tests covering all language features.
- Fork the repository
- Create a branch (
git checkout -b feature/your-feature) - Commit your changes
- Open a Pull Request
Valued contributions: new examples, more Amitabh error dialogues, additional namespace methods, docs, bug fixes.
MIT License. See LICENSE.
"Aaj khush toh bahut hoge tum... ki tumne AmitabhC mein code kiya."
Made by jay123anta