A Meme-Fueled Journey into Compiler Design, Internet Slang, and Skibidi Toilets
- Foreword
- Introduction
- What Is Brainrot?
- Installation and Requirements
- Building the Compiler
- Basic Usage
- Language Reference
- 7.1. Keywords
- 7.2. Operators
- 7.3. Control Flow (if, for, while, do-while, switch)
- 7.4. Declarations and Variables (
rizz
) - 7.5. Return Statements (
bussin
) - 7.6. Built-In Functions
- Extended User Documentation
- 8.1.
yapping
- 8.2.
yappin
- 8.3.
baka
- 8.4.
ragequit
- 8.5.
chill
- 8.1.
- Limitations
- Known Issues
- Cultural Context: The Rise of ‘Brain Rot’
- Meme Culture, Oxford Word of the Year, and Brainrot
- Contributing
- License
- Closing Thoughts
“What if there was a programming language that replaced every single keyword with internet slang?” That single question captures the essence of Brainrot: a meme-inspired, C-like language that breaks all expectations (and possibly your sanity). Originally built as a playful experiment, Brainrot demonstrates that, with enough Flex, Bison, and questionable design decisions, you can turn your wildest meme dreams into compilable code.
Brainrot might not be the language you asked for, but it might just be the language you need—especially if you’re looking for a hilarious way to learn about lexical analysis and parsing. The entire approach is to replace traditional C keywords with slang from TikTok, Gen Z memes, and beyond:
skibidi
forvoid
rizz
forint
flex
forfor
bussin
forreturn
goon
forwhile
mewing
for 'do'- and so on...
What’s the result? A language that looks thoroughly bizarre yet compiles into something resembling real (albeit comedic) logic. It’s a testament to how robust compiler design is—once you set up the grammar, your code can say practically anything it wants, so long as it follows syntactic rules.
Brainrot is a meme-inspired programming language, described by some as “the supposed deterioration of a person’s mental or intellectual state.” Of course, that’s part of the joke! The real intent is to offer an irreverent but educational environment for exploring how compilers work, how tokens are defined, and how parse trees are built. Instead of standard C, you’ll be greeted by keywords like:
skibidi main
: The entry point (likeint main()
).flex (i = 0; i < 10; i = i + 1)
: Afor
loop, but more ridiculous.bussin 0;
: Thereturn 0;
you’re used to—but with none of the seriousness.
Everything is overshadowed by the comedic vibe that references modern internet slang. The “brain rot” concept stands for the comedic notion that these memes can degrade your intellectual faculties—yet ironically, you still have to know how compilers work to build Brainrot.
To compile Brainrot from source, you’ll need:
- GCC (GNU Compiler Collection)
- Flex (Fast Lexical Analyzer)
- Bison (Parser Generator)
Installation commands vary by platform:
sudo apt-get update
sudo apt-get install gcc flex bison libfl-dev
sudo pacman -S gcc flex bison
brew install gcc flex bison
Note: If you encounter
libfl
issues on macOS, you may need to locate and symlinklibfl.dylib
manually, as outlined in the README.
- Clone the repository:
git clone https://github.com/araujo88/brainrot.git cd brainrot
- Generate the parser and lexer:
bison -d -Wcounterexamples lang.y -o lang.tab.c flex -o lang.lex.c lang.l
- Compile:
gcc -o brainrot lang.tab.c lex.yy.c ast.c -lfl
- Alternatively, run:
This will produce the
make
brainrot
executable if everything goes smoothly.
To run your first Brainrot program:
- Create a file (e.g.,
hello.brainrot
):skibidi main { yapping("Hello, World!"); bussin 0; }
- Execute it:
The compiler interprets the code, prints “Hello, World!”, and ends with
./brainrot < hello.brainrot
bussin 0
(akin toreturn 0;
).
Brainrot replaces familiar C keywords with meme-inspired slang:
Brainrot | C Equivalent |
---|---|
skibidi | void |
rizz | int |
cap | bool |
cooked | auto |
flex | for |
bussin | return |
edgy | if |
amogus | else |
goon | while |
bruh | break |
grind | continue |
chad | float |
gigachad | double |
yap | char |
deadass | const |
sigma rule | case |
based | default |
mewing | do |
gyatt | enum |
whopper | extern |
cringe | goto |
giga | long |
smol | short |
nut | signed |
maxxing | sizeof |
salty | static |
gang | struct |
ohio | switch |
chungus | union |
nonut | unsigned |
schizo | volatile |
W | true |
L | false |
Brainrot supports common arithmetic and logical operators:
+
Addition-
Subtraction*
Multiplication/
Division%
Modulus<
,>
,<=
,>=
,==
,!=
=
Assignment&&
Logical AND||
Logical OR!
Logical NOT (depending on grammar rules)++
Increment:- Pre-Increment (
++i
): Increments the value ofi
by 1 before it is used in an expression. - Post-Increment (
i++
): Uses the current value ofi
, then increments it by 1.
- Pre-Increment (
--
Decrement:- Pre-Decrement (
--i
): Decrements the value ofi
by 1 before it is used in an expression. - Post-Decrement (
i--
): Uses the current value ofi
, then decrements it by 1.
- Pre-Decrement (
- If/Else
edgy (condition) { // if-true block } amogus { // else block }
- While
goon (i < 5) { // loop body }
- Do-While
mewing { // loop body } goon (i < 5);
- For
flex (init_expr; condition; increment) { // loop body }
- Switch
ohio (expression) { sigma rule value: // case body bruh; based: // default case }
rizz i = 0;
declares an integer variablei
, assigned 0.i = i + 1;
increments i by 1, following typical C expression syntax.
bussin expression;
to end the main function (or any function, if you extend the language).- Example:
bussin 0;
yapping
: prints text and automatically appends a newline.yappin
: prints text without adding a newline.baka
: prints tostderr
, typically used for errors/warnings.ragequit
: terminates program execution immediately with the provided exit code.
void yapping(const char* format, ...);
- Similar to
printf
, but always appends its own newline after printing. - If you include
\n
informat
, expect two line breaks in total.
Example:
yapping("Value: %d", 10);
// Output => "Value: 10\n"
void yappin(const char* format, ...);
- Similar to
printf
but no extra newline is added. - Perfect for building partial lines or for more granular control of output formatting.
Example:
yappin("Hello ");
yappin("World!\n");
// Output => "Hello World!\n"
void baka(const char* format, ...);
- Prints error messages to
stderr
. - Does not automatically add a newline (unless your format string includes one).
- Great for logs, warnings, and error messages.
Example:
baka("Error: undefined variable %s\n", varName);
void ragequit(int exit_code);
- Terminates program execution immediately with the provided exit code.
- No additional output is printed unless explicitly added before the ragequit call.
Example:
ragequit(1);
void chill(unsigned int seconds);
- Sleeps for a specified number of seconds (must be an unsigned integer)
Example:
chill(2);
- No built-in support for increment/decrement (
++
,--
). - Functions other than
skibidi main
not fully supported (unless you add them). - Arrays, complex data structures, and advanced memory management are absent.
- Error reporting is minimal, typically halting on the first serious parse error.
- Some macOS users must manually manage
libfl
symlinks. - Minimal string manipulation: no standard library for string operations.
- Grammar conflicts can arise if you expand the language significantly.
- The language’s comedic nature may cause colleagues to question your sanity.
The term "brain rot" was declared Oxford Word of the Year 2024, symbolizing the phenomenon of “the supposed deterioration of a person’s mental or intellectual state” due to low-value or meme-saturated online content. Brainrot the language playfully leans into this concept, intentionally using the so-called “nonsensical” or “trivial” memes to highlight a bit of self-awareness about how internet culture shapes our speech and thinking.
- The language’s name, “Brainrot,” resonates with the 2024 Word of the Year conversation.
- Memes like “Skibidi Toilet,” “Only in Ohio,” and “rizz” are central to Gen Z and Gen Alpha humor. Brainrot references them liberally as a whimsical statement on how quickly online slang evolves—and how easily it can be turned into code.
- The unstoppable spread of these memes ironically parallels the unstoppable creativity and chaos that emerges from community-driven language development.
If you want to add new slang or expand Brainrot:
- Fork the GitHub repository.
- Create a new branch for your changes.
- Edit the grammar (
lang.y
) and lexer (lang.l
) to support the new token or feature. - Submit a Pull Request with a clear description of your changes.
All contributions, even more memes, are welcome—just be prepared for the comedic consequences!
This project is licensed under the GPL License. See the LICENSE
file in the repository for more details. Essentially, you’re free to modify and distribute Brainrot, so long as you keep it open-source and credit the original authors.
Brainrot is a testament to the fact that compiler design can be both educational and thoroughly unserious. Whether you’re an aspiring language implementer, a meme connoisseur, or just someone who thought “C needed more spice,” Brainrot might be the ideal playground for you. Code in Brainrot, add your own slang, or show it off to your friends to watch them recoil in confusion and laughter.
“Just because you can do something doesn’t mean you should—but in Brainrot’s case, maybe you really should.”
Happy coding, and remember: if your mind starts to go blank from all the memes, that’s not a bug—it’s Brainrot by design!