Brainrot: The Meme Programming Language No One Asked For But I Made Anyway
You probably woke up this morning thinking, “What if there was a programming language that replaced every single keyword with internet slang?” Well, you can rest easy, because Brainrot exists. If you thought C was too boring and lacked the necessary memetic energy, you’re in for a treat. Yes, you can now write a for loop by typing flex. Isn’t that what you’ve always wanted?
🤔 What Even Is Brainrot?
Great question, hypothetical person! Brainrot is a C-like language that’s less about practicality and more about how hard we can meme while pretending it’s educational. It’s designed using Flex and Bison — because why not borrow tools that actual grown-up programming languages use, right? But instead of taking things seriously, we swap out sensible keywords for things like skibidi for void and rizz for int. The kind of stuff that will absolutely confuse anyone unfortunate enough to read your code.
Here’s a brief glimpse into the disaster that is Brainrot:
skibidi main {
rizz i;
flex (i = 0; i < 10; i = i + 1) {
yapping("Skibidi toilet");
}
bussin 0;
}
Isn’t that just chef’s kiss? Why would you ever go back to normal keywords like int or return when you can shout memes at your compiler?
How It’s Made (With Blood, Sweat, and Bison)
You’re probably wondering how such a masterclass in meme-inspired programming came to be. Spoiler alert: it involves Flex and Bison, tools usually reserved for sensible tasks like building real programming languages.
Let’s pretend for a second that you actually want to generate your own language. After all, if you’re reading this, there’s probably something deeply wrong with you (and us, too, let’s be honest). So here’s the rundown of how to generate a parser for Brainrot using Flex and Bison.
Step 1: Install the Stuff
You’ll need the usual suspects: GCC, Flex, and Bison. If you’re a Linux user, it’s a simple `sudo apt-get install`, and if you’re on macOS using Homebrew, congrats! You get the bonus privilege of using `brew install`. Lucky you.
sudo apt-get update
sudo apt-get install gcc flex bison
Step 2: Clone the Tragedy
Because apparently, there’s no turning back now:
git clone https://github.com/araujo88/brainrot.git
cd brainrot
Step 3: Generate the Parser (A.K.A. Magic)
Run the following commands, and watch in awe as Flex and Bison transform this garbage fire of a language into something that, technically, works.
bison -d -Wcounterexamples lang.y -o lang.tab.c
flex -o lang.lex.c lang.l
gcc lang.lex.c lang.tab.c -o lang_parser -lfl
I used Bison to generate the parser, because using something more modern would imply that I care about things like usability or, you know, sanity. Flex handles the lexical analysis — think of it as the compiler’s way of saying, “Sure, I guess I’ll let you use ‘bussin’ as ‘return’.”
Step 4: Profit (Or Whatever)
Now that you’ve built the compiler, you can actually write Brainrot programs. You’ll never use this in production (please, for the love of everything sacred, don’t), but you can show it off to your friends as the epitome of irony. The resulting binary, lang_parser, is where the magic happens.
To run your Brainrot program, use this:
./lang_parser < test.brainrot
Brainrot does what you’d expect a meme language to do — yell out `”Hello, World!”` in a way that guarantees you’ll lose some friends.
Understanding Brainrot (God Help Us)
Let’s break down Brainrot, though we’re pretty sure any sane person wouldn’t want to:
- skibidi is void. Obviously.
- rizz is int because I thought “Yeah, that’s how variables should be declared now.”
- flex is for, and honestly, if you’re flexible enough to use this language, more power to you.
- bussin? Oh, that’s return, but without any of the elegance or sense.
The language supports basic arithmetic, conditionals, loops, and, of course, meme-inspired mayhem. But don’t expect anything fancy. Arrays? No. Functions other than main? Who do you think I am, the whole C++ standards committee?
What’s Next?
Who knows, really? You could continue to use Brainrot to frustrate your coworkers or maybe teach a compiler course (which, by the way, would be the single greatest act of sabotage in modern education). You could even add support for more meme keywords, but if you do, please seek help.
Conclusion
Alright, so imagine you’re sitting in your goon cave, sigma grindset engaged, rizzing up variables like Baby Gronk on the grind, flexing that skibidi
main function while dodging sussy bakas trying to hit you with a bug—like bruh, only in Ohio, right? You’re out here writing code that’s bussing harder than a Grimace shake and bussin
that return statement like it’s hitting the gritty. No edging
in your loops, dawg, this ain’t Garten of Banban, it’s Brainrot—the programming language where every line of code is hitting like a Kai Cenat compilation, poggers.
Brainrot exists. I made it. I’m not proud, but I did it. It’s a reminder that just because you can do something doesn’t mean you should. But if you, for some unfathomable reason, want to suffer through writing your own meme-inspired programming language, now you know how.
Just don’t say I didn’t warn you.
VS-Code syntax highlighting extension: https://github.com/araujo88/brainrot-vscode-support