genc-lang
v0.1.7
Published
Gen C — a meme programming language with a real interpreter
Readme
WorksOnMyMachine (Gen C)
A programming language that actually works. On my machine, at least.
trustMeBro name = "Adarsh"
feature greet(person) {
ifThisWorks person == "Adarsh" {
flex("Hey " + person + ", you legend!")
} otherwise {
flex("Hello, " + person + ". Have you tried turning it off and on again?")
}
}
greet(name)
blameAI()Hey Adarsh, you legend!
The AI suggested this implementation. I am merely the victim.What is this?
Gen C is a real, interpreted programming language with developer-meme syntax and roast-first error messages.
Most meme languages are:
Funny + UselessGen C is:
Funny + Actually Programmable + Good Error Messages + Easy to ShipIt has a genuine tree-walk interpreter written in TypeScript — no JavaScript transpilation underneath. The AST evaluator, lexical scoping, closures, and recursive functions all work exactly as you'd expect from a real language. The only difference is that if is ifThisWorks and errors call you out personally.
Install
npm install -g Gen C
# or
pnpm add -g Gen CUsage
# Run a .gc file
genc run hello.gc
# Start the interactive REPL
genc repl
# Print version
Gen C --versionLanguage Reference
Variables
trustMeBro x = 42
trustMeBro name = "Adarsh"
trustMeBro isWorking = trueflex("Hello, World!")
flex("Score: " + x)Conditions
ifThisWorks x > 10 {
flex("Big number energy")
} otherwise ifThisWorks x > 0 {
flex("Smol but valid")
} otherwise {
flex("Bro what")
}Loops
trustMeBro i = 0
untilManagerArrives i < 5 {
flex(i)
i++
}Functions
feature add(a, b) {
shipIt a + b
}
trustMeBro result = add(3, 7)
flex(result) // 10Recursion
feature fib(n) {
ifThisWorks n < 2 {
shipIt n
}
shipIt fib(n - 1) + fib(n - 2)
}
flex(fib(10)) // 55Comments
// future me problem
/*
technical debt
starts here
*/Personality Features
These are the parts that make Gen C, Gen C.
panic()
panic("Production is on fire. Send help.")🔥🔥🔥 PANIC 🔥🔥🔥
Production is on fire. Send help.
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥Halts execution immediately. No recovery. Pour one out.
blameAI()
blameAI()The AI suggested this implementation. I am merely the victim.Prints an AI excuse and continues. Execution resumes. Dignity does not.
managerSaid {}
managerSaid {
flex("We need blockchain. And AI. And blockchain with AI.")
}[WARNING] Manager involvement detected. Proceed with caution.
We need blockchain. And AI. And blockchain with AI.Runs the block but logs a warning to stderr first. The code runs. Your soul doesn't.
techDebt {}
techDebt {
// I'll fix this later (I won't)
trustMeBro result = 9999
}+50 debt scoreRuns the block and increments your debt score. It accumulates across the program. There is no paying it off.
Error Messages
Gen C errors are honest about your failures.
| Situation | What you get |
|---|---|
| Syntax error | Compiler had a stroke at line 4. Expected ')' but found your confidence. |
| Undefined variable | Bro, who is 'x'? Nobody declared it. Not me. Not you. Nobody. |
| Type mismatch | You can't add a number to vibes. Line 12. |
| Division by zero | Divided by zero. Bold strategy. Line 7. |
| Infinite recursion | You called yourself too many times. Same energy as sending "hey" three times. |
| Missing return | feature ended without shipIt. Where are you going? |
Error messages include the offending source line and a ^ pointing exactly at the problem. Because you deserve to know what you did.
Examples
FizzBuzz
trustMeBro i = 1
untilManagerArrives i <= 20 {
ifThisWorks i % 15 == 0 {
flex("FizzBuzz")
} otherwise ifThisWorks i % 3 == 0 {
flex("Fizz")
} otherwise ifThisWorks i % 5 == 0 {
flex("Buzz")
} otherwise {
flex(i)
}
i++
}Closures
trustMeBro count = 0
feature increment() {
count++
shipIt count
}
flex(increment()) // 1
flex(increment()) // 2
flex(increment()) // 3The Full Meme Experience
trustMeBro name = "Adarsh"
feature greet(person) {
flex("Hello " + person)
ifThisWorks person == "Adarsh" {
flex("Senior Bug Creator")
} otherwise {
flex("Welcome to the codebase. I'm sorry.")
}
}
greet(name)
blameAI()
managerSaid {
flex("Add blockchain")
}
techDebt {
trustMeBro x = 1
flex("x = " + x)
}
panic("Deploying to production on a Friday.")Hello Adarsh
Senior Bug Creator
The AI suggested this implementation. I am merely the victim.
[WARNING] Manager involvement detected. Proceed with caution.
Add blockchain
x = 1
+50 debt score
🔥🔥🔥 PANIC 🔥🔥🔥
Deploying to production on a Friday.
🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥VS Code Extension
Gen C comes with a VS Code extension for syntax highlighting.
Install by opening the packages/vscode-Gen C/ folder in VS Code and pressing F5, or by packaging it with vsce package.
Features:
- Syntax highlighting for all keywords, strings, numbers, and comments
- Bracket matching and comment toggling
.gcfile association
Architecture
Gen C is a genuine interpreter — not a transpiler.
Source (.gc)
↓
Lexer Single-pass character scanner
↓ Produces Token[]
Parser Recursive descent, one method per grammar rule
↓ Produces Stmt[] AST
Interpreter Tree-walk evaluator
↓ Linked Environment scope chain
Output Lexical scoping, real closuresWritten in TypeScript with strict mode enabled. No runtime dependencies except commander for the CLI.
Philosophy
Rule 1: Everything should read like a developer meme.
Rule 2: Errors should be funnier than Stack Overflow answers.
Rule 3: The language should actually work.
Rule 3 is the most important one. The meme is the hook. The working interpreter is the point.
Contributing
Pull requests welcome. File issues for bugs. If you write something interesting in Gen C, share it.
License
MIT — do whatever you want with it. I accept no responsibility for production deployments.
Built by Adarsh with TypeScript, memes, and questionable life choices.
