Brainrot
Brainrot programming language interpreter
Install / Use
/learn @Brainrotlang/BrainrotREADME
Brainrot Programming Language
Brainrot is a meme-inspired programming language that translates common programming keywords into internet slang and meme references. It's built using Flex (lexical analyzer) and Bison (parser generator), making it a fun way to learn about language processing and compiler design.
History
The TRUE history behind the Brainrot programming language can be found here.
🤔 What is Brainrot?
Brainrot is a C-like programming language where traditional keywords are replaced with popular internet slang. For example:
void→skibidiint→rizzfor→flexreturn→bussin
📋 Requirements
To build and run the Brainrot compiler, you'll need:
- GCC (GNU Compiler Collection)
- Flex (Fast Lexical Analyzer)
- Bison (Parser Generator)
Installation on Different Platforms
Ubuntu/Debian
sudo apt-get update
sudo apt-get install gcc flex bison libfl-dev
Arch Linux
sudo pacman -S gcc flex bison
macOS (using Homebrew)
brew install gcc flex bison
Some macOS users are experiencing an error related to libfl. First, check if libfl is installed at:
/opt/homebrew/lib/libfl.dylib # For Apple Silicon
/usr/local/lib/libfl.dylib # For Intel Macs
And if not, you have to find it and symlink to it. Find it using:
find /opt/homebrew -name "libfl.*" # For Apple Silicon
find /usr/local -name "libfl.*" # For Intel Macs
And link it with:
sudo ln -s /path/to/libfl.dylib /opt/homebrew/lib/libfl.dylib # For Apple Silicon
sudo ln -s /path/to/libfl.dylib /usr/local/lib/libfl.dylib # For Intel Macs
For NixOS
git clone https://github.com/Brainrotlang/brainrot.git
cd brainrot
nix develop
# then create your .brainrot file
./result/bin/brainrot filename.brainrot
Or via a flake-based NixOS config (/etc/nixos/flake.nix), which always tracks the latest version:
# /etc/nixos/flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
brainrot.url = "github:Brainrotlang/brainrot";
};
outputs = { nixpkgs, brainrot, ... }: {
nixosConfigurations.your-hostname = nixpkgs.lib.nixosSystem {
modules = [
./configuration.nix
{
# For a specific user
users.users.username = {
packages = [ brainrot.packages.x86_64-linux.default ];
};
# For system-wide installation
environment.systemPackages = [
brainrot.packages.x86_64-linux.default
];
}
];
};
};
}
Run nix flake update whenever you want to pull the latest version, then rebuild with sudo nixos-rebuild switch.
🚀 Building the Compiler
- Clone this repository:
git clone https://github.com/Brainrotlang/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 the compiler:
make
NOTE: The gcc version we use to test is v13 if you get any warnings remove -Werror flag from the Makefile
Installation
sudo make install
Uninstall
sudo make uninstall
💻 Usage
- Create a Brainrot source file (e.g.,
hello.brainrot):
skibidi main {
yapping("Hello, World!");
bussin 0;
}
- Run your Brainrot program:
./brainrot hello.brainrot
Check out the examples:
🗪 Community
Join our community on:
📚 Language Reference
Keywords
| Brainrot | C Equivalent | Implemented? | | ---------- | ------------ | ------------ | | skibidi | void | ✅ | | rizz | int | ✅ | | cap | bool | ✅ | | 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 | ✅ | | thicc | long long | ✅ | | rant | string type | ✅ | | lit | typedef | ❌ |
Preprocessor directives
| Brainrot | C Equivalent | Implemented? | | ---------- | ------------ | ------------ | | #cooked | #include | ❌ | | #edgydef | #ifdef | ❌ | | #edgyndef | #ifndef | ❌ | | #endedgy | #endif | ❌ | | #slaps | #define | ❌ |
Builtin functions
Check the user documentation.
Operators
The language supports basic arithmetic operators:
+Addition-Subtraction*Multiplication/Division=Assignment<Less than>Greater than&&Logical AND||Logical OR
⚠️ Limitations
Current limitations include:
- Limited support for complex expressions
- Basic error reporting
- No support for arrays in user-defined functions
- No support for pointers
🔌 VSCode Extension
Brainrot has a Visual Studio Code extension to enhance your development experience with syntax highlighting and support for the Brainrot programming language. You can find it here:
🤝 Contributing
Feel free to contribute to this project by:
- Forking the repository
- Creating a new branch for your feature
- Submitting a pull request
📝 License
This project is licensed under the GPL License - see the LICENSE file for details.
🙏 Acknowledgments
- This project is created for educational purposes
- Inspired by meme culture and internet slang
- Built using Flex and Bison tools
🐛 Issues
Please report any additional issues in the GitHub Issues section.
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
