Syntax
BrainRot Lang syntax closely follows C-family conventions — curly braces, semicolons in for loops, and standard operator precedence — with meme keywords replacing the usual ones.
Program Structure
Every program must have exactly one let_him_cook main() defined at the top level acting as the entry point. Execution begins automatically from the first line inside main(). Variables and functions defined outside of main() act in the global scope and can be securely referenced from anywhere within the program.
# Every program needs exactly one main() entry point
let_him_cook main() {
# execution starts here, start cooking
say_my_name("brainrot activated")
}
# Global variables are accessible everywhere
trust_me_bro GLOBAL_MAX = 100
# Helper functions can be defined outside main()
let_him_cook helper(x) {
take_this x * 2
}Expressions
BrainRot supports standard arithmetic, comparison, and logical expressions. Operator precedence follows the standard order (exponentiation → multiply/divide → add/subtract → comparison → logical AND → logical OR).
let_him_cook main() {
# Basic arithmetic gives quick maths
trust_me_bro a = 2 + 3 * 4 # 14 (precedence respects standard rules)
trust_me_bro b = (2 + 3) * 4 # 20
# Comparison returns boolean fr_fr or cap
trust_me_bro big = a > b # cap (false)
# Logical operators combine truth
trust_me_bro both = fr_fr && cap # cap
trust_me_bro either = cap || fr_fr # fr_fr
# Exponentiation for big numbers
trust_me_bro sq = 2 ** 8 # 256
# Increment / decrement (because we lazy)
a++
b--
}Operators
| Category | Operators |
|---|---|
| Arithmetic | + - * / % ** |
| Assignment | = += -= *= /= |
| Comparison | == != < > <= >= |
| Logical | && || ! |
| Increment | ++ -- |
Comments
BrainRot Lang supports single-line comments using the # character.
# This is a single-line comment
let_him_cook main() {
# BrainRot only supports single-line comments
# using the hash (#) symbol
say_my_name("no multi-line comments, fr fr")
}