From Esolang
Jump to navigation Jump to search

bruh():bruh() is an esolang by User:None1 and pronouced "bruh bruh", it uses only built-in functions and custom functions.


There are two types of functions: custom functions and built-in functions.

Each function is given a random unique ID from 0 to 264-1, every time the program is executed, the ID of the function is reset when it is defined, but won't change during the execution.

bruh():bruh() has only one type: Unbounded unsigned integer (when 0 is subtracted it stays 0), so when a function is passed as an argument to another function, its ID is passed instead.

Custom functions

To define a custom function, use the following syntax:


Function name and argument names can have any character except commas, parentheses, colons and line feeds. arguments are separated by commas.

When the function is called, it evaluates and returns the result of expression.

The name of function and the argument names cannot conflict with existing function names, otherwise a syntax error is raised.

All names in bruh():bruh() are case sensitive.

bruh() function

bruh() is indeed the most important custom function in bruh():bruh(), it is the entrypoint of a program, like the main() function in C. bruh() must take no arguments, and its return value is ignored. A program may not have a bruh() function, but would do nothing without it. Note that bruh() supports recursion, so the program below works as an infinite loop.


built-in functions

There are these built-in functions:

Function What it does
in() Read an integer from user input and return it
inc() Read a character from user input and return its ASCII value
out(x) Output x as decimal without trailing space or line feed and return x
outc(x) Output the character with the same ASCII value as x and return x
add(a,b) Return a+b
sub(a,b) Return a-b
mul(a,b) Return a*b
div(a,b) Return the quotient of a/b
mod(a,b) Return the remainder of a/b
0()~9() Return corresponding integer (0~9)
a()~f() Return 10 to 15 respectively
if(a,b,c,params) If a is nonzero, call the function with the ID b with arguments params, otherwise call the function with the ID c with arguments params, return return value of corresponding function. This is the only function that can be called with a mutable number of arguments

EOF returns 0 in all input functions

Function calls

Call stack

Unlike other languages like Python and Java, bruh():bruh() needs a stack with infinite size, so the maximum number of recursion solely depends on your computer's memory.

Note that a function is only allowed to call functions defined before it, so the following program is invalid:


And this one is also invalid, because the ID of the g function hasn't been created yet:


Other syntax


Line feeds are not ignored in this esolang, but spaces and tabs are. So the following program is invalid because of name conflict:

br uh():br uh()
bruh():br uh()


; comments out all characters after it until the next line.

Example programs

Cat program


A+B problem


Truth Machine


Infinite loop


It silently consumes memory until your computer dies.



n-th Fibonacci number