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.
The TRUE history behind the Brainrot programming language can be found here.
Brainrot is a C-like programming language where traditional keywords are replaced with popular internet slang. For example:
voidβskibidiintβrizzforβflexreturnβbussin
To build and run the Brainrot compiler, you'll need:
- GCC (GNU Compiler Collection)
- Flex (Fast Lexical Analyzer)
- Bison (Parser Generator)
sudo apt-get update
sudo apt-get install gcc flex bison libfl-devsudo pacman -S gcc flex bisonbrew install gcc flex bisonSome 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
- 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:
makeNOTE: The gcc version we use to test is v13 if you get any warnings remove -Werror flag from the Makefile
sudo make installsudo make uninstall- Create a Brainrot source file (e.g.,
hello.brainrot):
skibidi main {
yapping("Hello, World!");
bussin 0;
}- Run your Brainrot program:
./brainrot hello.brainrotCheck out the examples:
Join our community on:
| Brainrot | C Equivalent | Implemented? |
|---|---|---|
| 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 | β |
| thicc | long long | β |
| rant | string type | β |
| lit | typedef | β |
Check the user documentation.
The language supports basic arithmetic operators:
+Addition-Subtraction*Multiplication/Division=Assignment<Less than>Greater than&&Logical AND||Logical OR
Current limitations include:
- Limited support for complex expressions
- Basic error reporting
- No support for arrays in user-defined functions
- No support for pointers
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:
Feel free to contribute to this project by:
- Forking the repository
- Creating a new branch for your feature
- Submitting a pull request
This project is licensed under the GPL License - see the LICENSE file for details.
- This project is created for educational purposes
- Inspired by meme culture and internet slang
- Built using Flex and Bison tools
Please report any additional issues in the GitHub Issues section.